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

Unified Diff: ui/aura/local/compositor_frame_sink_local.cc

Issue 2848223003: Enforce constant size and device scale factor for surfaces (Closed)
Patch Set: Address 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/local/compositor_frame_sink_local.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/local/compositor_frame_sink_local.cc
diff --git a/ui/aura/local/compositor_frame_sink_local.cc b/ui/aura/local/compositor_frame_sink_local.cc
index 2aa89b2de22c2af6649b1a7751fca1dfd658c5a7..a92bca46b5a0c3b589e0e93f0590adf8e4cd40c1 100644
--- a/ui/aura/local/compositor_frame_sink_local.cc
+++ b/ui/aura/local/compositor_frame_sink_local.cc
@@ -66,20 +66,21 @@ void CompositorFrameSinkLocal::SubmitCompositorFrame(
frame.metadata.begin_frame_ack.sequence_number);
cc::LocalSurfaceId old_local_surface_id = local_surface_id_;
- if (!frame.render_pass_list.empty()) {
- const auto& frame_size = frame.render_pass_list.back()->output_rect.size();
- if (frame_size != last_submitted_frame_size_ ||
- !local_surface_id_.is_valid()) {
- last_submitted_frame_size_ = frame_size;
- local_surface_id_ = id_allocator_.GenerateId();
- }
+ const auto& frame_size = frame.render_pass_list.back()->output_rect.size();
+ if (frame_size != surface_size_ ||
+ frame.metadata.device_scale_factor != device_scale_factor_ ||
+ !local_surface_id_.is_valid()) {
+ surface_size_ = frame_size;
+ device_scale_factor_ = frame.metadata.device_scale_factor;
+ local_surface_id_ = id_allocator_.GenerateId();
}
- support_->SubmitCompositorFrame(local_surface_id_, std::move(frame));
+ bool result =
+ support_->SubmitCompositorFrame(local_surface_id_, std::move(frame));
+ DCHECK(result);
if (local_surface_id_ != old_local_surface_id) {
surface_changed_callback_.Run(
- cc::SurfaceId(frame_sink_id_, local_surface_id_),
- last_submitted_frame_size_);
+ cc::SurfaceId(frame_sink_id_, local_surface_id_), surface_size_);
}
}
« no previous file with comments | « ui/aura/local/compositor_frame_sink_local.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698