OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_FACTORY_H_ | 5 #ifndef GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_FACTORY_H_ |
6 #define GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_FACTORY_H_ | 6 #define GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_FACTORY_H_ |
7 | 7 |
8 #include "gles2_impl_export.h" | 8 #include "gles2_impl_export.h" |
9 #include "gpu/command_buffer/client/gpu_memory_buffer.h" | 9 #include "gpu/command_buffer/client/gpu_memory_buffer.h" |
10 | 10 |
11 namespace gpu { | 11 namespace gpu { |
| 12 namespace gles2 { |
| 13 class ImageManagerProxy; |
12 | 14 |
13 // Getter and setter for a GpuMemoryBuffer factory for the current process. | 15 // Getter and setter for a GpuMemoryBuffer factory for the current process. |
14 // Currently it is only used for Android Webview where both browser and | 16 // Currently it is only used for Android Webview where both browser and |
15 // renderer are within the same process. | 17 // renderer are within the same process. |
16 | 18 |
17 // It is not valid to call this method before the setter is called. | 19 // It is not valid to call this method before the setter is called. |
18 GLES2_IMPL_EXPORT const GpuMemoryBuffer::Creator& | 20 GLES2_IMPL_EXPORT const GpuMemoryBuffer::Creator& |
19 GetProcessDefaultGpuMemoryBufferFactory(); | 21 GetProcessDefaultGpuMemoryBufferFactory(); |
20 | 22 |
21 // It is illegal to call the setter more than once. | 23 // It is illegal to call the setter more than once. |
22 GLES2_IMPL_EXPORT void SetProcessDefaultGpuMemoryBufferFactory( | 24 GLES2_IMPL_EXPORT void SetProcessDefaultGpuMemoryBufferFactory( |
23 const GpuMemoryBuffer::Creator& factory); | 25 const GpuMemoryBuffer::Creator& factory); |
24 | 26 |
| 27 class GpuMemoryBufferFactory { |
| 28 public: |
| 29 explicit GpuMemoryBufferFactory(ImageManagerProxy* image_manager); |
| 30 ~GpuMemoryBufferFactory(); |
| 31 scoped_ptr<GpuMemoryBuffer> CreateGpuMemoryBuffer( |
| 32 int width, int height, int image_id); |
| 33 private: |
| 34 ImageManagerProxy* image_manager_proxy_; |
| 35 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactory); |
| 36 }; |
| 37 |
| 38 } // namespace gles2 |
25 } // namespace gpu | 39 } // namespace gpu |
26 | 40 |
27 #endif // GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_FACTORY_H_ | 41 #endif // GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_FACTORY_H_ |
OLD | NEW |