Bug 93036 - [BlackBerry] Add default implementation of GraphicsLayerClient::contentsVisible()
Summary: [BlackBerry] Add default implementation of GraphicsLayerClient::contentsVisib...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit BlackBerry (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Arvid Nilsson
URL:
Keywords:
Depends on: 93040
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-02 15:41 PDT by Arvid Nilsson
Modified: 2012-08-02 19:27 PDT (History)
7 users (show)

See Also:


Attachments
Patch (18.17 KB, patch)
2012-08-02 16:54 PDT, Arvid Nilsson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Arvid Nilsson 2012-08-02 15:41:35 PDT
This bug deals with a very specific situation where checkerboard would never resolve. In LayerTiler, render jobs are used for reactive rendering, to make sure checkerboard does not stay on screen. When checkerboard is detected on the compositing thread, a render job is scheduled to make sure it's resolved. Proactive rendering is handled by the prefill mechanism, ultimately falling back on GraphicsLayerClient::contentsVisible().

If the entire layer was invalidated, the render jobs were cleared, making us entirely dependent on the implementation of GraphicsLayerClient::contentsVisible() to determine which tiles should be rendered.

Fixed by not clearing visibility jobs when the entire layer is invalidated, thus making us more robust against contentsVisible implementation, even allowing it to always return false and make the layer rely entirely on reactive rendering.

Also removed dead code related to the deprecated LayerTiler::m_tilesWebKitThread mechanism, which has been replaced by the render jobs.

PR 187458
Comment 1 Arvid Nilsson 2012-08-02 15:46:09 PDT
Hmm, trying to think of a better title for this bug.
Comment 2 Arvid Nilsson 2012-08-02 16:05:07 PDT
Whoa, I discovered contentsVisible isn't even upstreamed yet. How about this?

LayerTiler uses both proactive and reactive rendering to populate tiles. If contentsVisible() is accurate, it will cause the right tiles to be rendered. Failing that, when a dirty tile is found to be visible on the compositing thread, a render job is scheduled.

Returning true by default would cause memory usage to balloon, because the LayerTiler would believe every tile is visible and always needs to be rendered. Instead, we choose to return false by default, relying entirely on reactive rendering unless the client reimplements this method.

However this revealed a subtle bug. If the entire layer was invalidated every frame, checkerboard would never resolve.

Fixed by not clearing visibility jobs when the entire layer is invalidated, thus making us robust against an incomplete contentsVisible implementation.

Also removed dead code related to the deprecated LayerTiler::m_tilesWebKitThread mechanism, which has been replaced by the new visibility handling described here.
Comment 3 Arvid Nilsson 2012-08-02 16:13:38 PDT
Or should I upstream in a separate bug?
Comment 4 Arvid Nilsson 2012-08-02 16:54:09 PDT
Created attachment 156207 [details]
Patch
Comment 5 George Staikos 2012-08-02 17:08:14 PDT
Comment on attachment 156207 [details]
Patch

This is a nice cleanup.  I'm not sure the bitfield change helps anything but doesn't make much of a difference to me.
Comment 6 WebKit Review Bot 2012-08-02 19:27:01 PDT
Comment on attachment 156207 [details]
Patch

Clearing flags on attachment: 156207

Committed r124550: <http://trac.webkit.org/changeset/124550>
Comment 7 WebKit Review Bot 2012-08-02 19:27:04 PDT
All reviewed patches have been landed.  Closing bug.