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

Side by Side Diff: ui/compositor/test/in_process_context_factory.cc

Issue 2166423002: ui::ContextFactory should not create SurfaceIdAllocators (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Dana's nit Created 4 years, 5 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 | « ui/compositor/test/in_process_context_factory.h ('k') | ui/views/mus/surface_context_factory.h » ('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 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 "ui/compositor/test/in_process_context_factory.h" 5 #include "ui/compositor/test/in_process_context_factory.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 240
241 gpu::GpuMemoryBufferManager* 241 gpu::GpuMemoryBufferManager*
242 InProcessContextFactory::GetGpuMemoryBufferManager() { 242 InProcessContextFactory::GetGpuMemoryBufferManager() {
243 return &gpu_memory_buffer_manager_; 243 return &gpu_memory_buffer_manager_;
244 } 244 }
245 245
246 cc::TaskGraphRunner* InProcessContextFactory::GetTaskGraphRunner() { 246 cc::TaskGraphRunner* InProcessContextFactory::GetTaskGraphRunner() {
247 return &task_graph_runner_; 247 return &task_graph_runner_;
248 } 248 }
249 249
250 std::unique_ptr<cc::SurfaceIdAllocator> 250 uint32_t InProcessContextFactory::AllocateSurfaceClientId() {
251 InProcessContextFactory::CreateSurfaceIdAllocator() { 251 return next_surface_client_id_++;
252 std::unique_ptr<cc::SurfaceIdAllocator> allocator(
253 new cc::SurfaceIdAllocator(next_surface_client_id_++));
254 if (surface_manager_)
255 allocator->RegisterSurfaceClientId(surface_manager_);
256 return allocator;
257 } 252 }
258 253
259 cc::SurfaceManager* InProcessContextFactory::GetSurfaceManager() { 254 cc::SurfaceManager* InProcessContextFactory::GetSurfaceManager() {
260 return surface_manager_; 255 return surface_manager_;
261 } 256 }
262 257
263 void InProcessContextFactory::ResizeDisplay(ui::Compositor* compositor, 258 void InProcessContextFactory::ResizeDisplay(ui::Compositor* compositor,
264 const gfx::Size& size) { 259 const gfx::Size& size) {
265 if (!per_compositor_data_.count(compositor)) 260 if (!per_compositor_data_.count(compositor))
266 return; 261 return;
267 per_compositor_data_[compositor]->Resize(size); 262 per_compositor_data_[compositor]->Resize(size);
268 } 263 }
269 264
270 void InProcessContextFactory::AddObserver(ContextFactoryObserver* observer) { 265 void InProcessContextFactory::AddObserver(ContextFactoryObserver* observer) {
271 observer_list_.AddObserver(observer); 266 observer_list_.AddObserver(observer);
272 } 267 }
273 268
274 void InProcessContextFactory::RemoveObserver(ContextFactoryObserver* observer) { 269 void InProcessContextFactory::RemoveObserver(ContextFactoryObserver* observer) {
275 observer_list_.RemoveObserver(observer); 270 observer_list_.RemoveObserver(observer);
276 } 271 }
277 272
278 } // namespace ui 273 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/test/in_process_context_factory.h ('k') | ui/views/mus/surface_context_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698