Index: gm/imagefiltersgraph.cpp |
diff --git a/gm/imagefiltersgraph.cpp b/gm/imagefiltersgraph.cpp |
index 4fa59a876683dc787a34c2e13d152e77da1ee645..f080ff3857a8bb850a876416e13a604eb47f6f86 100644 |
--- a/gm/imagefiltersgraph.cpp |
+++ b/gm/imagefiltersgraph.cpp |
@@ -37,17 +37,17 @@ public: |
return SkNEW_ARGS(SimpleOffsetFilter, (dx, dy, input)); |
} |
- virtual bool onFilterImage(Proxy* proxy, const SkBitmap& src, const Context& ctx, |
- SkBitmap* dst, SkIPoint* offset) const SK_OVERRIDE { |
- SkBitmap source = src; |
+ virtual bool onFilterImage(Proxy* proxy, const SkImage* src, const Context& ctx, |
+ SkAutoTUnref<const SkImage>& dst, SkIPoint* offset) const SK_OVERRIDE { |
+ SkAutoTUnref<const SkImage> source(SkRef(src)); |
SkImageFilter* input = getInput(0); |
SkIPoint srcOffset = SkIPoint::Make(0, 0); |
- if (input && !input->filterImage(proxy, src, ctx, &source, &srcOffset)) { |
+ if (input && !input->filterImage(proxy, src, ctx, source, &srcOffset)) { |
return false; |
} |
SkIRect bounds; |
- if (!this->applyCropRect(ctx, proxy, source, &srcOffset, &bounds, &source)) { |
+ if (!this->applyCropRect(ctx, proxy, source, &srcOffset, &bounds, source)) { |
return false; |
} |
@@ -55,8 +55,12 @@ public: |
SkCanvas canvas(device); |
SkPaint paint; |
paint.setXfermodeMode(SkXfermode::kSrc_Mode); |
- canvas.drawBitmap(source, fDX - bounds.left(), fDY - bounds.top(), &paint); |
- *dst = device->accessBitmap(false); |
+ canvas.drawImage(source, fDX - bounds.left(), fDY - bounds.top(), &paint); |
+ SkImage* image = device->newImageSnapshot(); |
+ if (NULL == image) { |
+ return false; |
+ } |
+ dst.reset(image); |
offset->fX += bounds.left(); |
offset->fY += bounds.top(); |
return true; |