Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Unified Diff: ui/android/delegated_frame_host_android.cc

Issue 2428383006: Decouple VR Shell DPR and CSS size from Physical Displays. (Closed)
Patch Set: Address bshe comments + minor fix Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/android/delegated_frame_host_android.cc
diff --git a/ui/android/delegated_frame_host_android.cc b/ui/android/delegated_frame_host_android.cc
index 8ac7dad561240a8552e6d54aa3d510e89fea4008..548f4ea892b37d93c5f5d7fc2003827b3cadc9e8 100644
--- a/ui/android/delegated_frame_host_android.cc
+++ b/ui/android/delegated_frame_host_android.cc
@@ -17,7 +17,8 @@
#include "ui/android/context_provider_factory.h"
#include "ui/android/view_android.h"
#include "ui/android/window_android_compositor.h"
-#include "ui/gfx/android/device_display_info.h"
+#include "ui/display/display.h"
+#include "ui/display/screen.h"
#include "ui/gfx/geometry/dip_util.h"
namespace ui {
@@ -213,8 +214,10 @@ void DelegatedFrameHostAndroid::UpdateBackgroundColor(SkColor color) {
void DelegatedFrameHostAndroid::UpdateContainerSizeinDIP(
const gfx::Size& size_in_dip) {
container_size_in_dip_ = size_in_dip;
- background_layer_->SetBounds(gfx::ConvertSizeToPixel(
- gfx::DeviceDisplayInfo().GetDIPScale(), container_size_in_dip_));
+ float device_scale_factor = display::Screen::GetScreen()
+ ->GetDisplayNearestWindow(view_).device_scale_factor();
+ background_layer_->SetBounds(
+ gfx::ConvertSizeToPixel(device_scale_factor, container_size_in_dip_));
UpdateBackgroundLayer();
}
@@ -255,7 +258,8 @@ void DelegatedFrameHostAndroid::UpdateBackgroundLayer() {
bool background_is_drawable = false;
if (current_frame_) {
- float device_scale_factor = gfx::DeviceDisplayInfo().GetDIPScale();
+ float device_scale_factor = display::Screen::GetScreen()
+ ->GetDisplayNearestWindow(view_).device_scale_factor();
gfx::Size content_size_in_dip = gfx::ConvertSizeToDIP(
device_scale_factor, current_frame_->surface_size);
background_is_drawable =
« no previous file with comments | « third_party/WebKit/Source/modules/vr/VRDisplay.cpp ('k') | ui/android/java/src/org/chromium/ui/base/WindowAndroid.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698