aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLCaps.cpp
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-04-02 16:19:33 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-04-02 16:19:33 +0000
commit52ffbf6be05eb30671529ec86268967fb85c9810 (patch)
treee27018bd69431502262a153e1e608c2d89ad126d /src/gpu/gl/GrGLCaps.cpp
parent6f2d4d4679f5f0e1a1b5c2e940f1b65e34d94649 (diff)
Use glInvalidateFramebuffer() when it is supported.
BUG=skia:1541 R=egdaniel@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/218763006 git-svn-id: http://skia.googlecode.com/svn/trunk@14026 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/gl/GrGLCaps.cpp')
-rw-r--r--src/gpu/gl/GrGLCaps.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index c4b7c2fbed..0e836b1b6f 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -23,6 +23,7 @@ void GrGLCaps::reset() {
fStencilVerifiedColorConfigs.reset();
fMSFBOType = kNone_MSFBOType;
fFBFetchType = kNone_FBFetchType;
+ fInvalidateFBType = kNone_InvalidateFBType;
fMaxFragmentUniformVectors = 0;
fMaxVertexAttributes = 0;
fMaxFragmentTextureUnits = 0;
@@ -64,6 +65,7 @@ GrGLCaps& GrGLCaps::operator = (const GrGLCaps& caps) {
fMaxFixedFunctionTextureCoords = caps.fMaxFixedFunctionTextureCoords;
fMSFBOType = caps.fMSFBOType;
fFBFetchType = caps.fFBFetchType;
+ fInvalidateFBType = caps.fInvalidateFBType;
fRGBA8RenderbufferSupport = caps.fRGBA8RenderbufferSupport;
fBGRAFormatSupport = caps.fBGRAFormatSupport;
fBGRAIsInternalFormat = caps.fBGRAIsInternalFormat;
@@ -222,7 +224,15 @@ void GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) {
fUseNonVBOVertexAndIndexDynamicData = true;
}
- fDiscardRenderTargetSupport = ctxInfo.hasExtension("GL_EXT_discard_framebuffer");
+ if ((kGL_GrGLStandard == standard && version >= GR_GL_VER(4,3)) ||
+ (kGLES_GrGLStandard == standard && version >= GR_GL_VER(3,0)) ||
+ ctxInfo.hasExtension("GL_ARB_invalidate_subdata")) {
+ fDiscardRenderTargetSupport = true;
+ fInvalidateFBType = kInvalidate_InvalidateFBType;
+ } else if (ctxInfo.hasExtension("GL_EXT_discard_framebuffer")) {
+ fDiscardRenderTargetSupport = true;
+ fInvalidateFBType = kDiscard_InvalidateFBType;
+ }
if (kARM_GrGLVendor == ctxInfo.vendor() || kImagination_GrGLVendor == ctxInfo.vendor()) {
fFullClearIsFree = true;
@@ -632,11 +642,21 @@ SkString GrGLCaps::dump() const {
GR_STATIC_ASSERT(2 == kNV_FBFetchType);
GR_STATIC_ASSERT(SK_ARRAY_COUNT(kFBFetchTypeStr) == kLast_FBFetchType + 1);
+ static const char* kInvalidateFBTypeStr[] = {
+ "None",
+ "Discard",
+ "Invalidate",
+ };
+ GR_STATIC_ASSERT(0 == kNone_InvalidateFBType);
+ GR_STATIC_ASSERT(1 == kDiscard_InvalidateFBType);
+ GR_STATIC_ASSERT(2 == kInvalidate_InvalidateFBType);
+ GR_STATIC_ASSERT(SK_ARRAY_COUNT(kInvalidateFBTypeStr) == kLast_InvalidateFBType + 1);
r.appendf("Core Profile: %s\n", (fIsCoreProfile ? "YES" : "NO"));
r.appendf("Fixed Function Support: %s\n", (fFixedFunctionSupport ? "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("Max FS Uniform Vectors: %d\n", fMaxFragmentUniformVectors);
r.appendf("Max FS Texture Units: %d\n", fMaxFragmentTextureUnits);
if (fFixedFunctionSupport) {