Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / gpu / command_buffer / client / gpu_memory_buffer_manager.h
blobea1759ea0e576a5b182bdd22cc3dc9a583dd63c9
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.
5 #ifndef GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_MANAGER_H_
6 #define GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_MANAGER_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "gpu/gpu_export.h"
10 #include "ui/gfx/geometry/size.h"
11 #include "ui/gfx/gpu_memory_buffer.h"
13 namespace gpu {
15 class GPU_EXPORT GpuMemoryBufferManager {
16 public:
17 GpuMemoryBufferManager();
19 // Allocates a GpuMemoryBuffer that can be shared with another process.
20 virtual scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer(
21 const gfx::Size& size,
22 gfx::GpuMemoryBuffer::Format format,
23 gfx::GpuMemoryBuffer::Usage usage) = 0;
25 // Returns a GpuMemoryBuffer instance given a ClientBuffer. Returns NULL on
26 // failure.
27 virtual gfx::GpuMemoryBuffer* GpuMemoryBufferFromClientBuffer(
28 ClientBuffer buffer) = 0;
30 // Associates destruction sync point with |buffer|.
31 virtual void SetDestructionSyncPoint(gfx::GpuMemoryBuffer* buffer,
32 uint32 sync_point) = 0;
34 protected:
35 virtual ~GpuMemoryBufferManager();
38 } // namespace gpu
40 #endif // GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_MANAGER_H_