aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/effects/SkMergeImageFilter.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/effects/SkMergeImageFilter.cpp b/src/effects/SkMergeImageFilter.cpp
index 0c47c91aff..020533046d 100755
--- a/src/effects/SkMergeImageFilter.cpp
+++ b/src/effects/SkMergeImageFilter.cpp
@@ -39,7 +39,8 @@ void SkMergeImageFilter::initModes(const SkXfermode::Mode modes[]) {
}
SkMergeImageFilter::SkMergeImageFilter(SkImageFilter* first, SkImageFilter* second,
- SkXfermode::Mode mode) : INHERITED(first, second) {
+ SkXfermode::Mode mode,
+ const SkIRect* cropRect) : INHERITED(first, second, cropRect) {
if (SkXfermode::kSrcOver_Mode != mode) {
SkXfermode::Mode modes[] = { mode, mode };
this->initModes(modes);
@@ -49,7 +50,8 @@ SkMergeImageFilter::SkMergeImageFilter(SkImageFilter* first, SkImageFilter* seco
}
SkMergeImageFilter::SkMergeImageFilter(SkImageFilter* filters[], int count,
- const SkXfermode::Mode modes[]) : INHERITED(count, filters) {
+ const SkXfermode::Mode modes[],
+ const SkIRect* cropRect) : INHERITED(count, filters, cropRect) {
this->initModes(modes);
}
@@ -99,10 +101,9 @@ bool SkMergeImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src,
return false;
}
- const SkIRect srcBounds = SkIRect::MakeXYWH(loc->x(), loc->y(),
- src.width(), src.height());
SkIRect bounds;
- if (!this->filterBounds(srcBounds, ctm, &bounds)) {
+ src.getBounds(&bounds);
+ if (!this->applyCropRect(&bounds, ctm)) {
return false;
}
@@ -120,7 +121,7 @@ bool SkMergeImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src,
for (int i = 0; i < inputCount; ++i) {
SkBitmap tmp;
const SkBitmap* srcPtr;
- SkIPoint pos = *loc;
+ SkIPoint pos = SkIPoint::Make(0, 0);
SkImageFilter* filter = getInput(i);
if (filter) {
if (!filter->filterImage(proxy, src, ctm, &tmp, &pos)) {
@@ -139,7 +140,8 @@ bool SkMergeImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src,
canvas.drawSprite(*srcPtr, pos.x() - x0, pos.y() - y0, &paint);
}
- loc->set(bounds.left(), bounds.top());
+ loc->fX += bounds.left();
+ loc->fY += bounds.top();
*result = dst->accessBitmap(false);
return true;
}