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

Unified Diff: src/effects/SkDisplacementMapEffect.cpp

Issue 185973003: Cleanup patch to move all of SkImageFilterUtils into SkImageFilter. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Oh, the Rietveld suckage Created 6 years, 10 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 | « src/effects/SkBlurImageFilter.cpp ('k') | src/effects/SkMorphologyImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkDisplacementMapEffect.cpp
diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp
index cffadb2e660ddca7111a4c0c2dbcd3a825949688..62fba1ac48659848f6a1314ca6ca2dd018928a74 100644
--- a/src/effects/SkDisplacementMapEffect.cpp
+++ b/src/effects/SkDisplacementMapEffect.cpp
@@ -15,7 +15,6 @@
#include "GrCoordTransform.h"
#include "gl/GrGLEffect.h"
#include "GrTBackendEffectFactory.h"
-#include "SkImageFilterUtils.h"
#endif
namespace {
@@ -349,17 +348,18 @@ private:
bool SkDisplacementMapEffect::filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMatrix& ctm,
SkBitmap* result, SkIPoint* offset) const {
- SkBitmap colorBM;
+ SkBitmap colorBM = src;
SkIPoint colorOffset = SkIPoint::Make(0, 0);
- if (!SkImageFilterUtils::GetInputResultGPU(getColorInput(), proxy, src, ctm, &colorBM,
- &colorOffset)) {
+ if (getColorInput() && !getColorInput()->getInputResultGPU(proxy, src, ctm, &colorBM,
+ &colorOffset)) {
return false;
}
GrTexture* color = colorBM.getTexture();
- SkBitmap displacementBM;
+ SkBitmap displacementBM = src;
SkIPoint displacementOffset = SkIPoint::Make(0, 0);
- if (!SkImageFilterUtils::GetInputResultGPU(getDisplacementInput(), proxy, src, ctm,
- &displacementBM, &displacementOffset)) {
+ if (getDisplacementInput() &&
+ !getDisplacementInput()->getInputResultGPU(proxy, src, ctm, &displacementBM,
+ &displacementOffset)) {
return false;
}
GrTexture* displacement = displacementBM.getTexture();
@@ -415,7 +415,8 @@ bool SkDisplacementMapEffect::filterImageGPU(Proxy* proxy, const SkBitmap& src,
context->drawRect(paint, SkRect::Make(colorBounds));
offset->fX = bounds.left();
offset->fY = bounds.top();
- return SkImageFilterUtils::WrapTexture(dst, bounds.width(), bounds.height(), result);
+ WrapTexture(dst, bounds.width(), bounds.height(), result);
+ return true;
}
///////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « src/effects/SkBlurImageFilter.cpp ('k') | src/effects/SkMorphologyImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698