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 CC_RESOURCES_GPU_MEMORY_BUFFER_MANAGER_H_ | |
6 #define CC_RESOURCES_GPU_MEMORY_BUFFER_MANAGER_H_ | |
7 | |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "cc/base/cc_export.h" | |
10 #include "ui/gfx/geometry/size.h" | |
11 #include "ui/gfx/gpu_memory_buffer.h" | |
12 | |
13 namespace cc { | |
14 | |
15 class CC_EXPORT GpuMemoryBufferManager { | |
16 public: | |
17 // Allocates a GpuMemoryBuffer that can be shared with another process. | |
18 virtual scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( | |
19 const gfx::Size& size, | |
20 gfx::GpuMemoryBuffer::Format format, | |
21 gfx::GpuMemoryBuffer::Usage usage) = 0; | |
22 | |
23 // Returns a GpuMemoryBuffer instance given a ClientBuffer. Returns NULL on | |
24 // failure. | |
25 virtual gfx::GpuMemoryBuffer* GpuMemoryBufferFromClientBuffer( | |
26 ClientBuffer buffer) = 0; | |
27 | |
28 protected: | |
29 virtual ~GpuMemoryBufferManager() {} | |
30 }; | |
31 | |
32 } // namespace cc | |
33 | |
34 #endif // CC_RESOURCES_GPU_MEMORY_BUFFER_MANAGER_H_ | |
OLD | NEW |