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

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

Issue 2683583005: Move display_ From CompositorFrameSinkSupport To GpuDisplayCompositorFrameSink (Closed)
Patch Set: addressed comments 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
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 cc::CompositorFrame frame(GenerateCompositorFrame(root_window_->bounds())); 82 cc::CompositorFrame frame(GenerateCompositorFrame(root_window_->bounds()));
83 83
84 if (compositor_frame_sink_) { 84 if (compositor_frame_sink_) {
85 gfx::Size frame_size = last_submitted_frame_size_; 85 gfx::Size frame_size = last_submitted_frame_size_;
86 if (!frame.render_pass_list.empty()) 86 if (!frame.render_pass_list.empty())
87 frame_size = frame.render_pass_list[0]->output_rect.size(); 87 frame_size = frame.render_pass_list[0]->output_rect.size();
88 88
89 if (!local_surface_id_.is_valid() || 89 if (!local_surface_id_.is_valid() ||
90 frame_size != last_submitted_frame_size_) { 90 frame_size != last_submitted_frame_size_) {
91 local_surface_id_ = id_allocator_.GenerateId(); 91 local_surface_id_ = id_allocator_.GenerateId();
92 display_private_->SetLocalSurfaceId(local_surface_id_,
danakj 2017/02/08 21:54:40 DirectCompositorFrameSink::SubmitCompositorFrame d
Alex Z. 2017/02/08 22:07:52 I wanted to only do this when local surface id cha
danakj 2017/02/08 23:31:16 Well.. we shouldn't do work we don't need to but I
Alex Z. 2017/02/10 19:44:35 Display::SetLocalSurfaceId() checks at the beginni
93 frame.metadata.device_scale_factor);
92 display_private_->ResizeDisplay(frame_size); 94 display_private_->ResizeDisplay(frame_size);
93 } 95 }
94 96
95 compositor_frame_sink_->SubmitCompositorFrame(local_surface_id_, 97 compositor_frame_sink_->SubmitCompositorFrame(local_surface_id_,
96 std::move(frame)); 98 std::move(frame));
97 compositor_frame_sink_->SetNeedsBeginFrame(false); 99 compositor_frame_sink_->SetNeedsBeginFrame(false);
98 last_submitted_frame_size_ = frame_size; 100 last_submitted_frame_size_ = frame_size;
99 } 101 }
100 } 102 }
101 103
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 0 /* sorting-context_id */); 178 0 /* sorting-context_id */);
177 auto* quad = pass->CreateAndAppendDrawQuad<cc::SurfaceDrawQuad>(); 179 auto* quad = pass->CreateAndAppendDrawQuad<cc::SurfaceDrawQuad>();
178 quad->SetAll(sqs, bounds_at_origin /* rect */, gfx::Rect() /* opaque_rect */, 180 quad->SetAll(sqs, bounds_at_origin /* rect */, gfx::Rect() /* opaque_rect */,
179 bounds_at_origin /* visible_rect */, true /* needs_blending*/, 181 bounds_at_origin /* visible_rect */, true /* needs_blending*/,
180 window_manager_surface_info_.id()); 182 window_manager_surface_info_.id());
181 } 183 }
182 184
183 } // namespace ws 185 } // namespace ws
184 186
185 } // namespace ui 187 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698