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

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

Issue 2449853004: Getting rid of DelegatedFrameData (Closed)
Patch Set: nit 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/gpu_compositor_frame_sink.h" 5 #include "services/ui/ws/gpu_compositor_frame_sink.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 frame_sink_id_); 57 frame_sink_id_);
58 display_compositor_->manager()->InvalidateFrameSinkId(frame_sink_id_); 58 display_compositor_->manager()->InvalidateFrameSinkId(frame_sink_id_);
59 } 59 }
60 60
61 void GpuCompositorFrameSink::SetNeedsBeginFrame(bool needs_begin_frame) { 61 void GpuCompositorFrameSink::SetNeedsBeginFrame(bool needs_begin_frame) {
62 needs_begin_frame_ = needs_begin_frame; 62 needs_begin_frame_ = needs_begin_frame;
63 UpdateNeedsBeginFramesInternal(); 63 UpdateNeedsBeginFramesInternal();
64 } 64 }
65 65
66 void GpuCompositorFrameSink::SubmitCompositorFrame(cc::CompositorFrame frame) { 66 void GpuCompositorFrameSink::SubmitCompositorFrame(cc::CompositorFrame frame) {
67 gfx::Size frame_size = 67 gfx::Size frame_size = frame.render_pass_list[0]->output_rect.size();
68 frame.delegated_frame_data->render_pass_list[0]->output_rect.size();
69 // If the size of the CompostiorFrame has changed then destroy the existing 68 // If the size of the CompostiorFrame has changed then destroy the existing
70 // Surface and create a new one of the appropriate size. 69 // Surface and create a new one of the appropriate size.
71 if (!local_frame_id_.is_valid() || frame_size != last_submitted_frame_size_) { 70 if (!local_frame_id_.is_valid() || frame_size != last_submitted_frame_size_) {
72 if (local_frame_id_.is_valid()) 71 if (local_frame_id_.is_valid())
73 surface_factory_.Destroy(local_frame_id_); 72 surface_factory_.Destroy(local_frame_id_);
74 local_frame_id_ = surface_id_allocator_.GenerateId(); 73 local_frame_id_ = surface_id_allocator_.GenerateId();
75 surface_factory_.Create(local_frame_id_); 74 surface_factory_.Create(local_frame_id_);
76 if (display_) 75 if (display_)
77 display_->Resize(frame_size); 76 display_->Resize(frame_size);
78 } 77 }
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 212
214 added_frame_observer_ = needs_begin_frame_; 213 added_frame_observer_ = needs_begin_frame_;
215 if (needs_begin_frame_) 214 if (needs_begin_frame_)
216 begin_frame_source_->AddObserver(this); 215 begin_frame_source_->AddObserver(this);
217 else 216 else
218 begin_frame_source_->RemoveObserver(this); 217 begin_frame_source_->RemoveObserver(this);
219 } 218 }
220 219
221 } // namespace ws 220 } // namespace ws
222 } // namespace ui 221 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/frame_generator.cc ('k') | services/ui/ws/server_window_compositor_frame_sink.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698