Add support for glMapBufferRange. Use glMapBufferRange and glMapBufferSubData.
BUG=skia:2402
Committed: http://code.google.com/p/skia/source/detail?r=14533
R=robertphillips@google.com, djsollen@google.com
Author: bsalomon@google.com
Review URL: https://codereview.chromium.org/243413002
git-svn-id: http://skia.googlecode.com/svn/trunk@14564 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h
index 48925d4..ea0f412 100644
--- a/src/gpu/gl/GrGLCaps.h
+++ b/src/gpu/gl/GrGLCaps.h
@@ -86,6 +86,15 @@
kLast_InvalidateFBType = kInvalidate_InvalidateFBType
};
+ enum MapBufferType {
+ kNone_MapBufferType,
+ kMapBuffer_MapBufferType, // glMapBuffer()
+ kMapBufferRange_MapBufferType, // glMapBufferRange()
+ kChromium_MapBufferType, // GL_CHROMIUM_map_sub
+
+ kLast_MapBufferType = kChromium_MapBufferType,
+ };
+
/**
* Creates a GrGLCaps that advertises no support for any extensions,
* formats, etc. Call init to initialize from a GrGLContextInfo.
@@ -169,10 +178,8 @@
InvalidateFBType invalidateFBType() const { return fInvalidateFBType; }
- /**
- * Returs a string containeng the caps info.
- */
- virtual SkString dump() const SK_OVERRIDE;
+ /// What type of buffer mapping is supported?
+ MapBufferType mapBufferType() const { return fMapBufferType; }
/**
* Gets an array of legal stencil formats. These formats are not guaranteed
@@ -258,8 +265,10 @@
bool dropsTileOnZeroDivide() const { return fDropsTileOnZeroDivide; }
- /// Is GL_CHROMIUM_map_sub supported?
- bool mapSubSupport() const { return fMapSubSupport; }
+ /**
+ * Returns a string containing the caps info.
+ */
+ virtual SkString dump() const SK_OVERRIDE;
private:
/**
@@ -322,6 +331,7 @@
MSFBOType fMSFBOType;
FBFetchType fFBFetchType;
InvalidateFBType fInvalidateFBType;
+ MapBufferType fMapBufferType;
bool fRGBA8RenderbufferSupport : 1;
bool fBGRAFormatSupport : 1;
@@ -342,7 +352,6 @@
bool fIsCoreProfile : 1;
bool fFullClearIsFree : 1;
bool fDropsTileOnZeroDivide : 1;
- bool fMapSubSupport : 1;
typedef GrDrawTargetCaps INHERITED;
};