aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/imagefiltersgraph.cpp
diff options
context:
space:
mode:
authorGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-03-14 16:35:08 +0000
committerGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-03-14 16:35:08 +0000
commit0ef0501baf615149d6d84398d7594cd89f6e928d (patch)
tree18342d565e1aee7a800b5208c1abd5a691df70ae /gm/imagefiltersgraph.cpp
parent8687608c4566ecb298fdb5159f54a47eb249cbaf (diff)
Implement support for expanding crop rects in image filters
NOTE: this patch set is based on https://codereview.chromium.org/189913021/, and needs that patch to land first. Until now, crop rects in Skia have only been able to reduce the size of the destination bounds, but not expand them. SVG semantics require the latter as well. The heart of the change is in applyCropRect(), which now assigns each edge, instead of doing an intersection with the crop rect. In order to support this (and still work well with tiled drawing) we need to clip the resulting crop rect to the clipping region of the filters. This uses the Context struct previously landed from https://codereview.chromium.org/189913021/. Many of the pixel loops are not yet ready to handle a destination rect larger than the source rect. So we provide a convenience version of applyCropRect() which creates an offscreen and pads it out with transparent black. Once the pixel loops and shaders have been fixed to support larger destination bounds, they should be switched back to the non-drawing version of applyCropRect(). BUG=skia: R=bsalomon@google.com, reed@google.com Review URL: https://codereview.chromium.org/198003008 git-svn-id: http://skia.googlecode.com/svn/trunk@13805 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm/imagefiltersgraph.cpp')
-rw-r--r--gm/imagefiltersgraph.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/gm/imagefiltersgraph.cpp b/gm/imagefiltersgraph.cpp
index bc34e656d0..8885f0d231 100644
--- a/gm/imagefiltersgraph.cpp
+++ b/gm/imagefiltersgraph.cpp
@@ -39,9 +39,7 @@ public:
}
SkIRect bounds;
- source.getBounds(&bounds);
-
- if (!this->applyCropRect(&bounds, ctx.ctm())) {
+ if (!this->applyCropRect(ctx, proxy, source, &srcOffset, &bounds, &source)) {
return false;
}