[OffscreenCanvas] Optimize the compositing of opaque placeholder canvases |
|||
Issue descriptionFor culling optimizations to kick-in we need some mechanism for determining whether a the canvas is opaque (alpha: false) in CompositedLayerMapping::updateContentsOpaque()
,
Jul 25
,
Sep 18
,
Sep 21
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/dfcdcbcc4d89e790534df85697159dcdb211aa61 commit dfcdcbcc4d89e790534df85697159dcdb211aa61 Author: Miguel Casas <mcasas@chromium.org> Date: Fri Sep 21 18:43:57 2018 Canvas: Wire context's alpha to DispatchFrame{Sync}() and PrepareFrame() This CL adds a parameter |is_opaque| to CanvasResourceDispatcher's DispatchFrame{Sync}() and the private PrepareFrame(), and wires it to the (offscreen, normal) Context's IsOpaque(). Two motivations: - offscreen canvas should respect the opacity of the context (they don't do that now on ToT). - |is_opaque| is needed when creating the viz::SharedQuadState and setting viz::DrawQuad::needs_blending. This quad needs to be opaque to promote it to underlay adequately on CrOs (and when promoted to overlay, we can also avoid re compositing what's below). offscreen_canvas_test.cc and html_canvas_element_module_test.cc are extended to test this new code: for that, Mock mojo objects are defined in mock_viz_mojo.h, and plugged in the respective tests so that the CompositorFrames can be inspected for opacity/transparency (tests are parameterised to try the combinations). Made a few vars const and a few const constexpr, removed superfluous {}. Bug: 878801 , 705019 Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel Change-Id: Ice1f02adee79b13b9a3f8ae915594b71487bb963 Reviewed-on: https://chromium-review.googlesource.com/1228859 Reviewed-by: Stephen White <senorblanco@chromium.org> Reviewed-by: Mounir Lamouri <mlamouri@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Miguel Casas <mcasas@chromium.org> Cr-Commit-Position: refs/heads/master@{#593276} [modify] https://crrev.com/dfcdcbcc4d89e790534df85697159dcdb211aa61/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc [modify] https://crrev.com/dfcdcbcc4d89e790534df85697159dcdb211aa61/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.cc [modify] https://crrev.com/dfcdcbcc4d89e790534df85697159dcdb211aa61/third_party/blink/renderer/modules/BUILD.gn [modify] https://crrev.com/dfcdcbcc4d89e790534df85697159dcdb211aa61/third_party/blink/renderer/modules/canvas/htmlcanvas/html_canvas_element_module_test.cc [modify] https://crrev.com/dfcdcbcc4d89e790534df85697159dcdb211aa61/third_party/blink/renderer/modules/canvas/offscreencanvas/offscreen_canvas_test.cc [add] https://crrev.com/dfcdcbcc4d89e790534df85697159dcdb211aa61/third_party/blink/renderer/modules/canvas/test/DEPS [add] https://crrev.com/dfcdcbcc4d89e790534df85697159dcdb211aa61/third_party/blink/renderer/modules/canvas/test/mock_viz_mojo.h [modify] https://crrev.com/dfcdcbcc4d89e790534df85697159dcdb211aa61/third_party/blink/renderer/platform/graphics/canvas_resource_dispatcher.cc [modify] https://crrev.com/dfcdcbcc4d89e790534df85697159dcdb211aa61/third_party/blink/renderer/platform/graphics/canvas_resource_dispatcher.h [modify] https://crrev.com/dfcdcbcc4d89e790534df85697159dcdb211aa61/third_party/blink/renderer/platform/graphics/canvas_resource_dispatcher_test.cc |
|||
►
Sign in to add a comment |
|||
Comment 1 by junov@chromium.org
, Mar 24 2017