Cleanup patch to move all of SkImageFilterUtils into SkImageFilter.
This was a utility class that dates from before GPU code was allowed
in core. Now that it is, there's no reason not to have this
functionality in SkImageFilter.
Covered by existing tests.
R=reed@google.com
Review URL: https://codereview.chromium.org/185973003
git-svn-id: http://skia.googlecode.com/svn/trunk@13646 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/effects/SkXfermodeImageFilter.cpp b/src/effects/SkXfermodeImageFilter.cpp
index d43699d..cdc026a 100644
--- a/src/effects/SkXfermodeImageFilter.cpp
+++ b/src/effects/SkXfermodeImageFilter.cpp
@@ -16,7 +16,6 @@
#include "GrContext.h"
#include "effects/GrSimpleTextureEffect.h"
#include "SkGr.h"
-#include "SkImageFilterUtils.h"
#endif
///////////////////////////////////////////////////////////////////////////////
@@ -101,17 +100,17 @@
const SkMatrix& ctm,
SkBitmap* result,
SkIPoint* offset) const {
- SkBitmap background;
+ SkBitmap background = src;
SkIPoint backgroundOffset = SkIPoint::Make(0, 0);
- if (!SkImageFilterUtils::GetInputResultGPU(getInput(0), proxy, src, ctm, &background,
- &backgroundOffset)) {
+ if (getInput(0) && !getInput(0)->getInputResultGPU(proxy, src, ctm, &background,
+ &backgroundOffset)) {
return false;
}
GrTexture* backgroundTex = background.getTexture();
- SkBitmap foreground;
+ SkBitmap foreground = src;
SkIPoint foregroundOffset = SkIPoint::Make(0, 0);
- if (!SkImageFilterUtils::GetInputResultGPU(getInput(1), proxy, src, ctm, &foreground,
- &foregroundOffset)) {
+ if (getInput(1) && !getInput(1)->getInputResultGPU(proxy, src, ctm, &foreground,
+ &foregroundOffset)) {
return false;
}
GrTexture* foregroundTex = foreground.getTexture();
@@ -160,7 +159,8 @@
}
offset->fX = backgroundOffset.fX;
offset->fY = backgroundOffset.fY;
- return SkImageFilterUtils::WrapTexture(dst, src.width(), src.height(), result);
+ WrapTexture(dst, src.width(), src.height(), result);
+ return true;
}
#endif