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

Unified Diff: cc/surfaces/direct_compositor_frame_sink.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 | « cc/surfaces/direct_compositor_frame_sink.h ('k') | cc/surfaces/direct_compositor_frame_sink_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/direct_compositor_frame_sink.cc
diff --git a/cc/surfaces/direct_compositor_frame_sink.cc b/cc/surfaces/direct_compositor_frame_sink.cc
index f214463c5e3e8e97bc6d8763b02bb0cbc17f926a..da704c512f90dd9e4e05ba8632b3143d95abbbfe 100644
--- a/cc/surfaces/direct_compositor_frame_sink.cc
+++ b/cc/surfaces/direct_compositor_frame_sink.cc
@@ -99,15 +99,17 @@ void DirectCompositorFrameSink::SubmitCompositorFrame(CompositorFrame frame) {
frame.metadata.begin_frame_ack.sequence_number);
gfx::Size frame_size = frame.render_pass_list.back()->output_rect.size();
- if (frame_size.IsEmpty() || frame_size != last_swap_frame_size_) {
- delegated_local_surface_id_ = local_surface_id_allocator_.GenerateId();
+ if (!local_surface_id_.is_valid() || frame_size != last_swap_frame_size_ ||
+ frame.metadata.device_scale_factor != device_scale_factor_) {
+ local_surface_id_ = local_surface_id_allocator_.GenerateId();
last_swap_frame_size_ = frame_size;
+ device_scale_factor_ = frame.metadata.device_scale_factor;
+ display_->SetLocalSurfaceId(local_surface_id_, device_scale_factor_);
}
- display_->SetLocalSurfaceId(delegated_local_surface_id_,
- frame.metadata.device_scale_factor);
- support_->SubmitCompositorFrame(delegated_local_surface_id_,
- std::move(frame));
+ bool result =
+ support_->SubmitCompositorFrame(local_surface_id_, std::move(frame));
+ DCHECK(result);
}
void DirectCompositorFrameSink::DidNotProduceFrame(const BeginFrameAck& ack) {
« no previous file with comments | « cc/surfaces/direct_compositor_frame_sink.h ('k') | cc/surfaces/direct_compositor_frame_sink_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698