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

Unified Diff: src/core/SkImageFilter.cpp

Issue 638403003: Remove uses of GrAutoScratchTexture. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase 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
« no previous file with comments | « include/gpu/GrSurface.h ('k') | src/effects/SkAlphaThresholdFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkImageFilter.cpp
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp
index 6456d17a6986df4a062f0ac53d32429d91481d1f..666b71983114f9b4321fd735ffd8c7bb438220f7 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;
}
#endif
« no previous file with comments | « include/gpu/GrSurface.h ('k') | src/effects/SkAlphaThresholdFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698