diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-04-15 15:37:51 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-04-15 15:37:51 +0000 |
commit | beb8b3a4da83ce30e313e72ae0e444870acecb7e (patch) | |
tree | c0e22a4509ffdb4e49bc998c69e11b539581b84d /src/gpu/gl | |
parent | d20a2d4c57a968b210ceb17e6dcbc26e1cd2a741 (diff) |
Add GL_CHROMIUM_map_sub functions to GrGLInterface and bit to GrGLCaps.
BUG=skia:2402
R=robertphillips@google.com
Author: bsalomon@google.com
Review URL: https://codereview.chromium.org/231773003
git-svn-id: http://skia.googlecode.com/svn/trunk@14199 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/gl')
-rw-r--r-- | src/gpu/gl/GrGLCaps.cpp | 6 | ||||
-rw-r--r-- | src/gpu/gl/GrGLCaps.h | 4 | ||||
-rw-r--r-- | src/gpu/gl/GrGLInterface.cpp | 9 |
3 files changed, 18 insertions, 1 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index ae9bb742e3..e20f932f0e 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -48,13 +48,14 @@ void GrGLCaps::reset() { fFixedFunctionSupport = false; fFullClearIsFree = false; fDropsTileOnZeroDivide = false; + fMapSubSupport = false; } GrGLCaps::GrGLCaps(const GrGLCaps& caps) : GrDrawTargetCaps() { *this = caps; } -GrGLCaps& GrGLCaps::operator = (const GrGLCaps& caps) { +GrGLCaps& GrGLCaps::operator= (const GrGLCaps& caps) { INHERITED::operator=(caps); fVerifiedColorConfigs = caps.fVerifiedColorConfigs; fStencilFormats = caps.fStencilFormats; @@ -86,6 +87,7 @@ GrGLCaps& GrGLCaps::operator = (const GrGLCaps& caps) { fFixedFunctionSupport = caps.fFixedFunctionSupport; fFullClearIsFree = caps.fFullClearIsFree; fDropsTileOnZeroDivide = caps.fDropsTileOnZeroDivide; + fMapSubSupport = caps.fMapSubSupport; return *this; } @@ -293,8 +295,10 @@ void GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) { if (kGL_GrGLStandard == standard) { 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) { diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h index 4cde2bd5f7..1ba21ec72f 100644 --- a/src/gpu/gl/GrGLCaps.h +++ b/src/gpu/gl/GrGLCaps.h @@ -259,6 +259,9 @@ public: bool dropsTileOnZeroDivide() const { return fDropsTileOnZeroDivide; } + /// Is GL_CHROMIUM_map_sub supported? + bool mapSubSupport() const { return fMapSubSupport; } + private: /** * Maintains a bit per GrPixelConfig. It is used to avoid redundantly @@ -341,6 +344,7 @@ private: bool fFixedFunctionSupport : 1; bool fFullClearIsFree : 1; bool fDropsTileOnZeroDivide : 1; + bool fMapSubSupport : 1; typedef GrDrawTargetCaps INHERITED; }; diff --git a/src/gpu/gl/GrGLInterface.cpp b/src/gpu/gl/GrGLInterface.cpp index c5ab39ac7b..bfffdfb192 100644 --- a/src/gpu/gl/GrGLInterface.cpp +++ b/src/gpu/gl/GrGLInterface.cpp @@ -504,6 +504,15 @@ bool GrGLInterface::validate() const { RETURN_FALSE_INTERFACE; } } + + if (kGLES_GrGLStandard == fStandard && fExtensions.has("GL_CHROMIUM_map_sub")) { + if (NULL == fFunctions.fMapBufferSubData || + NULL == fFunctions.fMapTexSubImage2D || + NULL == fFunctions.fUnmapBufferSubData || + NULL == fFunctions.fUnmapTexSubImage2D) { + RETURN_FALSE_INTERFACE; + } + } #endif return true; |