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

Unified Diff: services/ui/ws/window_server.cc

Issue 2547243002: Set device scale factor in CompositorFrame and scale frame size in WS. (Closed)
Patch Set: 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
« services/ui/ws/window_server.h ('K') | « services/ui/ws/window_server.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/window_server.cc
diff --git a/services/ui/ws/window_server.cc b/services/ui/ws/window_server.cc
index 794f258a32f92758fcf0eab22311cbb54257a581..d56e07b9b4d1d18731a3080c6ad2a1a3224d2061 100644
--- a/services/ui/ws/window_server.cc
+++ b/services/ui/ws/window_server.cc
@@ -27,6 +27,7 @@
#include "services/ui/ws/window_server_delegate.h"
#include "services/ui/ws/window_tree.h"
#include "services/ui/ws/window_tree_binding.h"
+#include "ui/gfx/geometry/dip_util.h"
#include "ui/gfx/geometry/size_conversions.h"
namespace ui {
@@ -751,7 +752,7 @@ void WindowServer::OnGpuServiceInitialized() {
}
void WindowServer::OnSurfaceCreated(const cc::SurfaceId& surface_id,
- const gfx::Size& frame_size,
+ const gfx::Size& frame_size_in_dip,
float device_scale_factor) {
WindowId window_id(
WindowIdFromTransportId(surface_id.frame_sink_id().client_id()));
@@ -766,8 +767,10 @@ void WindowServer::OnSurfaceCreated(const cc::SurfaceId& surface_id,
// Cache the last submitted surface ID in the window server.
// DisplayCompositorFrameSink may submit a CompositorFrame without
// creating a CompositorFrameSinkManager.
+ gfx::Size frame_size_in_pixels =
+ gfx::ConvertSizeToPixel(device_scale_factor, frame_size_in_dip);
window->GetOrCreateCompositorFrameSinkManager()->SetLatestSurfaceInfo(
- compositor_frame_sink_type, surface_id, frame_size);
+ compositor_frame_sink_type, surface_id, frame_size_in_pixels);
// FrameGenerator will add an appropriate reference for the new surface.
DCHECK(display_manager_->GetDisplayContaining(window));
@@ -789,8 +792,8 @@ void WindowServer::OnSurfaceCreated(const cc::SurfaceId& surface_id,
}
WindowTree* window_tree = GetTreeWithId(window->parent()->id().client_id);
if (window_tree) {
- window_tree->ProcessWindowSurfaceChanged(window, surface_id, frame_size,
- device_scale_factor);
+ window_tree->ProcessWindowSurfaceChanged(
+ window, surface_id, frame_size_in_pixels, device_scale_factor);
}
}
« services/ui/ws/window_server.h ('K') | « services/ui/ws/window_server.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698