aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrGpu.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/GrGpu.h')
-rw-r--r--src/gpu/GrGpu.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index aeaa595f8b..9c36d0555f 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -31,6 +31,7 @@ class GrRenderTarget;
class GrStencilAttachment;
class GrSurface;
class GrTexture;
+class GrTransferBuffer;
class GrVertexBuffer;
class GrVertices;
@@ -128,6 +129,22 @@ public:
*/
GrIndexBuffer* createIndexBuffer(size_t size, bool dynamic);
+ enum TransferType {
+ kCpuToGpu_TransferType,
+ kGpuToCpu_TransferType
+ };
+
+ /**
+ * Creates a transfer buffer.
+ *
+ * @param size size in bytes of the index buffer
+ * @param toGpu true if used to transfer from the cpu to the gpu
+ * otherwise to be used to transfer from the gpu to the cpu
+ *
+ * @return The transfer buffer if successful, otherwise nullptr.
+ */
+ GrTransferBuffer* createTransferBuffer(size_t size, TransferType type);
+
/**
* Resolves MSAA.
*/
@@ -455,6 +472,7 @@ private:
GrWrapOwnership) = 0;
virtual GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) = 0;
virtual GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) = 0;
+ virtual GrTransferBuffer* onCreateTransferBuffer(size_t size, TransferType type) = 0;
// overridden by backend-specific derived class to perform the clear.
virtual void onClear(GrRenderTarget*, const SkIRect& rect, GrColor color) = 0;