|
|
Chromium Code Reviews|
Created:
3 years, 8 months ago by Eric Seckler Modified:
3 years, 8 months ago CC:
ajuma+watch-canvas_chromium.org, blink-reviews, blink-reviews-html_chromium.org, Rik, chromium-reviews, dglazkov+blink, dshwang Target Ref:
refs/heads/master Project:
chromium Visibility:
Public. |
Description[blink] Request compositing update when canvas hibernates/wakes up.
Not requesting the update can lead to the canvas not
being shown, as in the bug referenced below.
BUG=708445
Review-Url: https://codereview.chromium.org/2808493002
Cr-Commit-Position: refs/heads/master@{#465206}
Committed: https://chromium.googlesource.com/chromium/src/+/5047940999a9cf13e8635e61112fdaa7db885726
Patch Set 1 #Patch Set 2 : add test #
Total comments: 2
Patch Set 3 : trigger compositing update from Canvas2DLayerBridge instead #
Total comments: 2
Patch Set 4 : fix test for platforms that disable hibernation #Patch Set 5 : rebase #
Messages
Total messages: 52 (38 generated)
Description was changed from ========== FREEZE.indexed BUG= ========== to ========== [blink] Request compositing update when canvas visibility changes. BUG=708445 ==========
The CQ bit was checked by eseckler@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== [blink] Request compositing update when canvas visibility changes. BUG=708445 ========== to ========== [blink] Request compositing update when canvas visibility changes. Not requesting the update can lead to the canvas not being shown, as in the bug referenced below. BUG=708445 ==========
eseckler@chromium.org changed reviewers: + chrishtr@chromium.org
Chris, I believe this is a more appropriate fix, unit test included. Thanks!
https://codereview.chromium.org/2808493002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp (right): https://codereview.chromium.org/2808493002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp:1220: setNeedsCompositingUpdate(); Which of the conditions below depend on page visibility? https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/html/HTML...
https://codereview.chromium.org/2808493002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp (right): https://codereview.chromium.org/2808493002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp:1220: setNeedsCompositingUpdate(); On 2017/04/07 17:12:32, chrishtr wrote: > Which of the conditions below depend on page visibility? > > https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/html/HTML... CanvasRenderingContext2D::isComposited() -> isAccelerated() -> ImageBuffer::isAccelerated() -> Canvas2DImageBufferSurface::isAccelerated() -> Canvas2DLayerBridge::isAccelerated() -> isHibernating() And Canvas2DLayerBridge::hibernate() is eventually called by setIsHidden() above.
I don't think this is the right fix because the switch to hibernation is asynchronous (gets scheduled as an idle task when visibility changes). Therefore, your solution risk being flaky. The compositing update should be triggered by Canvas2DLayerBridge::hibernate() Here is how I suggest you solve it: Create a new method ImageBuffer::setNeedsCompositingUpdate(), which you can call from Canvas2DLayerBridge (m_imageBuffer). Then ImageBuffer can propagate that signal to the HTMLCanvasElement by going through the ImageBufferClient interface, which is inherited by HTMLCanvasElement.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
On 2017/04/07 18:50:21, Justin Novosad wrote: > I don't think this is the right fix because the switch to hibernation is > asynchronous (gets scheduled as an idle task when visibility changes). > Therefore, your solution risk being flaky. The compositing update should be > triggered by Canvas2DLayerBridge::hibernate() > Here is how I suggest you solve it: Create a new method > ImageBuffer::setNeedsCompositingUpdate(), which you can call from > Canvas2DLayerBridge (m_imageBuffer). Then ImageBuffer can propagate that signal > to the HTMLCanvasElement by going through the ImageBufferClient interface, which > is inherited by HTMLCanvasElement. Thanks, that makes sense. PTAL :)
The CQ bit was checked by eseckler@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== [blink] Request compositing update when canvas visibility changes. Not requesting the update can lead to the canvas not being shown, as in the bug referenced below. BUG=708445 ========== to ========== [blink] Request compositing update when canvas hibernates/wakes up. Not requesting the update can lead to the canvas not being shown, as in the bug referenced below. BUG=708445 ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
https://codereview.chromium.org/2808493002/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp (right): https://codereview.chromium.org/2808493002/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp:1423: ElementRequestsCompositingUpdateOnHibernateAndWakeUp) { The test seems to be failing on mac - is mac using a different setup?
https://codereview.chromium.org/2808493002/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp (right): https://codereview.chromium.org/2808493002/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp:1423: ElementRequestsCompositingUpdateOnHibernateAndWakeUp) { On 2017/04/11 07:32:59, Eric Seckler wrote: > The test seems to be failing on mac - is mac using a different setup? Ah, there's CANVAS2D_HIBERNATION_ENABLED :) Test should be fixed!
The CQ bit was checked by eseckler@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
Patchset #4 (id:60001) has been deleted
The CQ bit was checked by eseckler@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...) mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
Patchset #4 (id:80001) has been deleted
The CQ bit was checked by eseckler@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
Patchset #4 (id:100001) has been deleted
The CQ bit was checked by eseckler@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
eseckler@chromium.org changed reviewers: + junov@chromium.org
Chris, Justin, PTAL :)
I defer to junov@ on this review.
lgtm
The CQ bit was checked by eseckler@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by eseckler@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from junov@chromium.org Link to the patchset: https://codereview.chromium.org/2808493002/#ps140001 (title: "rebase")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch.
Bot data: {"patchset_id": 140001, "attempt_start_ts": 1492510940446590,
"parent_rev": "d64d884420dfcea54bcdcfe5d09386bcb9999fc4", "commit_rev":
"5047940999a9cf13e8635e61112fdaa7db885726"}
Message was sent while issue was closed.
Description was changed from ========== [blink] Request compositing update when canvas hibernates/wakes up. Not requesting the update can lead to the canvas not being shown, as in the bug referenced below. BUG=708445 ========== to ========== [blink] Request compositing update when canvas hibernates/wakes up. Not requesting the update can lead to the canvas not being shown, as in the bug referenced below. BUG=708445 Review-Url: https://codereview.chromium.org/2808493002 Cr-Commit-Position: refs/heads/master@{#465206} Committed: https://chromium.googlesource.com/chromium/src/+/5047940999a9cf13e8635e61112f... ==========
Message was sent while issue was closed.
Committed patchset #5 (id:140001) as https://chromium.googlesource.com/chromium/src/+/5047940999a9cf13e8635e61112f... |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
