Add transfer buffer to GLCaps
Adds a check for PBO/transfer buffer support to GrGLCaps,
and uses that to pick the correct buffer type.
BUG=skia:4604
Review URL: https://codereview.chromium.org/1503593002
diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h
index 0ec6c85..026ae23 100644
--- a/src/gpu/gl/GrGLCaps.h
+++ b/src/gpu/gl/GrGLCaps.h
@@ -90,6 +90,14 @@
kLast_MapBufferType = kChromium_MapBufferType,
};
+ enum TransferBufferType {
+ kNone_TransferBufferType,
+ kPBO_TransferBufferType, // ARB_pixel_buffer_object
+ kChromium_TransferBufferType, // CHROMIUM_pixel_transfer_buffer_object
+
+ kLast_TransferBufferType = kChromium_TransferBufferType,
+ };
+
/**
* Initializes the GrGLCaps to the set of features supported in the current
* OpenGL context accessible via ctxInfo.
@@ -143,6 +151,9 @@
/// What type of buffer mapping is supported?
MapBufferType mapBufferType() const { return fMapBufferType; }
+ /// What type of transfer buffer is supported?
+ TransferBufferType transferBufferType() const { return fTransferBufferType; }
+
/**
* Gets an array of legal stencil formats. These formats are not guaranteed
* to be supported by the driver but are legal GLenum names given the GL
@@ -337,6 +348,7 @@
MSFBOType fMSFBOType;
InvalidateFBType fInvalidateFBType;
MapBufferType fMapBufferType;
+ TransferBufferType fTransferBufferType;
LATCAlias fLATCAlias;
bool fRGBA8RenderbufferSupport : 1;