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

Unified Diff: src/core/SkImageFilter.cpp

Issue 656853002: Use GL_R8 rather than GL_RED for glTexImage2D on IMG/ES3. Check for failure of FP creation in SkIma… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | « no previous file | src/gpu/gl/GrGpuGL.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 c431ece9477b88a6a90e03c55002a0a933804319..6456d17a6986df4a062f0ac53d32429d91481d1f 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -269,18 +269,18 @@ bool SkImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Cont
bounds.offset(-srcOffset);
SkMatrix matrix(ctx.ctm());
matrix.postTranslate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.top()));
- this->asFragmentProcessor(&fp, srcTexture, matrix, bounds);
- SkASSERT(fp);
- GrPaint paint;
- paint.addColorProcessor(fp)->unref();
- context->drawRectToRect(paint, dstRect, srcRect);
-
- SkAutoTUnref<GrTexture> resultTex(dst.detach());
- WrapTexture(resultTex, bounds.width(), bounds.height(), result);
- return true;
-#else
- return false;
+ if (this->asFragmentProcessor(&fp, srcTexture, matrix, bounds)) {
+ SkASSERT(fp);
+ GrPaint paint;
+ paint.addColorProcessor(fp)->unref();
+ context->drawRectToRect(paint, dstRect, srcRect);
+
+ SkAutoTUnref<GrTexture> resultTex(dst.detach());
+ WrapTexture(resultTex, bounds.width(), bounds.height(), result);
+ return true;
+ }
#endif
+ return false;
}
bool SkImageFilter::applyCropRect(const Context& ctx, const SkBitmap& src,
« no previous file with comments | « no previous file | src/gpu/gl/GrGpuGL.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698