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

Side by Side Diff: services/ui/public/cpp/client_compositor_frame_sink.cc

Issue 2868473002: Implement aura::Window::CreateCompositorFrameSink() (Closed)
Patch Set: Address review issues Created 3 years, 7 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/public/cpp/client_compositor_frame_sink.h" 5 #include "services/ui/public/cpp/client_compositor_frame_sink.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "cc/base/switches.h" 10 #include "cc/base/switches.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 if (!enable_surface_synchronization_ && 85 if (!enable_surface_synchronization_ &&
86 (!local_surface_id_.is_valid() || 86 (!local_surface_id_.is_valid() ||
87 frame_size != last_submitted_frame_size_)) { 87 frame_size != last_submitted_frame_size_)) {
88 local_surface_id_ = id_allocator_.GenerateId(); 88 local_surface_id_ = id_allocator_.GenerateId();
89 } 89 }
90 compositor_frame_sink_->SubmitCompositorFrame(local_surface_id_, 90 compositor_frame_sink_->SubmitCompositorFrame(local_surface_id_,
91 std::move(frame)); 91 std::move(frame));
92 last_submitted_frame_size_ = frame_size; 92 last_submitted_frame_size_ = frame_size;
93 } 93 }
94 94
95 void ClientCompositorFrameSink::EvictFrame() {
96 compositor_frame_sink_->EvictFrame();
97 }
98
95 ClientCompositorFrameSink::ClientCompositorFrameSink( 99 ClientCompositorFrameSink::ClientCompositorFrameSink(
96 const cc::FrameSinkId& frame_sink_id, 100 const cc::FrameSinkId& frame_sink_id,
97 scoped_refptr<cc::ContextProvider> context_provider, 101 scoped_refptr<cc::ContextProvider> context_provider,
98 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, 102 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
99 cc::mojom::MojoCompositorFrameSinkPtrInfo compositor_frame_sink_info, 103 cc::mojom::MojoCompositorFrameSinkPtrInfo compositor_frame_sink_info,
100 cc::mojom::MojoCompositorFrameSinkClientRequest client_request) 104 cc::mojom::MojoCompositorFrameSinkClientRequest client_request)
101 : cc::CompositorFrameSink(std::move(context_provider), 105 : cc::CompositorFrameSink(std::move(context_provider),
102 nullptr, 106 nullptr,
103 gpu_memory_buffer_manager, 107 gpu_memory_buffer_manager,
104 nullptr), 108 nullptr),
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 ClientCompositorFrameSinkBinding::TakeFrameSinkRequest() { 161 ClientCompositorFrameSinkBinding::TakeFrameSinkRequest() {
158 return std::move(compositor_frame_sink_request_); 162 return std::move(compositor_frame_sink_request_);
159 } 163 }
160 164
161 cc::mojom::MojoCompositorFrameSinkClientPtrInfo 165 cc::mojom::MojoCompositorFrameSinkClientPtrInfo
162 ClientCompositorFrameSinkBinding::TakeFrameSinkClient() { 166 ClientCompositorFrameSinkBinding::TakeFrameSinkClient() {
163 return std::move(compositor_frame_sink_client_); 167 return std::move(compositor_frame_sink_client_);
164 } 168 }
165 169
166 } // namespace ui 170 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698