Index: src/gpu/gl/GrGLCaps.cpp |
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp |
index f577e9d740398dc5ca53fec9379b2e7266f544db..890b816752a1be093570d28169e10428778f11c9 100644 |
--- a/src/gpu/gl/GrGLCaps.cpp |
+++ b/src/gpu/gl/GrGLCaps.cpp |
@@ -24,7 +24,6 @@ |
fMSFBOType = kNone_MSFBOType; |
fFBFetchType = kNone_FBFetchType; |
fInvalidateFBType = kNone_InvalidateFBType; |
- fMapBufferType = kNone_MapBufferType; |
fMaxFragmentUniformVectors = 0; |
fMaxVertexAttributes = 0; |
fMaxFragmentTextureUnits = 0; |
@@ -48,6 +47,7 @@ |
fIsCoreProfile = false; |
fFullClearIsFree = false; |
fDropsTileOnZeroDivide = false; |
+ fMapSubSupport = false; |
} |
GrGLCaps::GrGLCaps(const GrGLCaps& caps) : GrDrawTargetCaps() { |
@@ -66,7 +66,6 @@ |
fMSFBOType = caps.fMSFBOType; |
fFBFetchType = caps.fFBFetchType; |
fInvalidateFBType = caps.fInvalidateFBType; |
- fMapBufferType = caps.fMapBufferType; |
fRGBA8RenderbufferSupport = caps.fRGBA8RenderbufferSupport; |
fBGRAFormatSupport = caps.fBGRAFormatSupport; |
fBGRAIsInternalFormat = caps.fBGRAIsInternalFormat; |
@@ -86,6 +85,7 @@ |
fIsCoreProfile = caps.fIsCoreProfile; |
fFullClearIsFree = caps.fFullClearIsFree; |
fDropsTileOnZeroDivide = caps.fDropsTileOnZeroDivide; |
+ fMapSubSupport = caps.fMapSubSupport; |
return *this; |
} |
@@ -290,27 +290,12 @@ |
} |
if (kGL_GrGLStandard == standard) { |
- fMapBufferFlags = kCanMap_MapFlag; // we require VBO support and the desktop VBO |
- // extension includes glMapBuffer. |
- if (version >= GR_GL_VER(3, 0) || ctxInfo.hasExtension("GL_ARB_map_buffer_range")) { |
- fMapBufferFlags |= kSubset_MapFlag; |
- fMapBufferType = kMapBufferRange_MapBufferType; |
- } else { |
- fMapBufferType = kMapBuffer_MapBufferType; |
- } |
- } else { |
- // Unextended GLES2 doesn't have any buffer mapping. |
- fMapBufferFlags = kNone_MapBufferType; |
- if (ctxInfo.hasExtension("GL_CHROMIUM_map_sub")) { |
- fMapBufferFlags = kCanMap_MapFlag | kSubset_MapFlag; |
- fMapBufferType = kChromium_MapBufferType; |
- } else if (version >= GR_GL_VER(3, 0) || ctxInfo.hasExtension("GL_EXT_map_buffer_range")) { |
- fMapBufferFlags = kCanMap_MapFlag | kSubset_MapFlag; |
- fMapBufferType = kMapBufferRange_MapBufferType; |
- } else if (ctxInfo.hasExtension("GL_OES_mapbuffer")) { |
- fMapBufferFlags = kCanMap_MapFlag; |
- fMapBufferType = kMapBuffer_MapBufferType; |
- } |
+ fBufferLockSupport = true; // we require VBO support and the desktop VBO extension includes |
+ // glMapBuffer. |
+ fMapSubSupport = false; |
+ } else { |
+ fBufferLockSupport = ctxInfo.hasExtension("GL_OES_mapbuffer"); |
+ fMapSubSupport = ctxInfo.hasExtension("GL_CHROMIUM_map_sub"); |
} |
if (kGL_GrGLStandard == standard) { |
@@ -670,23 +655,10 @@ |
GR_STATIC_ASSERT(2 == kInvalidate_InvalidateFBType); |
GR_STATIC_ASSERT(SK_ARRAY_COUNT(kInvalidateFBTypeStr) == kLast_InvalidateFBType + 1); |
- static const char* kMapBufferTypeStr[] = { |
- "None", |
- "MapBuffer", |
- "MapBufferRange", |
- "Chromium", |
- }; |
- GR_STATIC_ASSERT(0 == kNone_MapBufferType); |
- GR_STATIC_ASSERT(1 == kMapBuffer_MapBufferType); |
- GR_STATIC_ASSERT(2 == kMapBufferRange_MapBufferType); |
- GR_STATIC_ASSERT(3 == kChromium_MapBufferType); |
- GR_STATIC_ASSERT(SK_ARRAY_COUNT(kMapBufferTypeStr) == kLast_MapBufferType + 1); |
- |
r.appendf("Core Profile: %s\n", (fIsCoreProfile ? "YES" : "NO")); |
r.appendf("MSAA Type: %s\n", kMSFBOExtStr[fMSFBOType]); |
r.appendf("FB Fetch Type: %s\n", kFBFetchTypeStr[fFBFetchType]); |
r.appendf("Invalidate FB Type: %s\n", kInvalidateFBTypeStr[fInvalidateFBType]); |
- r.appendf("Map Buffer Type: %s\n", kMapBufferTypeStr[fMapBufferType]); |
r.appendf("Max FS Uniform Vectors: %d\n", fMaxFragmentUniformVectors); |
r.appendf("Max FS Texture Units: %d\n", fMaxFragmentTextureUnits); |
if (!fIsCoreProfile) { |