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

Unified Diff: src/effects/SkPictureImageFilter.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/SkOffsetImageFilter.cpp ('k') | src/effects/SkRectShaderImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkPictureImageFilter.cpp
diff --git a/src/effects/SkPictureImageFilter.cpp b/src/effects/SkPictureImageFilter.cpp
index 8db9914930c85cbf53bf48810a07107990f9cce5..0b36b1d0464b3df59ac581979a91e759f96cb690 100644
--- a/src/effects/SkPictureImageFilter.cpp
+++ b/src/effects/SkPictureImageFilter.cpp
@@ -58,8 +58,8 @@ void SkPictureImageFilter::flatten(SkWriteBuffer& buffer) const {
buffer.writeRect(fCropRect);
}
-bool SkPictureImageFilter::onFilterImage(Proxy* proxy, const SkBitmap&, const SkMatrix& matrix,
- SkBitmap* result, SkIPoint* offset) const {
+bool SkPictureImageFilter::onFilterImage(Proxy* proxy, const SkBitmap&, const Context& ctx,
+ SkBitmap* result, SkIPoint* offset) const {
if (!fPicture) {
offset->fX = offset->fY = 0;
return true;
@@ -67,7 +67,7 @@ bool SkPictureImageFilter::onFilterImage(Proxy* proxy, const SkBitmap&, const Sk
SkRect floatBounds;
SkIRect bounds;
- matrix.mapRect(&floatBounds, fCropRect);
+ ctx.ctm().mapRect(&floatBounds, fCropRect);
floatBounds.roundOut(&bounds);
if (bounds.isEmpty()) {
@@ -84,7 +84,7 @@ bool SkPictureImageFilter::onFilterImage(Proxy* proxy, const SkBitmap&, const Sk
SkPaint paint;
canvas.translate(-SkIntToScalar(bounds.fLeft), -SkIntToScalar(bounds.fTop));
- canvas.concat(matrix);
+ canvas.concat(ctx.ctm());
canvas.drawPicture(*fPicture);
*result = device.get()->accessBitmap(false);
« no previous file with comments | « src/effects/SkOffsetImageFilter.cpp ('k') | src/effects/SkRectShaderImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698