Currently PlatformWindowDelegate allows to set device_pixel_ratio once in OnAcceleratedWidgetAvailable(), but there is report that device_pixel_ratio has changed. On Fuchsia Scenic may change device_pixel_ratio dynamically.
Per comments in CL, I believe that you can resolve this with a custom implementation of NativeDisplayObserver
It looks like there is a lot of code that uses display::Display to get device scale, so we probably want to use the same approach on Fuchsia.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/9885115a2b4eed396736eaa9a051980b9176627d commit 9885115a2b4eed396736eaa9a051980b9176627d Author: Sergey Ulanov <sergeyu@chromium.org> Date: Tue Aug 14 01:49:16 2018 Add PlatformScreen interface in Ozone. Added OzonePlatform::CreateScreen(), which returns in instance of the new PlatformScren interface. Also added aura::SceenOzone that implements display::Screen on top of PlatformScreen. Bug: 850650 Change-Id: I3481dda921f564f0c117d9c8a0e8ce060254f4c3 Reviewed-on: https://chromium-review.googlesource.com/1162354 Commit-Queue: Sergey Ulanov <sergeyu@chromium.org> Reviewed-by: Scott Violet <sky@chromium.org> Reviewed-by: Robert Kroeger <rjkroege@chromium.org> Reviewed-by: Michael Spang <spang@chromium.org> Cr-Commit-Position: refs/heads/master@{#582792} [modify] https://crrev.com/9885115a2b4eed396736eaa9a051980b9176627d/content/shell/browser/shell_aura.cc [modify] https://crrev.com/9885115a2b4eed396736eaa9a051980b9176627d/content/shell/browser/shell_platform_data_aura.cc [modify] https://crrev.com/9885115a2b4eed396736eaa9a051980b9176627d/content/shell/browser/shell_platform_data_aura.h [modify] https://crrev.com/9885115a2b4eed396736eaa9a051980b9176627d/ui/aura/BUILD.gn [add] https://crrev.com/9885115a2b4eed396736eaa9a051980b9176627d/ui/aura/screen_ozone.cc [add] https://crrev.com/9885115a2b4eed396736eaa9a051980b9176627d/ui/aura/screen_ozone.h [modify] https://crrev.com/9885115a2b4eed396736eaa9a051980b9176627d/ui/base/layout.cc [modify] https://crrev.com/9885115a2b4eed396736eaa9a051980b9176627d/ui/ozone/BUILD.gn [modify] https://crrev.com/9885115a2b4eed396736eaa9a051980b9176627d/ui/ozone/public/ozone_platform.cc [modify] https://crrev.com/9885115a2b4eed396736eaa9a051980b9176627d/ui/ozone/public/ozone_platform.h [add] https://crrev.com/9885115a2b4eed396736eaa9a051980b9176627d/ui/ozone/public/platform_screen.h [modify] https://crrev.com/9885115a2b4eed396736eaa9a051980b9176627d/webrunner/BUILD.gn [modify] https://crrev.com/9885115a2b4eed396736eaa9a051980b9176627d/webrunner/browser/DEPS [modify] https://crrev.com/9885115a2b4eed396736eaa9a051980b9176627d/webrunner/browser/webrunner_browser_main_parts.cc [modify] https://crrev.com/9885115a2b4eed396736eaa9a051980b9176627d/webrunner/browser/webrunner_browser_main_parts.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f3120facb5b6fd93819d2e6a524af23d68280a67 commit f3120facb5b6fd93819d2e6a524af23d68280a67 Author: Sergey Ulanov <sergeyu@chromium.org> Date: Tue Aug 14 03:47:11 2018 [Fuchsia] Implement ui::PlatformScreen for Scenic The new PlatformScreen implementation allows to propagate display settings (such as device_pixel_scale) to the renderer. Bug: 850650 Change-Id: I088c1c46ba57596bd55bf57db854f8b3a2367e83 Reviewed-on: https://chromium-review.googlesource.com/1162426 Commit-Queue: Sergey Ulanov <sergeyu@chromium.org> Reviewed-by: Michael Spang <spang@chromium.org> Cr-Commit-Position: refs/heads/master@{#582823} [modify] https://crrev.com/f3120facb5b6fd93819d2e6a524af23d68280a67/ui/ozone/platform/scenic/BUILD.gn [modify] https://crrev.com/f3120facb5b6fd93819d2e6a524af23d68280a67/ui/ozone/platform/scenic/ozone_platform_scenic.cc [add] https://crrev.com/f3120facb5b6fd93819d2e6a524af23d68280a67/ui/ozone/platform/scenic/scenic_screen.cc [add] https://crrev.com/f3120facb5b6fd93819d2e6a524af23d68280a67/ui/ozone/platform/scenic/scenic_screen.h [modify] https://crrev.com/f3120facb5b6fd93819d2e6a524af23d68280a67/ui/ozone/platform/scenic/scenic_window.cc [modify] https://crrev.com/f3120facb5b6fd93819d2e6a524af23d68280a67/ui/ozone/platform/scenic/scenic_window_manager.cc [modify] https://crrev.com/f3120facb5b6fd93819d2e6a524af23d68280a67/ui/ozone/platform/scenic/scenic_window_manager.h
Comment 1 by rjkroege@chromium.org
, Jun 18 2018