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_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_ | 5 #ifndef CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_ |
6 #define CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_ | 6 #define CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_ |
7 | 7 |
8 #include <IOSurface/IOSurfaceAPI.h> | 8 #include <IOSurface/IOSurfaceAPI.h> |
9 | 9 |
10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 class GpuMemoryBufferFactoryIOSurface { | 22 class GpuMemoryBufferFactoryIOSurface { |
23 public: | 23 public: |
24 GpuMemoryBufferFactoryIOSurface(); | 24 GpuMemoryBufferFactoryIOSurface(); |
25 ~GpuMemoryBufferFactoryIOSurface(); | 25 ~GpuMemoryBufferFactoryIOSurface(); |
26 | 26 |
27 // Creates a IOSurface backed GPU memory buffer with |size| and | 27 // Creates a IOSurface backed GPU memory buffer with |size| and |
28 // |internalformat|. A valid handle is returned on success. | 28 // |internalformat|. A valid handle is returned on success. |
29 gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer( | 29 gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer( |
30 const gfx::GpuMemoryBufferId& id, | 30 const gfx::GpuMemoryBufferId& id, |
31 const gfx::Size& size, | 31 const gfx::Size& size, |
32 unsigned internalformat); | 32 gfx::GpuMemoryBuffer::Format format); |
33 | 33 |
34 // Destroy a previously created GPU memory buffer. | 34 // Destroy a previously created GPU memory buffer. |
35 void DestroyGpuMemoryBuffer(const gfx::GpuMemoryBufferId& id); | 35 void DestroyGpuMemoryBuffer(const gfx::GpuMemoryBufferId& id); |
36 | 36 |
37 // Creates a GLImage instance for a GPU memory buffer. | 37 // Creates a GLImage instance for a GPU memory buffer. |
38 scoped_refptr<gfx::GLImage> CreateImageForGpuMemoryBuffer( | 38 scoped_refptr<gfx::GLImage> CreateImageForGpuMemoryBuffer( |
39 const gfx::GpuMemoryBufferId& id, | 39 const gfx::GpuMemoryBufferId& id, |
40 const gfx::Size& size, | 40 const gfx::Size& size, |
41 unsigned internalformat); | 41 gfx::GpuMemoryBuffer::Format format); |
42 | 42 |
43 private: | 43 private: |
44 typedef std::pair<int, int> IOSurfaceMapKey; | 44 typedef std::pair<int, int> IOSurfaceMapKey; |
45 typedef base::hash_map<IOSurfaceMapKey, base::ScopedCFTypeRef<IOSurfaceRef>> | 45 typedef base::hash_map<IOSurfaceMapKey, base::ScopedCFTypeRef<IOSurfaceRef>> |
46 IOSurfaceMap; | 46 IOSurfaceMap; |
47 IOSurfaceMap io_surfaces_; | 47 IOSurfaceMap io_surfaces_; |
48 }; | 48 }; |
49 | 49 |
50 } // namespace content | 50 } // namespace content |
51 | 51 |
52 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_ | 52 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_ |
OLD | NEW |