remove premature discard optimization
authorreed <reed@google.com>
Mon, 29 Jun 2015 16:00:20 +0000 (09:00 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 29 Jun 2015 16:00:20 +0000 (09:00 -0700)
BUG=skia:

Review URL: https://codereview.chromium.org/1212613005

src/image/SkSurface_Gpu.cpp

index 34532f7cb95d4c62435f3b6c149b715c99ff2696..71bed3a9b9083a70bbc1afc9603f61df66ee0ea5 100644 (file)
@@ -33,13 +33,11 @@ GrBackendObject SkSurface_Gpu::onGetTextureHandle(TextureHandleAccess access) {
             rt->prepareForExternalRead();   // todo: rename to prepareForExternalAccess()
             break;
         case kFlushWrite_TextureHandleAccess:
+        case kDiscardWrite_TextureHandleAccess:
+            // for now we don't special-case on Discard, but we may in the future.
             this->notifyContentWillChange(kRetain_ContentChangeMode);
             rt->flushWrites();
             break;
-        case kDiscardWrite_TextureHandleAccess:
-            this->notifyContentWillChange(kDiscard_ContentChangeMode);
-            rt->discard();
-            break;
     }
     return rt->asTexture()->getTextureHandle();
 }