diff options
author | 2017-06-28 21:29:10 +0000 | |
---|---|---|
committer | 2017-06-28 21:29:18 +0000 | |
commit | e911c63b6af02b3f2c669cf37a2000d48fc29f99 (patch) | |
tree | 4bdc457cd3a0ec360ace068032316720e59ff582 | |
parent | 0e29c633feb3215174f8fc2e048a573dc3d6de9e (diff) |
Revert "Revert "use blitMask for left/right edges in blur-nine""
This reverts commit 0e29c633feb3215174f8fc2e048a573dc3d6de9e.
Reason for revert: The layout tests have been suppressed in https://chromium-review.googlesource.com/c/553239/ - no need to revert
Bug: 737714
Original change's description:
> Revert "use blitMask for left/right edges in blur-nine"
>
> This reverts commit 3fe44544c93759e7791ee0df3e5d172cb0f268b6.
>
> Reason for revert: I believe this is the cause of the layout test regressions in crbug.com/737714
>
> Bug: 737714
>
> Original change's description:
> > use blitMask for left/right edges in blur-nine
> >
> > Seems about same speed for legacy blitter, but much faster for raster-pipeline
> >
> > Bug: skia:
> > Change-Id: I19be307c01a199e2477e045fb8c2cca7784564a5
> > Reviewed-on: https://skia-review.googlesource.com/20967
> > Commit-Queue: Mike Reed <reed@google.com>
> > Reviewed-by: Mike Klein <mtklein@chromium.org>
>
> TBR=mtklein@chromium.org,mtklein@google.com,fmalita@chromium.org,reed@google.com
>
> Change-Id: Id7be3ff779191175d91ebd51c7d275fd1104ae0d
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/21182
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
TBR=mtklein@chromium.org,mtklein@google.com,robertphillips@google.com,fmalita@chromium.org,reed@google.com
Change-Id: I9f232e838bcad4e4cf0d8c7226d5e57a349e52be
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 737714, skia:
Reviewed-on: https://skia-review.googlesource.com/21183
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
-rw-r--r-- | src/core/SkMaskFilter.cpp | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/src/core/SkMaskFilter.cpp b/src/core/SkMaskFilter.cpp index 382e24e9ed..56a1704737 100644 --- a/src/core/SkMaskFilter.cpp +++ b/src/core/SkMaskFilter.cpp @@ -164,15 +164,30 @@ static void draw_nine_clipped(const SkMask& mask, const SkIRect& outerR, blitter->blitAntiH(r.left(), outerR.bottom() - y - 1, alpha, runs); } } +#ifdef SK_SUPPORT_BLITV_FOR_BLUR_NINE + const bool useBlitV = true; +#else + const bool useBlitV = false; +#endif // left r.set(outerR.left(), innerR.top(), innerR.left(), innerR.bottom()); if (r.intersect(clipR)) { int startX = r.left() - outerR.left(); int stopX = startX + r.width(); int height = r.height(); - for (int x = startX; x < stopX; ++x) { - blitter->blitV(outerR.left() + x, r.top(), height, - *mask.getAddr8(mask.fBounds.left() + x, mask.fBounds.top() + cy)); + if (useBlitV) { + for (int x = startX; x < stopX; ++x) { + blitter->blitV(outerR.left() + x, r.top(), height, + *mask.getAddr8(mask.fBounds.left() + x, mask.fBounds.top() + cy)); + } + } else { + SkMask m; + m.fImage = mask.getAddr8(mask.fBounds.left() + r.left() - outerR.left(), + mask.fBounds.top() + cy); + m.fBounds = r; + m.fRowBytes = 0; // so we repeat the scanline for our height + m.fFormat = SkMask::kA8_Format; + blitter->blitMask(m, r); } } // right @@ -181,9 +196,19 @@ static void draw_nine_clipped(const SkMask& mask, const SkIRect& outerR, int startX = outerR.right() - r.right(); int stopX = startX + r.width(); int height = r.height(); - for (int x = startX; x < stopX; ++x) { - blitter->blitV(outerR.right() - x - 1, r.top(), height, - *mask.getAddr8(mask.fBounds.right() - x - 1, mask.fBounds.top() + cy)); + if (useBlitV) { + for (int x = startX; x < stopX; ++x) { + blitter->blitV(outerR.right() - x - 1, r.top(), height, + *mask.getAddr8(mask.fBounds.right() - x - 1, mask.fBounds.top() + cy)); + } + } else { + SkMask m; + m.fImage = mask.getAddr8(mask.fBounds.right() - outerR.right() + r.left(), + mask.fBounds.top() + cy); + m.fBounds = r; + m.fRowBytes = 0; // so we repeat the scanline for our height + m.fFormat = SkMask::kA8_Format; + blitter->blitMask(m, r); } } } |