| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
| 10 #include "cc/output/compositor_frame.h" | 10 #include "cc/output/compositor_frame.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 if (!per_compositor_data_.count(compositor)) | 170 if (!per_compositor_data_.count(compositor)) |
| 171 return; | 171 return; |
| 172 delete per_compositor_data_[compositor]; | 172 delete per_compositor_data_[compositor]; |
| 173 per_compositor_data_.erase(compositor); | 173 per_compositor_data_.erase(compositor); |
| 174 } | 174 } |
| 175 | 175 |
| 176 bool InProcessContextFactory::DoesCreateTestContexts() { | 176 bool InProcessContextFactory::DoesCreateTestContexts() { |
| 177 return context_factory_for_test_; | 177 return context_factory_for_test_; |
| 178 } | 178 } |
| 179 | 179 |
| 180 uint32 InProcessContextFactory::GetImageTextureTarget() { | 180 uint32 InProcessContextFactory::GetMapImageTextureTarget() { |
| 181 return GL_TEXTURE_2D; | 181 return GL_TEXTURE_2D; |
| 182 } | 182 } |
| 183 | 183 |
| 184 uint32 InProcessContextFactory::GetPersistentMapImageTextureTarget() { |
| 185 return GL_TEXTURE_2D; |
| 186 } |
| 187 |
| 184 cc::SharedBitmapManager* InProcessContextFactory::GetSharedBitmapManager() { | 188 cc::SharedBitmapManager* InProcessContextFactory::GetSharedBitmapManager() { |
| 185 return &shared_bitmap_manager_; | 189 return &shared_bitmap_manager_; |
| 186 } | 190 } |
| 187 | 191 |
| 188 gpu::GpuMemoryBufferManager* | 192 gpu::GpuMemoryBufferManager* |
| 189 InProcessContextFactory::GetGpuMemoryBufferManager() { | 193 InProcessContextFactory::GetGpuMemoryBufferManager() { |
| 190 return &gpu_memory_buffer_manager_; | 194 return &gpu_memory_buffer_manager_; |
| 191 } | 195 } |
| 192 | 196 |
| 193 cc::TaskGraphRunner* InProcessContextFactory::GetTaskGraphRunner() { | 197 cc::TaskGraphRunner* InProcessContextFactory::GetTaskGraphRunner() { |
| 194 return &task_graph_runner_; | 198 return &task_graph_runner_; |
| 195 } | 199 } |
| 196 | 200 |
| 197 scoped_ptr<cc::SurfaceIdAllocator> | 201 scoped_ptr<cc::SurfaceIdAllocator> |
| 198 InProcessContextFactory::CreateSurfaceIdAllocator() { | 202 InProcessContextFactory::CreateSurfaceIdAllocator() { |
| 199 return make_scoped_ptr( | 203 return make_scoped_ptr( |
| 200 new cc::SurfaceIdAllocator(next_surface_id_namespace_++)); | 204 new cc::SurfaceIdAllocator(next_surface_id_namespace_++)); |
| 201 } | 205 } |
| 202 | 206 |
| 203 void InProcessContextFactory::ResizeDisplay(ui::Compositor* compositor, | 207 void InProcessContextFactory::ResizeDisplay(ui::Compositor* compositor, |
| 204 const gfx::Size& size) { | 208 const gfx::Size& size) { |
| 205 if (!per_compositor_data_.count(compositor)) | 209 if (!per_compositor_data_.count(compositor)) |
| 206 return; | 210 return; |
| 207 per_compositor_data_[compositor]->display()->Resize(size); | 211 per_compositor_data_[compositor]->display()->Resize(size); |
| 208 } | 212 } |
| 209 | 213 |
| 210 } // namespace ui | 214 } // namespace ui |
| OLD | NEW |