New issue
Advanced search Search tips

Issue 705019 link

Starred by 3 users

Issue metadata

Status: Assigned
Owner:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

[OffscreenCanvas] Optimize the compositing of opaque placeholder canvases

Project Member Reported by junov@chromium.org, Mar 24 2017

Issue description

For culling optimizations to kick-in we need some mechanism for determining whether a the canvas is opaque (alpha: false) in CompositedLayerMapping::updateContentsOpaque()
 

Comment 1 by junov@chromium.org, Mar 24 2017

In OffscreenCanvasFrameDispatcherImpl::dispatchFrame we should also adjust "needsBlending" and "opaqueRect" based on the context's alpha option.
Owner: ----
Status: Available (was: Assigned)
Components: Blink>WebGL
Owner: mcasas@chromium.org
Status: Assigned (was: Available)
Project Member

Comment 4 by bugdroid1@chromium.org, 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