New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 878801 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Oct 3
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug

Blocking:
issue 839970



Sign in to add a comment

Unable to trigger HW Overlay for webgl

Project Member Reported by tbuck...@chromium.org, Aug 29

Issue description

Chrome Version: 70.0.3532.0
OS Version: 11011.0.0

What steps will reproduce the problem?
1. Enable chrome://flags#tint-gl-composited-content
2. Visit https://webgl-latency.firebaseapp.com/ which creates a webgl canvas with {lowLatency: true}
3. Notice that the canvas is not promoted to a hw underlay (tinted pink, higher latency)
4. Uncheck "Toggle palette" checkbox at the top
5. Notice that canvas now gets a hw overlay

What is the expected result? Canvas gets hw underlay in #3
What happens instead of that? Canvas is not getting a hw underlay


Please provide any additional information below. Attach a screenshot if
possible.

UserAgentString: Mozilla/5.0 (X11; CrOS x86_64 11011.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3532.0 Safari/537.36
 
Owner: mcasas@chromium.org
The WebGL quad is not marked as opaque. That means we can't know for sure if the contents need to be blended with the background, so we can't do underlay in that case.
Your demo seems to correctly initialize webgl context alpha parameter to false.

It looks like for the offscreen canvas, that is used for the low latency mode, Chrome ignores the context creation parameters and just sets blending parameter conservatively: https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/graphics/canvas_resource_dispatcher.cc?q=CanvasResourceDispatcher&sq=package:chromium&g=0&l=277

They filed crbug.com/705019 to fix that.

Miguel, do you think you can plumb trough that parameter? It should also significantly improve performance when we have low latency in an on-top overlay, since we won't need to re-composite what's underneath.
Cc: fs...@chromium.org
CCing fserb@ that might be interested for offscreen canvas.
This also affects Infinite Painter, an Android app.

1) Install Infinite Painter from Play Store
2) Opt into beta within Play Store, install update (may take ~15min to show up)
3) Open Infinite Painter and click 3-dot menu > Settings. Scroll to bottom, enable "Beta Testing", set "Zero latency" to "Single buffer (GPU)"
4) Try drawing. Notice that canvas is not promoted to a hw underlay due to UI
5) Go into Settings again and enable "Hide Interface"
6) Try drawing. Notice that canvas is promoted to a hw underlay when the UI is hidden.

Expected: In #4, canvas gets hw underlay even with UI visible.
Actual: In #4, canvas is not getting hw underlay.
Labels: LowLatency
Status: Started (was: Assigned)
With crrev.com/c/1228859 on ToT on nautilus the "canvas" where lines are
drawn is promoted to overlay even with the OS app dock and/or the palette
appearing (doesn't get tinted red).
Summary: Unable to trigger HW Overlay for webgl (was: Unable to trigger HW Overlay)
Re: #5 -- awesome!!

I've split the Android issue into a separate bug: Issue 885180. It sounds like they are setting everything to be opaque, so it may be a different issue.
Project Member

Comment 7 by bugdroid1@chromium.org, Sep 21

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/441c1797227b41ae9186652f9ef33b549559e1bd

commit 441c1797227b41ae9186652f9ef33b549559e1bd
Author: Miguel Casas <mcasas@chromium.org>
Date: Fri Sep 21 01:07:26 2018

canvas: rename unit test file

This CL renames the file hosting CanvasResourceDispatcherTest, to comply
with the class (and functionality) inside.
s/offscreen_canvas_frame_dispatcher_test.cc/canvas_resource_dispatcher_test.cc/
Stumbled upon this mismatch during crrev.com/c/1228859.

Bug:  878801 
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ib653677f7994de4f0e0178df3a7403a70abd1b99
Reviewed-on: https://chromium-review.googlesource.com/1237180
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Miguel Casas <mcasas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593034}
[modify] https://crrev.com/441c1797227b41ae9186652f9ef33b549559e1bd/third_party/blink/renderer/platform/BUILD.gn
[rename] https://crrev.com/441c1797227b41ae9186652f9ef33b549559e1bd/third_party/blink/renderer/platform/graphics/canvas_resource_dispatcher_test.cc

Blocking: 839970
Project Member

Comment 9 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

Status: Fixed (was: Started)

Sign in to add a comment