Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(358)

Unified Diff: gpu/command_buffer/client/gpu_control.h

Issue 634083002: gpu: Compositor management of GpuMemoryBuffer instances. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cc-pre-chromium-image-refactor
Patch Set: rebase Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/client/gpu_control.h
diff --git a/gpu/command_buffer/client/gpu_control.h b/gpu/command_buffer/client/gpu_control.h
index b28757cb87ca33a3d6641f6be38648ab93edde8e..a56bd516fc570a7015ee9c1c9d45c16c12779adf 100644
--- a/gpu/command_buffer/client/gpu_control.h
+++ b/gpu/command_buffer/client/gpu_control.h
@@ -15,6 +15,8 @@
#include "gpu/command_buffer/common/mailbox.h"
#include "gpu/gpu_export.h"
+extern "C" typedef struct _ClientBuffer* ClientBuffer;
+
namespace gfx {
class GpuMemoryBuffer;
}
@@ -29,17 +31,22 @@ class GPU_EXPORT GpuControl {
virtual Capabilities GetCapabilities() = 0;
- // Create a gpu memory buffer of the given dimensions and format. Returns
- // its ID or -1 on error.
- virtual gfx::GpuMemoryBuffer* CreateGpuMemoryBuffer(
- size_t width,
- size_t height,
- unsigned internalformat,
- unsigned usage,
- int32_t* id) = 0;
-
- // Destroy a gpu memory buffer. The ID must be positive.
- virtual void DestroyGpuMemoryBuffer(int32_t id) = 0;
+ // Create an image for a client buffer with the given dimensions and
+ // format. Returns its ID or -1 on error.
+ virtual int32_t CreateImage(ClientBuffer buffer,
+ size_t width,
+ size_t height,
+ unsigned internalformat) = 0;
+
+ // Destroy an image. The ID must be positive.
+ virtual void DestroyImage(int32_t id) = 0;
+
+ // Create a gpu memory buffer backed image with the given dimensions and
+ // format for |usage|. Returns its ID or -1 on error.
+ virtual int32_t CreateGpuMemoryBufferImage(size_t width,
+ size_t height,
+ unsigned internalformat,
+ unsigned usage) = 0;
// Inserts a sync point, returning its ID. Sync point IDs are global and can
// be used for cross-context synchronization.

Powered by Google App Engine
This is Rietveld 408576698