[Webkit-unassigned] [Bug 36883] [Qt] Parallel painting in WebKit

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Apr 9 08:58:32 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=36883





--- Comment #5 from Zoltan Herczeg <zherczeg at webkit.org>  2010-04-09 08:58:30 PST ---
I would like to give you a little summarization where I am now, and I also have
some questions. Now, a simple page (like www.google.com) can be rendered
without a render context (QPainter) in the main thread (the pointer is set to
0). Unfortunately the border is missing around the input text box and the radio
button images as well. How these graphics controls are rendered? Are they
special image resources or they rendered directly by some toolkit?

Since QPixmaps are not thread safe, I had to switch QImages, but too many
changes were required in the trunk, unfortunately. I don't really like the code
now, but I have no better idea.

On the good side, I can see smoother animations and faster scrolling in some
cases, but the other side is true: a more responsive main thread can issue more
frames to paint when you pull down the scrollbar. Many of these internal frames
are not displayed at all, but the last frame have to wait until all internal
frames were rendered. In other words, several performance optimizations can be
employed later (like splitting the wiewport to multiple painting threads,
clever viewport change hnadling, etc), but now I focus on the GraphicsContext
side.

Most of the commands are fairly simple, one can easily convert them to
messages. However, the story is different with resources, especially many of
them are not ref-counted at all.

These are:
Image - Images are ref-counted, I can simply send them to the thread, and deref
on the main-thread after they were rendered
Generator - used by FillRect. I decided to keep this rare function in the main
thread.
ImageBuffer - used by clipToImageBuffer, not implemented in Qt. Probably I will
not support it as well.
TextRun - Not ref-counted. The necessary part is duplicated for the thread.
Font - Not ref-counted. Although it seems Qt does not free them at all
Path - Not ref-counted, and probably freed early. This is a tough one. Shall I
duplicate it or make it refcounted?

Another tough problem is the transformations, since getCTM() and origin()
should return with something useful. My idea is creating a QStack<QTransform>
array, and execute the transformations there (on the main thread). Is it
possible to repeat the transformations as the QPainter would do them?

GraphicsContext::drawFocusRing(const Vector<Path>& paths, ... 
   // FIXME: implement
   why not use NotImplemented() here as well?

drawPath(), fillPath(), strokePath() - looks like platform dependent (two
platforms use them). Should be moved out of the common part of GraphicsContext.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list