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

Unified Diff: services/ui/ws/frame_generator.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
« no previous file with comments | « services/ui/ws/frame_generator.h ('k') | services/ui/ws/window_tree_client_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/frame_generator.cc
diff --git a/services/ui/ws/frame_generator.cc b/services/ui/ws/frame_generator.cc
index f90062be04d38fce4794a366af3d4f0b9e0cd164..0cb87c480e9f796f57eac51952d04701a2ff3e6d 100644
--- a/services/ui/ws/frame_generator.cc
+++ b/services/ui/ws/frame_generator.cc
@@ -100,8 +100,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 = 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;
// 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
« no previous file with comments | « services/ui/ws/frame_generator.h ('k') | services/ui/ws/window_tree_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698