device_scale_factor need to be updated for high dpi devices |
||||
Issue descriptionCurrently we hard code this one to be 1, should be changed for high dpi devices.
,
Nov 28 2016
,
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
,
May 7 2018
Currently, the CompositorFrame prepared in OffscreenCanvasFrameDispatcher (in worker) simply sets device scale factor to be 1.0f: // TODO(crbug.com/652931): update the device_scale_factor frame.metadata.device_scale_factor = 1.0f; (https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/graphics/offscreen_canvas_frame_dispatcher.cc?q=DispatchFrame&sq=package:chromium&l=149) This should be updated to read the device scale factor from display compositor. The challenge is how we can know this information from the worker thread of renderer, and how we can plumb this information to Blink. Delegating this to fserb@ who've been working on OffscreenCanvas. The viz team might know how it can be done so I'm cc danakj@ and fsamuel@ here.
,
Aug 13
,
Aug 13
Pass this info along from blink? I would suggest looking into how we propagate along WebScreenInfo and carry that into offscreen canvas. |
||||
►
Sign in to add a comment |
||||
Comment 1 by bugdroid1@chromium.org
, Nov 9 2016