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

Unified Diff: services/ui/public/cpp/window_compositor_frame_sink.cc

Issue 2527443002: Display Compositor: Allocate LocalFrameId in client. (Closed)
Patch Set: Rebased + Restored BUILD files Created 4 years, 1 month 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: services/ui/public/cpp/window_compositor_frame_sink.cc
diff --git a/services/ui/public/cpp/window_compositor_frame_sink.cc b/services/ui/public/cpp/window_compositor_frame_sink.cc
index 3249087189577c58dd353e56662d1ff4d0551a05..d75665004f61497d7f4ecf8e2471bb068fa84def 100644
--- a/services/ui/public/cpp/window_compositor_frame_sink.cc
+++ b/services/ui/public/cpp/window_compositor_frame_sink.cc
@@ -65,7 +65,17 @@ void WindowCompositorFrameSink::SubmitCompositorFrame(
DCHECK(thread_checker_->CalledOnValidThread());
if (!compositor_frame_sink_)
return;
- compositor_frame_sink_->SubmitCompositorFrame(std::move(frame));
+
+ gfx::Size frame_size = last_submitted_frame_size_;
+ if (!frame.render_pass_list.empty())
+ frame_size = frame.render_pass_list[0]->output_rect.size();
+ if (!local_frame_id_.is_valid() || frame_size != last_submitted_frame_size_)
+ local_frame_id_ = id_allocator_.GenerateId();
+
+ compositor_frame_sink_->SubmitCompositorFrame(local_frame_id_,
+ std::move(frame));
+
+ last_submitted_frame_size_ = frame_size;
}
WindowCompositorFrameSink::WindowCompositorFrameSink(
« no previous file with comments | « services/ui/public/cpp/window_compositor_frame_sink.h ('k') | services/ui/surfaces/gpu_compositor_frame_sink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698