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

Unified Diff: src/effects/SkXfermodeImageFilter.cpp

Issue 853543003: Do some minor pre cleanup work before converting all xfermodes to XPs. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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
« include/core/SkXfermode.h ('K') | « src/core/SkXfermode.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkXfermodeImageFilter.cpp
diff --git a/src/effects/SkXfermodeImageFilter.cpp b/src/effects/SkXfermodeImageFilter.cpp
index 617593eae6e559b300a6f435f6f0bb0642b4a74f..b31cd80efd9f0a832104b4ae84e7e9ab2104283c 100644
--- a/src/effects/SkXfermodeImageFilter.cpp
+++ b/src/effects/SkXfermodeImageFilter.cpp
@@ -112,6 +112,9 @@ void SkXfermodeImageFilter::toString(SkString* str) const {
#if SK_SUPPORT_GPU
bool SkXfermodeImageFilter::canFilterImageGPU() const {
+ // This is checked with the background texture as NULL here since we have no actual texture,
bsalomon 2015/01/14 15:18:13 Does this comment add much? Maybe just "Call asFra
+ // however it will be assumed that a valid texture is used if asFragmentProcessor is called
+ // outside of checking return values.
return fMode && fMode->asFragmentProcessor(NULL, NULL) && !cropRectIsSet();
}
@@ -127,6 +130,12 @@ bool SkXfermodeImageFilter::filterImageGPU(Proxy* proxy,
return onFilterImage(proxy, src, ctx, result, offset);
}
GrTexture* backgroundTex = background.getTexture();
+
+ if (NULL == backgroundTex) {
+ SkASSERT(false);
+ return false;
+ }
+
SkBitmap foreground = src;
SkIPoint foregroundOffset = SkIPoint::Make(0, 0);
if (getInput(1) && !getInput(1)->getInputResultGPU(proxy, src, ctx, &foreground,
« include/core/SkXfermode.h ('K') | « src/core/SkXfermode.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698