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

Unified Diff: src/effects/SkOffsetImageFilter.cpp

Issue 189913021: Implement support for a Context parameter in image filters (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Revert all but the Context changes. Created 6 years, 9 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/SkMorphologyImageFilter.cpp ('k') | src/effects/SkPictureImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkOffsetImageFilter.cpp
diff --git a/src/effects/SkOffsetImageFilter.cpp b/src/effects/SkOffsetImageFilter.cpp
index 12c5af66495db5ec3a62706abd8ab3eed54c7fbe..98eb05bf1d3e44556d78032a58b1e99ca36f3cfb 100644
--- a/src/effects/SkOffsetImageFilter.cpp
+++ b/src/effects/SkOffsetImageFilter.cpp
@@ -15,7 +15,7 @@
#include "SkPaint.h"
bool SkOffsetImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source,
- const SkMatrix& matrix,
+ const Context& ctx,
SkBitmap* result,
SkIPoint* offset) const {
SkImageFilter* input = getInput(0);
@@ -26,18 +26,18 @@ bool SkOffsetImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source,
#else
if (!cropRectIsSet()) {
#endif
- if (input && !input->filterImage(proxy, source, matrix, &src, &srcOffset)) {
+ if (input && !input->filterImage(proxy, source, ctx, &src, &srcOffset)) {
return false;
}
SkVector vec;
- matrix.mapVectors(&vec, &fOffset, 1);
+ ctx.ctm().mapVectors(&vec, &fOffset, 1);
offset->fX = srcOffset.fX + SkScalarRoundToInt(vec.fX);
offset->fY = srcOffset.fY + SkScalarRoundToInt(vec.fY);
*result = src;
} else {
- if (input && !input->filterImage(proxy, source, matrix, &src, &srcOffset)) {
+ if (input && !input->filterImage(proxy, source, ctx, &src, &srcOffset)) {
return false;
}
@@ -45,7 +45,7 @@ bool SkOffsetImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source,
src.getBounds(&bounds);
bounds.offset(srcOffset);
- if (!applyCropRect(&bounds, matrix)) {
+ if (!applyCropRect(&bounds, ctx.ctm())) {
return false;
}
@@ -59,7 +59,7 @@ bool SkOffsetImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source,
canvas.translate(SkIntToScalar(srcOffset.fX - bounds.fLeft),
SkIntToScalar(srcOffset.fY - bounds.fTop));
SkVector vec;
- matrix.mapVectors(&vec, &fOffset, 1);
+ ctx.ctm().mapVectors(&vec, &fOffset, 1);
canvas.drawBitmap(src, vec.x(), vec.y(), &paint);
*result = device->accessBitmap(false);
offset->fX = bounds.fLeft;
« no previous file with comments | « src/effects/SkMorphologyImageFilter.cpp ('k') | src/effects/SkPictureImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698