Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Unified Diff: src/core/SkImageFilter.cpp

Issue 638403003: Remove uses of GrAutoScratchTexture. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: comment change Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/core/SkImageFilter.cpp
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp
index 6f7762ac466d68e010caedd3c7b97a350e3b71eb..79215491681dc282d0af83d156a2e300f5234a97 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -255,13 +255,14 @@ bool SkImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Cont
desc.fHeight = bounds.height();
desc.fConfig = kRGBA_8888_GrPixelConfig;
- GrAutoScratchTexture dst(context, desc);
- if (NULL == dst.texture()) {
+ SkAutoTUnref<GrTexture> dst(
+ context->refScratchTexture(desc, GrContext::kApprox_ScratchTexMatch));
+ if (!dst) {
return false;
}
GrContext::AutoMatrix am;
am.setIdentity(context);
- GrContext::AutoRenderTarget art(context, dst.texture()->asRenderTarget());
+ GrContext::AutoRenderTarget art(context, dst->asRenderTarget());
GrContext::AutoClip acs(context, dstRect);
GrFragmentProcessor* fp;
offset->fX = bounds.left();
@@ -275,8 +276,7 @@ bool SkImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Cont
paint.addColorProcessor(fp)->unref();
context->drawRectToRect(paint, dstRect, srcRect);
- SkAutoTUnref<GrTexture> resultTex(dst.detach());
- WrapTexture(resultTex, bounds.width(), bounds.height(), result);
+ WrapTexture(dst, bounds.width(), bounds.height(), result);
return true;
#else
return false;

Powered by Google App Engine
This is Rietveld 408576698