Make not-reusing-scratch-textures only apply to texture uploads
https://codereview.chromium.org/53133002/
git-svn-id: http://skia.googlecode.com/svn/trunk@12037 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
index bfca12f..bcc71f4 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -392,7 +392,8 @@
// hit)
bool GrClipMaskManager::getMaskTexture(int32_t clipStackGenID,
const SkIRect& clipSpaceIBounds,
- GrTexture** result) {
+ GrTexture** result,
+ bool willUpload) {
bool cached = fAACache.canReuse(clipStackGenID, clipSpaceIBounds);
if (!cached) {
@@ -402,7 +403,7 @@
fAACache.reset();
GrTextureDesc desc;
- desc.fFlags = kRenderTarget_GrTextureFlagBit;
+ desc.fFlags = willUpload ? kNone_GrTextureFlags : kRenderTarget_GrTextureFlagBit;
desc.fWidth = clipSpaceIBounds.width();
desc.fHeight = clipSpaceIBounds.height();
desc.fConfig = kRGBA_8888_GrPixelConfig;
@@ -427,7 +428,7 @@
SkASSERT(kNone_ClipMaskType == fCurrClipMaskType);
GrTexture* result;
- if (this->getMaskTexture(clipStackGenID, clipSpaceIBounds, &result)) {
+ if (this->getMaskTexture(clipStackGenID, clipSpaceIBounds, &result, false)) {
fCurrClipMaskType = kAlpha_ClipMaskType;
return result;
}
@@ -925,7 +926,7 @@
SkASSERT(kNone_ClipMaskType == fCurrClipMaskType);
GrTexture* result;
- if (this->getMaskTexture(clipStackGenID, clipSpaceIBounds, &result)) {
+ if (this->getMaskTexture(clipStackGenID, clipSpaceIBounds, &result, true)) {
return result;
}