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, |