OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_GPU_CONTROL_SERVICE_H_ |
| 6 #define GPU_COMMAND_BUFFER_SERVICE_GPU_CONTROL_SERVICE_H_ |
| 7 |
| 8 #include <map> |
| 9 |
| 10 #include "base/memory/linked_ptr.h" |
| 11 #include "gpu/command_buffer/common/gpu_control.h" |
| 12 #include "ui/gfx/gpu_memory_buffer.h" |
| 13 |
| 14 namespace gpu { |
| 15 class GpuMemoryBufferFactory; |
| 16 class GpuMemoryBufferManagerInterface; |
| 17 |
| 18 class GPU_EXPORT GpuControlService : public GpuControl { |
| 19 public: |
| 20 GpuControlService(GpuMemoryBufferManagerInterface* gpu_memory_buffer_manager, |
| 21 GpuMemoryBufferFactory* gpu_memory_buffer_factory); |
| 22 virtual ~GpuControlService(); |
| 23 |
| 24 // Overridden from GpuControl: |
| 25 virtual gfx::GpuMemoryBuffer* CreateGpuMemoryBuffer( |
| 26 size_t width, |
| 27 size_t height, |
| 28 unsigned internalformat, |
| 29 int32* id) OVERRIDE; |
| 30 virtual void DestroyGpuMemoryBuffer(int32 id) OVERRIDE; |
| 31 |
| 32 // Register an existing gpu memory buffer and get an ID that can be used |
| 33 // to identify it in the command buffer. |
| 34 bool RegisterGpuMemoryBuffer(int32 id, |
| 35 gfx::GpuMemoryBufferHandle buffer, |
| 36 size_t width, |
| 37 size_t height, |
| 38 unsigned internalformat); |
| 39 |
| 40 private: |
| 41 GpuMemoryBufferManagerInterface* gpu_memory_buffer_manager_; |
| 42 GpuMemoryBufferFactory* gpu_memory_buffer_factory_; |
| 43 typedef std::map<int32, linked_ptr<gfx::GpuMemoryBuffer> > GpuMemoryBufferMap; |
| 44 GpuMemoryBufferMap gpu_memory_buffers_; |
| 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(GpuControlService); |
| 47 }; |
| 48 |
| 49 } // namespace gpu |
| 50 |
| 51 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_CONTROL_SERVICE_H_ |
OLD | NEW |