| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #ifndef CONTENT_BROWSER_GPU_GPU_MEMORY_BUFFER_FACTORY_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_GPU_GPU_MEMORY_BUFFER_FACTORY_HOST_IMPL_H_ |
| 6 #define CONTENT_BROWSER_GPU_GPU_MEMORY_BUFFER_FACTORY_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_GPU_GPU_MEMORY_BUFFER_FACTORY_HOST_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "content/common/gpu/client/gpu_memory_buffer_factory_host.h" | 10 #include "content/common/gpu/client/gpu_memory_buffer_factory_host.h" |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 class GpuMemoryBufferImpl; | |
| 14 | 13 |
| 15 class CONTENT_EXPORT GpuMemoryBufferFactoryHostImpl | 14 class CONTENT_EXPORT GpuMemoryBufferFactoryHostImpl |
| 16 : public GpuMemoryBufferFactoryHost { | 15 : public GpuMemoryBufferFactoryHost { |
| 17 public: | 16 public: |
| 18 GpuMemoryBufferFactoryHostImpl(); | 17 GpuMemoryBufferFactoryHostImpl(); |
| 19 virtual ~GpuMemoryBufferFactoryHostImpl(); | 18 virtual ~GpuMemoryBufferFactoryHostImpl(); |
| 20 | 19 |
| 21 // Overridden from GpuMemoryBufferFactoryHost: | 20 // Overridden from GpuMemoryBufferFactoryHost: |
| 22 virtual void CreateGpuMemoryBuffer( | 21 virtual void CreateGpuMemoryBuffer( |
| 23 const gfx::GpuMemoryBufferHandle& handle, | 22 const gfx::GpuMemoryBufferHandle& handle, |
| 24 const gfx::Size& size, | 23 const gfx::Size& size, |
| 25 unsigned internalformat, | 24 gfx::GpuMemoryBuffer::Format format, |
| 26 unsigned usage, | 25 gfx::GpuMemoryBuffer::Usage usage, |
| 27 const CreateGpuMemoryBufferCallback& callback) override; | 26 const CreateGpuMemoryBufferCallback& callback) override; |
| 28 virtual void DestroyGpuMemoryBuffer(const gfx::GpuMemoryBufferHandle& handle, | 27 virtual void DestroyGpuMemoryBuffer(const gfx::GpuMemoryBufferHandle& handle, |
| 29 int32 sync_point) override; | 28 int32 sync_point) override; |
| 30 | 29 |
| 31 void set_gpu_host_id(int gpu_host_id) { gpu_host_id_ = gpu_host_id; } | 30 void set_gpu_host_id(int gpu_host_id) { gpu_host_id_ = gpu_host_id; } |
| 32 | 31 |
| 33 private: | 32 private: |
| 34 void OnGpuMemoryBufferCreated(uint32 request_id, | 33 void OnGpuMemoryBufferCreated(uint32 request_id, |
| 35 const gfx::GpuMemoryBufferHandle& handle); | 34 const gfx::GpuMemoryBufferHandle& handle); |
| 36 | 35 |
| 37 int gpu_host_id_; | 36 int gpu_host_id_; |
| 38 uint32 next_create_gpu_memory_buffer_request_id_; | 37 uint32 next_create_gpu_memory_buffer_request_id_; |
| 39 typedef std::map<uint32, CreateGpuMemoryBufferCallback> | 38 typedef std::map<uint32, CreateGpuMemoryBufferCallback> |
| 40 CreateGpuMemoryBufferCallbackMap; | 39 CreateGpuMemoryBufferCallbackMap; |
| 41 CreateGpuMemoryBufferCallbackMap create_gpu_memory_buffer_requests_; | 40 CreateGpuMemoryBufferCallbackMap create_gpu_memory_buffer_requests_; |
| 42 | 41 |
| 43 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactoryHostImpl); | 42 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactoryHostImpl); |
| 44 }; | 43 }; |
| 45 | 44 |
| 46 } // namespace content | 45 } // namespace content |
| 47 | 46 |
| 48 #endif // CONTENT_BROWSER_GPU_GPU_MEMORY_BUFFER_FACTORY_HOST_IMPL_H_ | 47 #endif // CONTENT_BROWSER_GPU_GPU_MEMORY_BUFFER_FACTORY_HOST_IMPL_H_ |
| OLD | NEW |