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_H_ | 5 #ifndef CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_H_ |
6 #define CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_H_ | 6 #define CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "ui/gfx/geometry/size.h" | 10 #include "ui/gfx/geometry/size.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 namespace content { | 21 namespace content { |
22 | 22 |
23 class GpuMemoryBufferFactory { | 23 class GpuMemoryBufferFactory { |
24 public: | 24 public: |
25 GpuMemoryBufferFactory() {} | 25 GpuMemoryBufferFactory() {} |
26 virtual ~GpuMemoryBufferFactory() {} | 26 virtual ~GpuMemoryBufferFactory() {} |
27 | 27 |
28 // Creates a new platform specific factory instance. | 28 // Creates a new platform specific factory instance. |
29 static scoped_ptr<GpuMemoryBufferFactory> Create(); | 29 static scoped_ptr<GpuMemoryBufferFactory> Create(); |
30 | 30 |
31 // Creates a GPU memory buffer instance from |handle|. Whether the storage for | 31 // Creates a GPU memory buffer instance of |type|. A valid handle is |
32 // the buffer is passed with the handle or allocated as part of buffer | 32 // returned on success. |
33 // creation depends on the type. A valid handle is returned on success. | |
34 virtual gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer( | 33 virtual gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer( |
35 const gfx::GpuMemoryBufferHandle& handle, | 34 gfx::GpuMemoryBufferType type, |
| 35 gfx::GpuMemoryBufferId id, |
36 const gfx::Size& size, | 36 const gfx::Size& size, |
37 gfx::GpuMemoryBuffer::Format format, | 37 gfx::GpuMemoryBuffer::Format format, |
38 gfx::GpuMemoryBuffer::Usage usage) = 0; | 38 gfx::GpuMemoryBuffer::Usage usage, |
| 39 int client_id) = 0; |
39 | 40 |
40 // Destroys GPU memory buffer identified by |handle|. | 41 // Destroys GPU memory buffer identified by |id|. |
41 virtual void DestroyGpuMemoryBuffer( | 42 virtual void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferType type, |
42 const gfx::GpuMemoryBufferHandle& handle) = 0; | 43 gfx::GpuMemoryBufferId id, |
| 44 int client_id) = 0; |
43 | 45 |
44 // Type-checking downcast routine. | 46 // Type-checking downcast routine. |
45 virtual gpu::ImageFactory* AsImageFactory() = 0; | 47 virtual gpu::ImageFactory* AsImageFactory() = 0; |
46 | 48 |
47 private: | 49 private: |
48 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactory); | 50 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactory); |
49 }; | 51 }; |
50 | 52 |
51 } // namespace content | 53 } // namespace content |
52 | 54 |
53 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_H_ | 55 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_H_ |
OLD | NEW |