| Index: ash/display/root_window_transformers.cc
|
| diff --git a/ash/display/root_window_transformers.cc b/ash/display/root_window_transformers.cc
|
| index b1d1492fd3dbad9c91cbbf76722c128c1475b1fe..fae4eec7ac2c7d5748088caa364347c1f66edc9b 100644
|
| --- a/ash/display/root_window_transformers.cc
|
| +++ b/ash/display/root_window_transformers.cc
|
| @@ -145,14 +145,10 @@ class AshRootWindowTransformer : public RootWindowTransformer {
|
| DisplayInfo info = display_manager->GetDisplayInfo(display.id());
|
| host_insets_ = info.GetOverscanInsetsInPixel();
|
| root_window_ui_scale_ = info.GetEffectiveUIScale();
|
| - // In unified mode, the scaling happen when mirroring, so don't apply
|
| - // scaling to the root window.
|
| - const float apply_ui_scale =
|
| - display_manager->IsInUnifiedMode() ? 1.0f : root_window_ui_scale_;
|
| -
|
| root_window_bounds_transform_ =
|
| - CreateInsetsAndScaleTransform(
|
| - host_insets_, display.device_scale_factor(), apply_ui_scale) *
|
| + CreateInsetsAndScaleTransform(host_insets_,
|
| + display.device_scale_factor(),
|
| + root_window_ui_scale_) *
|
| CreateRotationTransform(root, display);
|
| if (base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| switches::kAshEnableMirroredScreen)) {
|
| @@ -177,15 +173,11 @@ class AshRootWindowTransformer : public RootWindowTransformer {
|
| bounds = ui::ConvertRectToDIP(root_window_->layer(), bounds);
|
| gfx::RectF new_bounds(bounds);
|
| root_window_bounds_transform_.TransformRect(&new_bounds);
|
| - if (Shell::GetInstance()->display_manager()->IsInUnifiedMode()) {
|
| - new_bounds.Scale(root_window_ui_scale_);
|
| - } else {
|
| - // Apply |root_window_scale_| twice as the downscaling
|
| - // is already applied once in |SetTransformInternal()|.
|
| - // TODO(oshima): This is a bit ugly. Consider specifying
|
| - // the pseudo host resolution instead.
|
| - new_bounds.Scale(root_window_ui_scale_ * root_window_ui_scale_);
|
| - }
|
| + // Apply |root_window_scale_| twice as the downscaling
|
| + // is already applied once in |SetTransformInternal()|.
|
| + // TODO(oshima): This is a bit ugly. Consider specifying
|
| + // the pseudo host resolution instead.
|
| + new_bounds.Scale(root_window_ui_scale_ * root_window_ui_scale_);
|
| // Ignore the origin because RootWindow's insets are handled by
|
| // the transform.
|
| // Floor the size because the bounds is no longer aligned to
|
| @@ -287,11 +279,14 @@ class PartialBoundsRootWindowTransformer : public RootWindowTransformer {
|
| public:
|
| PartialBoundsRootWindowTransformer(const gfx::Rect& screen_bounds,
|
| const gfx::Display& display) {
|
| + gfx::Display unified_display =
|
| + Shell::GetInstance()->GetScreen()->GetPrimaryDisplay();
|
| DisplayInfo display_info =
|
| Shell::GetInstance()->display_manager()->GetDisplayInfo(display.id());
|
| root_bounds_ = gfx::Rect(display_info.bounds_in_native().size());
|
| - float scale =
|
| - root_bounds_.height() / static_cast<float>(screen_bounds.height());
|
| + float scale = root_bounds_.height() /
|
| + static_cast<float>(screen_bounds.height()) /
|
| + unified_display.device_scale_factor();
|
| transform_.Scale(scale, scale);
|
| transform_.Translate(-SkIntToMScalar(display.bounds().x()),
|
| -SkIntToMScalar(display.bounds().y()));
|
|
|