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 #ifndef CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_FACTORY_HOST_H_ | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_FACTORY_HOST_H_ |
6 #define CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_FACTORY_HOST_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_FACTORY_HOST_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 #include "ui/gfx/gpu_memory_buffer.h" | 10 #include "ui/gfx/gpu_memory_buffer.h" |
11 | 11 |
12 namespace gfx { | 12 namespace gfx { |
13 class Size; | 13 class Size; |
14 } | 14 } |
15 | 15 |
16 namespace content { | 16 namespace content { |
17 | 17 |
18 class CONTENT_EXPORT GpuMemoryBufferFactoryHost { | 18 class CONTENT_EXPORT GpuMemoryBufferFactoryHost { |
19 public: | 19 public: |
20 typedef base::Callback<void(const gfx::GpuMemoryBufferHandle& handle)> | 20 typedef base::Callback<void(const gfx::GpuMemoryBufferHandle& handle)> |
21 CreateGpuMemoryBufferCallback; | 21 CreateGpuMemoryBufferCallback; |
22 | 22 |
23 static GpuMemoryBufferFactoryHost* GetInstance(); | 23 static GpuMemoryBufferFactoryHost* GetInstance(); |
24 | 24 |
25 virtual void CreateGpuMemoryBuffer( | 25 virtual void CreateGpuMemoryBuffer( |
26 const gfx::GpuMemoryBufferHandle& handle, | 26 gfx::GpuMemoryBufferType type, |
| 27 gfx::GpuMemoryBufferId id, |
27 const gfx::Size& size, | 28 const gfx::Size& size, |
28 gfx::GpuMemoryBuffer::Format format, | 29 gfx::GpuMemoryBuffer::Format format, |
29 gfx::GpuMemoryBuffer::Usage usage, | 30 gfx::GpuMemoryBuffer::Usage usage, |
| 31 int client_id, |
30 const CreateGpuMemoryBufferCallback& callback) = 0; | 32 const CreateGpuMemoryBufferCallback& callback) = 0; |
31 virtual void DestroyGpuMemoryBuffer(const gfx::GpuMemoryBufferHandle& handle, | 33 virtual void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferType type, |
| 34 gfx::GpuMemoryBufferId id, |
| 35 int client_id, |
32 int32 sync_point) = 0; | 36 int32 sync_point) = 0; |
33 | 37 |
34 protected: | 38 protected: |
35 GpuMemoryBufferFactoryHost(); | 39 GpuMemoryBufferFactoryHost(); |
36 virtual ~GpuMemoryBufferFactoryHost(); | 40 virtual ~GpuMemoryBufferFactoryHost(); |
37 }; | 41 }; |
38 | 42 |
39 } // namespace content | 43 } // namespace content |
40 | 44 |
41 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_FACTORY_HOST_H_ | 45 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_FACTORY_HOST_H_ |
OLD | NEW |