diff options
author | robertphillips <robertphillips@google.com> | 2015-07-06 07:59:09 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-06 07:59:09 -0700 |
commit | d312dcade1e54a687b18755b5b8efbc0d01ec69e (patch) | |
tree | 0dee87e83a4d6fc8212f10391feb37754eed349f /src | |
parent | 11271fe3a40280a233c9a1c583497844d067088e (diff) |
Revert of Revert of Revert of Fix SkTileImageFilter clipping/cropRect interaction issue (patchset #1 id:1 of https://codereview.chromium.org/1207353004/)
Reason for revert:
Still want to disable due to pref regression
Original issue's description:
> Revert of Revert of Fix SkTileImageFilter clipping/cropRect interaction issue (patchset #1 id:1 of https://codereview.chromium.org/1219193002/)
>
> Reason for revert:
> Blocking the roll
>
> Original issue's description:
> > Revert of Fix SkTileImageFilter clipping/cropRect interaction issue (patchset #2 id:30001 of https://codereview.chromium.org/1210053003/)
> >
> > Reason for revert:
> > Perf regression: https://code.google.com/p/chromium/issues/detail?id=505564
> >
> > Original issue's description:
> > > Fix SkTileImageFilter clipping/cropRect interaction issue
> > >
> > > BUG=499499
> > >
> > > Committed: https://skia.googlesource.com/skia/+/157bcd0840b578060dbc3365daafffc6837da391
> >
> > TBR=reed@google.com,senorblanco@google.com,senorblanco@chromium.org,robertphillips@google.com
> > NOPRESUBMIT=true
> > NOTREECHECKS=true
> > NOTRY=true
> > BUG=499499
> >
> > Committed: https://skia.googlesource.com/skia/+/ebaf6a69bf604c85185e23aca3fb93308e747ff5
>
> TBR=reed@google.com,senorblanco@google.com,senorblanco@chromium.org,robertphillips@google.com,reed@chromium.org,bsalomon@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=499499
>
> Committed: https://skia.googlesource.com/skia/+/835510085062f055c04d8ea46d82831cfbe51793
TBR=reed@google.com,senorblanco@google.com,senorblanco@chromium.org,reed@chromium.org,bsalomon@google.com,jvanverth@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=499499
Review URL: https://codereview.chromium.org/1217303004
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkImageFilter.cpp | 31 | ||||
-rwxr-xr-x | src/effects/SkColorFilterImageFilter.cpp | 1 | ||||
-rw-r--r-- | src/effects/SkDisplacementMapEffect.cpp | 3 | ||||
-rw-r--r-- | src/effects/SkTileImageFilter.cpp | 31 |
4 files changed, 12 insertions, 54 deletions
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp index f63d1bf13b..7233ec6706 100644 --- a/src/core/SkImageFilter.cpp +++ b/src/core/SkImageFilter.cpp @@ -32,37 +32,6 @@ enum { kDefaultCacheSize = 128 * 1024 * 1024 }; #endif -#ifndef SK_IGNORE_TO_STRING -void SkImageFilter::CropRect::toString(SkString* str) const { - if (!fFlags) { - return; - } - - str->appendf("cropRect ("); - if (fFlags & CropRect::kHasLeft_CropEdge) { - str->appendf("%.2f, ", fRect.fLeft); - } else { - str->appendf("X, "); - } - if (fFlags & CropRect::kHasTop_CropEdge) { - str->appendf("%.2f, ", fRect.fTop); - } else { - str->appendf("X, "); - } - if (fFlags & CropRect::kHasRight_CropEdge) { - str->appendf("%.2f, ", fRect.fRight); - } else { - str->appendf("X, "); - } - if (fFlags & CropRect::kHasBottom_CropEdge) { - str->appendf("%.2f", fRect.fBottom); - } else { - str->appendf("X"); - } - str->appendf(") "); -} -#endif - static int32_t next_image_filter_unique_id() { static int32_t gImageFilterUniqueID; diff --git a/src/effects/SkColorFilterImageFilter.cpp b/src/effects/SkColorFilterImageFilter.cpp index d7a5ff848c..2eb720e5c4 100755 --- a/src/effects/SkColorFilterImageFilter.cpp +++ b/src/effects/SkColorFilterImageFilter.cpp @@ -101,7 +101,6 @@ bool SkColorFilterImageFilter::onIsColorFilterNode(SkColorFilter** filter) const #ifndef SK_IGNORE_TO_STRING void SkColorFilterImageFilter::toString(SkString* str) const { str->appendf("SkColorFilterImageFilter: ("); - this->getCropRect().toString(str); str->appendf("input: ("); diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp index 0eac80ff8a..d7d92c82b9 100644 --- a/src/effects/SkDisplacementMapEffect.cpp +++ b/src/effects/SkDisplacementMapEffect.cpp @@ -269,7 +269,7 @@ void SkDisplacementMapEffect::computeFastBounds(const SkRect& src, SkRect* dst) } bool SkDisplacementMapEffect::onFilterBounds(const SkIRect& src, const SkMatrix& ctm, - SkIRect* dst) const { + SkIRect* dst) const { SkIRect bounds = src; SkVector scale = SkVector::Make(fScale, fScale); ctm.mapVectors(&scale, 1); @@ -285,7 +285,6 @@ bool SkDisplacementMapEffect::onFilterBounds(const SkIRect& src, const SkMatrix& #ifndef SK_IGNORE_TO_STRING void SkDisplacementMapEffect::toString(SkString* str) const { str->appendf("SkDisplacementMapEffect: ("); - this->getCropRect().toString(str); str->appendf("scale: %f ", fScale); str->appendf("displacement: ("); if (this->getDisplacementInput()) { diff --git a/src/effects/SkTileImageFilter.cpp b/src/effects/SkTileImageFilter.cpp index 64e9a43f5a..2b7ed940d2 100644 --- a/src/effects/SkTileImageFilter.cpp +++ b/src/effects/SkTileImageFilter.cpp @@ -27,27 +27,19 @@ SkTileImageFilter* SkTileImageFilter::Create(const SkRect& srcRect, const SkRect bool SkTileImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src, const Context& ctx, SkBitmap* dst, SkIPoint* offset) const { + SkBitmap source = src; + SkImageFilter* input = getInput(0); + SkIPoint srcOffset = SkIPoint::Make(0, 0); + if (input && !input->filterImage(proxy, src, ctx, &source, &srcOffset)) { + return false; + } SkRect dstRect; ctx.ctm().mapRect(&dstRect, fDstRect); const SkIRect dstIRect = dstRect.roundOut(); - if (fSrcRect.isEmpty() || dstIRect.isEmpty()) { - return false; - } - - // TODO: the actual clip that needs to be applied to the src should be (roughly) determined by: - // intersect ctx.clip and dstIRect - // determine if that rect lies wholly inside fSrcRect - // if so pass it on as the clip - // if not pass the entire fSrcRect as the clip - // For now don't apply any clip to the source (since it is usually very small and all of it - // will be required anyway). - Context srcCtx(ctx.ctm(), SkIRect::MakeLargest(), ctx.cache()); - - SkBitmap source = src; - SkImageFilter* input = this->getInput(0); - SkIPoint srcOffset = SkIPoint::Make(0, 0); - if (input && !input->filterImage(proxy, src, srcCtx, &source, &srcOffset)) { + int w = dstIRect.width(); + int h = dstIRect.height(); + if (!fSrcRect.width() || !fSrcRect.height() || !w || !h) { return false; } @@ -67,7 +59,7 @@ bool SkTileImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src, return false; } - SkAutoTUnref<SkBaseDevice> device(proxy->createDevice(dstIRect.width(), dstIRect.height())); + SkAutoTUnref<SkBaseDevice> device(proxy->createDevice(w, h)); if (NULL == device.get()) { return false; } @@ -124,13 +116,12 @@ void SkTileImageFilter::flatten(SkWriteBuffer& buffer) const { #ifndef SK_IGNORE_TO_STRING void SkTileImageFilter::toString(SkString* str) const { str->appendf("SkTileImageFilter: ("); - this->getCropRect().toString(str); str->appendf("src: %.2f %.2f %.2f %.2f", fSrcRect.fLeft, fSrcRect.fTop, fSrcRect.fRight, fSrcRect.fBottom); str->appendf(" dst: %.2f %.2f %.2f %.2f", fDstRect.fLeft, fDstRect.fTop, fDstRect.fRight, fDstRect.fBottom); if (this->getInput(0)) { - str->appendf(" input: ("); + str->appendf("input: ("); this->getInput(0)->toString(str); str->appendf(")"); } |