New issue
Advanced search Search tips
Starred by 3 users
Status: Fixed
Owner:
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocking:
issue 563816



Sign in to add a comment
[OffscreenCanvas] Attempting to match display resolution does not work
Project Member Reported by junov@chromium.org, Oct 12 2016 Back to list
The demo attached attempts to scales canvas content by x2 to match native display resolution on high DPI, but the layout scaling does not work.
 
offscreen_webgl_bug.html
2.4 KB View Download
Cc: xidac...@chromium.org junov@chromium.org
Owner: xlai@chromium.org
xlai@: I had a discussion with junov@, looks like offscreen canvas doesn't keep track of the CSS style. We believe this could be addressed when we create the surface layer bridge. Could you take a look into this, you are more familiar with that part. Thanks.
Blocking: 563816
Labels: -OffscreenCanvas -Pri-3 OffScreenCanvas Pri-2
Make this block shipping, raise to Pri-2
Comment 3 by xlai@chromium.org, Oct 20 2016
Are we going to consider CSS style resizing on canvas as well?

Project Member Comment 4 by bugdroid1@chromium.org, Dec 16 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5e87e713d6ed8c36fb37b814c6b65e7096d4554e

commit 5e87e713d6ed8c36fb37b814c6b65e7096d4554e
Author: xlai <xlai@chromium.org>
Date: Fri Dec 16 02:10:25 2016

Match html canvas which is transferred to OffscreenCanvas to CSS style

This CL aims to make html canvas to match to CSS style restriction regardless
whether it is transferred to OffscreenCanvas or not.

In a usual compositor commit, when a css style is imposed on the html canvas
to change its width and height, its layer will reset a different bounds.
However, in the case when html canvas has transferred control to offscreen,
it is using a SurfaceLayer, which directly use surface_size_ without
incorporating layer bounds to append SurfaceDrawQuad. This CL changes
SurfaceLayerImpl to take into account the special case when layer bounds is
different from surface_size by doing a transformation on the
Quad, especially when the aspect ratio is different.

The CL respects existing non-canvas cases on high-dpi devices and settings
when enable-use-zoom-for-dsf is on or off.

Also, it is also possible that the compositor commit due to style change
happens before the Surface Layer for html canvas is created. To prevent
flakiness, we force a compositor commit at the time when Surface Layer is
created and registered to GraphicsLayers.

TBR=khushalsagar@chromium.org, twellington@chromium.org, pfeldman@chromium.org
BUG= 655335 , 652931
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel

Review-Url: https://codereview.chromium.org/2495373003
Cr-Commit-Position: refs/heads/master@{#438986}

[modify] https://crrev.com/5e87e713d6ed8c36fb37b814c6b65e7096d4554e/blimp/client/core/compositor/blimp_compositor.cc
[modify] https://crrev.com/5e87e713d6ed8c36fb37b814c6b65e7096d4554e/cc/layers/heads_up_display_layer_impl.cc
[modify] https://crrev.com/5e87e713d6ed8c36fb37b814c6b65e7096d4554e/cc/layers/layer_impl.cc
[modify] https://crrev.com/5e87e713d6ed8c36fb37b814c6b65e7096d4554e/cc/layers/layer_impl.h
[modify] https://crrev.com/5e87e713d6ed8c36fb37b814c6b65e7096d4554e/cc/layers/painted_scrollbar_layer_impl.cc
[modify] https://crrev.com/5e87e713d6ed8c36fb37b814c6b65e7096d4554e/cc/layers/picture_layer_impl.cc
[modify] https://crrev.com/5e87e713d6ed8c36fb37b814c6b65e7096d4554e/cc/layers/surface_layer.cc
[modify] https://crrev.com/5e87e713d6ed8c36fb37b814c6b65e7096d4554e/cc/layers/surface_layer.h
[modify] https://crrev.com/5e87e713d6ed8c36fb37b814c6b65e7096d4554e/cc/layers/surface_layer_impl.cc
[modify] https://crrev.com/5e87e713d6ed8c36fb37b814c6b65e7096d4554e/cc/layers/surface_layer_impl.h
[modify] https://crrev.com/5e87e713d6ed8c36fb37b814c6b65e7096d4554e/cc/layers/surface_layer_impl_unittest.cc
[modify] https://crrev.com/5e87e713d6ed8c36fb37b814c6b65e7096d4554e/cc/layers/surface_layer_unittest.cc
[modify] https://crrev.com/5e87e713d6ed8c36fb37b814c6b65e7096d4554e/content/renderer/child_frame_compositing_helper.cc
[add] https://crrev.com/5e87e713d6ed8c36fb37b814c6b65e7096d4554e/content/test/data/gpu/pixel_offscreenCanvas_transfer_after_style_resize.html
[add] https://crrev.com/5e87e713d6ed8c36fb37b814c6b65e7096d4554e/content/test/data/gpu/pixel_offscreenCanvas_transfer_before_style_resize.html
[modify] https://crrev.com/5e87e713d6ed8c36fb37b814c6b65e7096d4554e/content/test/gpu/gpu_tests/pixel_expectations.py
[modify] https://crrev.com/5e87e713d6ed8c36fb37b814c6b65e7096d4554e/content/test/gpu/gpu_tests/pixel_test_pages.py
[modify] https://crrev.com/5e87e713d6ed8c36fb37b814c6b65e7096d4554e/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
[modify] https://crrev.com/5e87e713d6ed8c36fb37b814c6b65e7096d4554e/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.cpp
[modify] https://crrev.com/5e87e713d6ed8c36fb37b814c6b65e7096d4554e/ui/android/delegated_frame_host_android.cc
[modify] https://crrev.com/5e87e713d6ed8c36fb37b814c6b65e7096d4554e/ui/compositor/layer.cc

Project Member Comment 5 by bugdroid1@chromium.org, Dec 19 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3e1e730a7252ed7b0b9deb673f5577381cbe295d

commit 3e1e730a7252ed7b0b9deb673f5577381cbe295d
Author: xlai <xlai@chromium.org>
Date: Mon Dec 19 18:52:41 2016

Remove failed gpu pixel test entries

TBR=kbr@chromium.org
BUG= 655335 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2586283002
Cr-Commit-Position: refs/heads/master@{#439512}

[modify] https://crrev.com/3e1e730a7252ed7b0b9deb673f5577381cbe295d/content/test/gpu/gpu_tests/pixel_expectations.py

Comment 6 by xlai@chromium.org, Dec 20 2016
Status: Fixed
Sign in to add a comment