Plumb in flag for reusing scratch textures
authorcommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 18 Jul 2013 22:26:39 +0000 (22:26 +0000)
committercommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 18 Jul 2013 22:26:39 +0000 (22:26 +0000)
R=bsalomon@google.com, brian@thesalomons.net

Author: robertphillips@google.com

Review URL: https://chromiumcodereview.appspot.com/19636002

git-svn-id: http://skia.googlecode.com/svn/trunk@10170 2bbb7eff-a529-9590-31e7-b0007b416f81

src/gpu/GrDrawTarget.cpp
src/gpu/GrDrawTargetCaps.h
src/gpu/gl/GrGLCaps.cpp

index 9fdb0f4..e38f2a3 100644 (file)
@@ -950,6 +950,8 @@ void GrDrawTargetCaps::reset() {
     fDualSourceBlendingSupport = false;
     fBufferLockSupport = false;
     fPathStencilingSupport = false;
+    fDstReadInShaderSupport = false;
+    fReuseScratchTextures = true;
 
     fMaxRenderTargetSize = 0;
     fMaxTextureSize = 0;
@@ -967,6 +969,8 @@ GrDrawTargetCaps& GrDrawTargetCaps::operator=(const GrDrawTargetCaps& other) {
     fDualSourceBlendingSupport = other.fDualSourceBlendingSupport;
     fBufferLockSupport = other.fBufferLockSupport;
     fPathStencilingSupport = other.fPathStencilingSupport;
+    fDstReadInShaderSupport = other.fDstReadInShaderSupport;
+    fReuseScratchTextures = other.fReuseScratchTextures;
 
     fMaxRenderTargetSize = other.fMaxRenderTargetSize;
     fMaxTextureSize = other.fMaxTextureSize;
@@ -988,6 +992,7 @@ void GrDrawTargetCaps::print() const {
     GrPrintf("Buffer Lock Support         : %s\n", gNY[fBufferLockSupport]);
     GrPrintf("Path Stenciling Support     : %s\n", gNY[fPathStencilingSupport]);
     GrPrintf("Dst Read In Shader Support  : %s\n", gNY[fDstReadInShaderSupport]);
+    GrPrintf("Reuse Scratch Textures      : %s\n", gNY[fReuseScratchTextures]);
     GrPrintf("Max Texture Size            : %d\n", fMaxTextureSize);
     GrPrintf("Max Render Target Size      : %d\n", fMaxRenderTargetSize);
     GrPrintf("Max Sample Count            : %d\n", fMaxSampleCount);
index 236f939..ffacc9e 100644 (file)
@@ -36,6 +36,7 @@ public:
     bool bufferLockSupport() const { return fBufferLockSupport; }
     bool pathStencilingSupport() const { return fPathStencilingSupport; }
     bool dstReadInShaderSupport() const { return fDstReadInShaderSupport; }
+    bool reuseScratchTextures() const { return fReuseScratchTextures; }
 
     int maxRenderTargetSize() const { return fMaxRenderTargetSize; }
     int maxTextureSize() const { return fMaxTextureSize; }
@@ -54,6 +55,7 @@ protected:
     bool fBufferLockSupport         : 1;
     bool fPathStencilingSupport     : 1;
     bool fDstReadInShaderSupport    : 1;
+    bool fReuseScratchTextures      : 1;
 
     int fMaxRenderTargetSize;
     int fMaxTextureSize;
index 1770d05..d7b9992 100644 (file)
@@ -289,6 +289,8 @@ void GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) {
 
     fDstReadInShaderSupport = kNone_FBFetchType != fFBFetchType;
 
+    fReuseScratchTextures = kARM_GrGLVendor != ctxInfo.vendor();
+
     // Enable supported shader-related caps
     if (kDesktop_GrGLBinding == binding) {
         fDualSourceBlendingSupport = ctxInfo.version() >= GR_GL_VER(3,3) ||