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

Side by Side Diff: services/ui/ws/frame_generator.cc

Issue 2661543002: Rename LocalFrameId to LocalSurfaceId (Closed)
Patch Set: c Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « services/ui/ws/frame_generator.h ('k') | services/ui/ws/frame_generator_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "services/ui/ws/frame_generator.h" 5 #include "services/ui/ws/frame_generator.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/containers/adapters.h" 10 #include "base/containers/adapters.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 return; 78 return;
79 79
80 // TODO(fsamuel): We should add a trace for generating a top level frame. 80 // TODO(fsamuel): We should add a trace for generating a top level frame.
81 cc::CompositorFrame frame(GenerateCompositorFrame(root_window_->bounds())); 81 cc::CompositorFrame frame(GenerateCompositorFrame(root_window_->bounds()));
82 82
83 if (compositor_frame_sink_) { 83 if (compositor_frame_sink_) {
84 gfx::Size frame_size = last_submitted_frame_size_; 84 gfx::Size frame_size = last_submitted_frame_size_;
85 if (!frame.render_pass_list.empty()) 85 if (!frame.render_pass_list.empty())
86 frame_size = frame.render_pass_list[0]->output_rect.size(); 86 frame_size = frame.render_pass_list[0]->output_rect.size();
87 87
88 if (!local_frame_id_.is_valid() || 88 if (!local_surface_id_.is_valid() ||
89 frame_size != last_submitted_frame_size_) { 89 frame_size != last_submitted_frame_size_) {
90 local_frame_id_ = id_allocator_.GenerateId(); 90 local_surface_id_ = id_allocator_.GenerateId();
91 display_private_->ResizeDisplay(frame_size); 91 display_private_->ResizeDisplay(frame_size);
92 } 92 }
93 93
94 compositor_frame_sink_->SubmitCompositorFrame(local_frame_id_, 94 compositor_frame_sink_->SubmitCompositorFrame(local_surface_id_,
95 std::move(frame)); 95 std::move(frame));
96 compositor_frame_sink_->SetNeedsBeginFrame(false); 96 compositor_frame_sink_->SetNeedsBeginFrame(false);
97 last_submitted_frame_size_ = frame_size; 97 last_submitted_frame_size_ = frame_size;
98 } 98 }
99 } 99 }
100 100
101 void FrameGenerator::ReclaimResources( 101 void FrameGenerator::ReclaimResources(
102 const cc::ReturnedResourceArray& resources) { 102 const cc::ReturnedResourceArray& resources) {
103 // Nothing to do here because FrameGenerator CompositorFrames don't reference 103 // Nothing to do here because FrameGenerator CompositorFrames don't reference
104 // any resources. 104 // any resources.
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 0 /* sorting-context_id */); 174 0 /* sorting-context_id */);
175 auto* quad = pass->CreateAndAppendDrawQuad<cc::SurfaceDrawQuad>(); 175 auto* quad = pass->CreateAndAppendDrawQuad<cc::SurfaceDrawQuad>();
176 quad->SetAll(sqs, bounds_at_origin /* rect */, gfx::Rect() /* opaque_rect */, 176 quad->SetAll(sqs, bounds_at_origin /* rect */, gfx::Rect() /* opaque_rect */,
177 bounds_at_origin /* visible_rect */, true /* needs_blending*/, 177 bounds_at_origin /* visible_rect */, true /* needs_blending*/,
178 window_manager_surface_info_.id()); 178 window_manager_surface_info_.id());
179 } 179 }
180 180
181 } // namespace ws 181 } // namespace ws
182 182
183 } // namespace ui 183 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/frame_generator.h ('k') | services/ui/ws/frame_generator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698