Commit 9225426b authored by Mitsuru Oshima's avatar Mitsuru Oshima Committed by Commit Bot

Snap root surface to physical pixel

The root surface needs to be snapped if the shell surface uses chrome side caption.

This CL also removes "!allow_set_bounds_direct" check when
snapping the window in WindowState. This should have been removed
when we switched to relative surface hierarchy.

Bug: 836076
Test: manually tested with fractional scale factor.

Change-Id: Iadc06572279dec42f8d792424cee76481a94fd55
Reviewed-on: https://chromium-review.googlesource.com/1025371
Commit-Queue: Mitsuru Oshima <oshima@chromium.org>
Reviewed-by: default avatarDavid Reveman <reveman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553124}
parent 507e59c3
......@@ -599,8 +599,7 @@ void WindowState::SetBoundsDirect(const gfx::Rect& bounds) {
std::max(min_size.height(), actual_new_bounds.height()));
}
BoundsSetter().SetBounds(window_, actual_new_bounds);
if (!allow_set_bounds_direct())
wm::SnapWindowToPixelBoundary(window_);
wm::SnapWindowToPixelBoundary(window_);
}
void WindowState::SetBoundsConstrained(const gfx::Rect& bounds) {
......
......@@ -36,6 +36,7 @@
#include "ui/base/accelerators/accelerator.h"
#include "ui/base/class_property.h"
#include "ui/compositor/compositor.h"
#include "ui/compositor/dip_util.h"
#include "ui/compositor_extra/shadow.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
......@@ -1351,6 +1352,11 @@ void ShellSurfaceBase::UpdateSurfaceBounds() {
root_surface_origin().OffsetFromOrigin(), 1.f / GetScale()));
host_window()->SetBounds(gfx::Rect(origin, host_window()->bounds().size()));
// The host window might have not been added to the widget yet.
if (host_window()->parent()) {
ui::SnapLayerToPhysicalPixelBoundary(widget_->GetNativeWindow()->layer(),
host_window()->layer());
}
}
void ShellSurfaceBase::UpdateShadow() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment