[webkit-reviews] review requested: [Bug 85108] [chromium] Contents flash when switching to a tab with all discarded textures : [Attachment 142877] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat May 19 12:24:55 PDT 2012


Dana Jansens <danakj at chromium.org> has asked  for review:
Bug 85108: [chromium] Contents flash when switching to a tab with all discarded
textures
https://bugs.webkit.org/show_bug.cgi?id=85108

Attachment 142877: Patch
https://bugs.webkit.org/attachment.cgi?id=142877&action=review

------- Additional Comments from Dana Jansens <danakj at chromium.org>
- Making impl "visible" only when it has a frame to draw is a problem, because
it has to become "visible" to get a visible memory allocation. so adding a
second state to the impl side "sourceFrameCanBeDrawn" that is true when the
frame being committed is one that is allowed to be drawn (has a foreground
memory allocation).
- canDraw returns false when !sourceFrameCanBeDrawn
- CCSchedulerStateMachine should know that !visible means we are not going to
draw until we commit. since commits are what make us visible now.
- Only force a commit when becoming visible
- Set memory limits in setVisible(false) using the same
setContentsMemoryLimitBytes() method as any other code that wants to set a
memory limit.
- CCSingleThreadProxy does not animate when !visible. Animation is handled by
CCLTHImpl by posting a timer task when it is not visible, this makes behaviour
consistent with CCThreadProxy and is verified by
CCLayerTreeHostTestTickAnimationWhileBackgrounded.runSingleThread. Without this
change, the timer was not used in single-thread as each animation tick would
cause a composite which would immediately animate again, and background
animations were unthrottled. We now use willAnimateLayers() in this test
instead so that we can setVisible(false) before the animation happens and posts
a commit in single-thread, ensuring that we only commit once while visible.
- Improve the unit test for sourceFrameCanBeDrawn business.


I removed an assert from CCSchedulerStateMachine. It said that if you were
WAITING_FOR_FIRST_DRAW and you drew, then you expected to be (needsCommit ||
!visible). This is because if you changed to become visible, then it expected
that you would need a commit as a result. However, now we change visiblity
inside a commit, which occurs after ACTION_COMMIT. So we may draw now, while
WAITING_FOR_FIRST_DRAW, because the commit made us visible, and that's not
illegal.


More information about the webkit-reviews mailing list