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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 | 172 |
173 cc::SharedBitmapManager* InProcessContextFactory::GetSharedBitmapManager() { | 173 cc::SharedBitmapManager* InProcessContextFactory::GetSharedBitmapManager() { |
174 return &shared_bitmap_manager_; | 174 return &shared_bitmap_manager_; |
175 } | 175 } |
176 | 176 |
177 gpu::GpuMemoryBufferManager* | 177 gpu::GpuMemoryBufferManager* |
178 InProcessContextFactory::GetGpuMemoryBufferManager() { | 178 InProcessContextFactory::GetGpuMemoryBufferManager() { |
179 return &gpu_memory_buffer_manager_; | 179 return &gpu_memory_buffer_manager_; |
180 } | 180 } |
181 | 181 |
182 base::MessageLoopProxy* InProcessContextFactory::GetCompositorMessageLoop() { | |
183 if (!compositor_thread_) | |
184 return NULL; | |
185 return compositor_thread_->message_loop_proxy().get(); | |
186 } | |
187 | |
188 scoped_ptr<cc::SurfaceIdAllocator> | 182 scoped_ptr<cc::SurfaceIdAllocator> |
189 InProcessContextFactory::CreateSurfaceIdAllocator() { | 183 InProcessContextFactory::CreateSurfaceIdAllocator() { |
190 return make_scoped_ptr( | 184 return make_scoped_ptr( |
191 new cc::SurfaceIdAllocator(next_surface_id_namespace_++)); | 185 new cc::SurfaceIdAllocator(next_surface_id_namespace_++)); |
192 } | 186 } |
193 | 187 |
194 void InProcessContextFactory::ResizeDisplay(ui::Compositor* compositor, | 188 void InProcessContextFactory::ResizeDisplay(ui::Compositor* compositor, |
195 const gfx::Size& size) { | 189 const gfx::Size& size) { |
196 if (!per_compositor_data_.count(compositor)) | 190 if (!per_compositor_data_.count(compositor)) |
197 return; | 191 return; |
198 per_compositor_data_[compositor]->display()->Resize(size); | 192 per_compositor_data_[compositor]->display()->Resize(size); |
199 } | 193 } |
200 | 194 |
201 } // namespace ui | 195 } // namespace ui |
OLD | NEW |