| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |