OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_H_ |
| 6 #define CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_H_ |
| 7 |
| 8 #include "base/memory/ref_counted.h" |
| 9 #include "ui/gfx/geometry/size.h" |
| 10 #include "ui/gfx/gpu_memory_buffer.h" |
| 11 |
| 12 namespace gfx { |
| 13 class GLImage; |
| 14 } |
| 15 |
| 16 namespace content { |
| 17 |
| 18 class GpuMemoryBufferFactory { |
| 19 public: |
| 20 GpuMemoryBufferFactory() {} |
| 21 virtual ~GpuMemoryBufferFactory() {} |
| 22 |
| 23 // Creates a new platform specific factory instance. |
| 24 static scoped_ptr<GpuMemoryBufferFactory> Create(); |
| 25 |
| 26 // TODO: comment. |
| 27 virtual bool CreateGpuMemoryBuffer(const gfx::GpuMemoryBufferHandle& handle, |
| 28 const gfx::Size& size, |
| 29 unsigned internalformat, |
| 30 unsigned usage) = 0; |
| 31 |
| 32 // TODO: comment. |
| 33 virtual void DestroyGpuMemoryBuffer( |
| 34 const gfx::GpuMemoryBufferHandle& handle) = 0; |
| 35 |
| 36 // TODO: comment. |
| 37 virtual scoped_refptr<gfx::GLImage> CreateImageForGpuMemoryBuffer( |
| 38 const gfx::GpuMemoryBufferHandle& handle, |
| 39 const gfx::Size& size, |
| 40 unsigned internalformat, |
| 41 int client_id) = 0; |
| 42 |
| 43 private: |
| 44 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactory); |
| 45 }; |
| 46 |
| 47 } // namespace content |
| 48 |
| 49 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_H_ |
OLD | NEW |