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

Unified Diff: ui/aura/mus/window_port_mus.cc

Issue 2873473002: Aura-Mus: Fix high-DPI gutter (Closed)
Patch Set: Addressed sadrul's comments Created 3 years, 7 months 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
« no previous file with comments | « ui/aura/mus/window_port_mus.h ('k') | ui/aura/mus/window_tree_client_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/mus/window_port_mus.cc
diff --git a/ui/aura/mus/window_port_mus.cc b/ui/aura/mus/window_port_mus.cc
index 7f2a083def86d817ad5251bc1c394731769b30ff..e550ddb761d9bf617553d822362b026a327642c5 100644
--- a/ui/aura/mus/window_port_mus.cc
+++ b/ui/aura/mus/window_port_mus.cc
@@ -17,6 +17,7 @@
#include "ui/base/class_property.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
+#include "ui/gfx/geometry/dip_util.h"
namespace aura {
@@ -230,7 +231,9 @@ void WindowPortMus::SetBoundsFromServer(
ServerChangeData data;
data.bounds_in_dip = bounds;
ScopedServerChange change(this, ServerChangeType::BOUNDS, data);
- last_surface_size_ = bounds.size();
+ float device_scale_factor = ScaleFactorForDisplay(window_);
+ last_surface_size_in_pixels_ =
+ gfx::ConvertSizeToPixel(device_scale_factor, bounds.size());
if (local_surface_id)
local_surface_id_ = *local_surface_id;
else
@@ -284,12 +287,14 @@ void WindowPortMus::SetFrameSinkIdFromServer(
}
const cc::LocalSurfaceId& WindowPortMus::GetOrAllocateLocalSurfaceId(
- const gfx::Size& surface_size) {
- if (last_surface_size_ == surface_size && local_surface_id_.is_valid())
+ const gfx::Size& surface_size_in_pixels) {
+ if (last_surface_size_in_pixels_ == surface_size_in_pixels &&
+ local_surface_id_.is_valid()) {
return local_surface_id_;
+ }
local_surface_id_ = local_surface_id_allocator_.GenerateId();
- last_surface_size_ = surface_size;
+ last_surface_size_in_pixels_ = surface_size_in_pixels;
// If the FrameSinkId is available, then immediately embed the SurfaceId.
// The newly generated frame by the embedder will block in the display
@@ -533,9 +538,9 @@ void WindowPortMus::UpdatePrimarySurfaceInfo() {
if (!frame_sink_id_.is_valid() || !local_surface_id_.is_valid())
return;
- SetPrimarySurfaceInfo(
- cc::SurfaceInfo(cc::SurfaceId(frame_sink_id_, local_surface_id_),
- ScaleFactorForDisplay(window_), last_surface_size_));
+ SetPrimarySurfaceInfo(cc::SurfaceInfo(
+ cc::SurfaceId(frame_sink_id_, local_surface_id_),
+ ScaleFactorForDisplay(window_), last_surface_size_in_pixels_));
}
void WindowPortMus::UpdateClientSurfaceEmbedder() {
« no previous file with comments | « ui/aura/mus/window_port_mus.h ('k') | ui/aura/mus/window_tree_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698