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

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

Issue 2527443002: Display Compositor: Allocate LocalFrameId in client. (Closed)
Patch Set: Addressed sadrul's comment 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/ws/frame_generator.cc
diff --git a/services/ui/ws/frame_generator.cc b/services/ui/ws/frame_generator.cc
index 77b9b35bd4a93fd89a8fba68ee0113dd4f0d247b..d70279ae851b5607a17b635de7d77e101ad9206d 100644
--- a/services/ui/ws/frame_generator.cc
+++ b/services/ui/ws/frame_generator.cc
@@ -129,8 +129,16 @@ void FrameGenerator::OnBeginFrame(const cc::BeginFrameArgs& begin_frame_arags) {
// TODO(fsamuel): We should add a trace for generating a top level frame.
cc::CompositorFrame frame(GenerateCompositorFrame(root_window_->bounds()));
+
if (compositor_frame_sink_) {
- compositor_frame_sink_->SubmitCompositorFrame(std::move(frame));
+ gfx::Size frame_size;
sadrul 2016/11/22 19:53:29 = last_submitted_frame_size_;
Fady Samuel 2016/11/22 20:17:26 Done.
+ 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;
// Remove dead references after we submit a frame. This has to happen after
// the frame is submitted otherwise we could end up deleting a surface that

Powered by Google App Engine
This is Rietveld 408576698