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

Unified Diff: cc/surfaces/compositor_frame_sink_support.cc

Issue 2848223003: Enforce constant size and device scale factor for surfaces (Closed)
Patch Set: c 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
Index: cc/surfaces/compositor_frame_sink_support.cc
diff --git a/cc/surfaces/compositor_frame_sink_support.cc b/cc/surfaces/compositor_frame_sink_support.cc
index 7770caff19f530ef98354043488c2c0f594bbfc1..2351087d538fdb4bafa84406f82aa676433b254a 100644
--- a/cc/surfaces/compositor_frame_sink_support.cc
+++ b/cc/surfaces/compositor_frame_sink_support.cc
@@ -125,6 +125,11 @@ void CompositorFrameSinkSupport::SubmitCompositorFrame(
}
}
+ SurfaceId surface_id(frame_sink_id_, local_surface_id);
+ gfx::Size frame_size = frame.render_pass_list.back()->output_rect.size();
+ float device_scale_factor = frame.metadata.device_scale_factor;
+ SurfaceInfo surface_info(surface_id, device_scale_factor, frame_size);
+
std::unique_ptr<Surface> surface;
bool create_new_surface =
(!current_surface_ ||
@@ -132,7 +137,7 @@ void CompositorFrameSinkSupport::SubmitCompositorFrame(
if (!create_new_surface) {
surface = std::move(current_surface_);
} else {
- surface = CreateSurface(local_surface_id);
+ surface = CreateSurface(surface_info);
}
surface->QueueFrame(
@@ -337,10 +342,10 @@ void CompositorFrameSinkSupport::UpdateNeedsBeginFramesInternal() {
}
std::unique_ptr<Surface> CompositorFrameSinkSupport::CreateSurface(
- const LocalSurfaceId& local_surface_id) {
+ const SurfaceInfo& surface_info) {
seen_first_frame_activation_ = false;
- std::unique_ptr<Surface> surface = surface_manager_->CreateSurface(
- weak_factory_.GetWeakPtr(), local_surface_id);
+ std::unique_ptr<Surface> surface =
+ surface_manager_->CreateSurface(weak_factory_.GetWeakPtr(), surface_info);
return surface;
}

Powered by Google App Engine
This is Rietveld 408576698