aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/ImageFilterTest.cpp
diff options
context:
space:
mode:
authorGravatar Herb Derby <herb@google.com>2017-10-17 10:37:09 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-10-17 16:06:32 +0000
commitd4a0fc7383546d106db2216515b3753937398ece (patch)
treee6820bf1486529f2644baacadb1f6fcde347cb42 /tests/ImageFilterTest.cpp
parent9eca72b57bdf2fc008006b43fd8bf37efbfa7517 (diff)
Use combined three pass code for image blur.
This changes more closely matches the GL output, and the runtimes are similar or faster for the common cases. x86_64 times: benchmark old-Us new-Us old/new blur_image_filter_large_80.00_80.00 4842.04 2626.10 1.84381 blur_image_filter_small_80.00_80.00 3297.72 854.97 3.85712 blur_image_filter_large_10.00_10.00 930.44 720.50 1.29138 blur_image_filter_small_10.00_10.00 69.96 42.15 1.65979 blur_image_filter_large_1.00_1.00 682.66 521.78 1.30833 blur_image_filter_small_1.00_1.00 19.21 14.43 1.33125 blur_image_filter_large_0.50_0.50 696.17 64.14 10.8539 blur_image_filter_small_0.50_0.50 16.26 5.02 3.23904 arm64 times: benchmark old-Us new-Us old/new blur_image_filter_large_80.00_80.00 42144.53 14128.42 2.98296 blur_image_filter_small_80.00_80.00 24840.58 4392.58 5.65512 blur_image_filter_large_10.00_10.00 3556.40 3793.70 0.937449 blur_image_filter_small_10.00_10.00 282.53 220.62 1.28062 blur_image_filter_large_1.00_1.00 2502.20 2937.99 0.851671 blur_image_filter_small_1.00_1.00 83.32 81.93 1.01697 blur_image_filter_large_0.50_0.50 5643.80 272.83 20.6861 blur_image_filter_small_0.50_0.50 141.02 38.29 3.68295 Cq-Include-Trybots: skia.primary:Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SKNX_NO_SIMD Change-Id: Ic53b3186607d5485477b92e4ca7b092bf1366c52 Reviewed-on: https://skia-review.googlesource.com/52771 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
Diffstat (limited to 'tests/ImageFilterTest.cpp')
-rw-r--r--tests/ImageFilterTest.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp
index c39cc2ee83..77175f7cdf 100644
--- a/tests/ImageFilterTest.cpp
+++ b/tests/ImageFilterTest.cpp
@@ -853,7 +853,7 @@ DEF_TEST(ImageFilterBlurThenShadowBounds, reporter) {
sk_sp<SkImageFilter> filter2(make_drop_shadow(std::move(filter1)));
SkIRect bounds = SkIRect::MakeXYWH(0, 0, 100, 100);
- SkIRect expectedBounds = SkIRect::MakeXYWH(-133, -133, 236, 236);
+ SkIRect expectedBounds = SkIRect::MakeXYWH(-132, -132, 234, 234);
bounds = filter2->filterBounds(bounds, SkMatrix::I());
REPORTER_ASSERT(reporter, bounds == expectedBounds);
@@ -864,7 +864,7 @@ DEF_TEST(ImageFilterShadowThenBlurBounds, reporter) {
sk_sp<SkImageFilter> filter2(make_blur(std::move(filter1)));
SkIRect bounds = SkIRect::MakeXYWH(0, 0, 100, 100);
- SkIRect expectedBounds = SkIRect::MakeXYWH(-133, -133, 236, 236);
+ SkIRect expectedBounds = SkIRect::MakeXYWH(-132, -132, 234, 234);
bounds = filter2->filterBounds(bounds, SkMatrix::I());
REPORTER_ASSERT(reporter, bounds == expectedBounds);
@@ -893,7 +893,7 @@ DEF_TEST(ImageFilterScaledBlurRadius, reporter) {
scaleMatrix.setScale(2, 2);
SkIRect bounds = SkIRect::MakeLTRB(0, 0, 200, 200);
- SkIRect expectedBlurBounds = SkIRect::MakeLTRB(-6, -6, 206, 206);
+ SkIRect expectedBlurBounds = SkIRect::MakeLTRB(-5, -5, 205, 205);
SkIRect blurBounds = blur->filterBounds(
bounds, scaleMatrix, SkImageFilter::kForward_MapDirection);
REPORTER_ASSERT(reporter, blurBounds == expectedBlurBounds);
@@ -918,7 +918,7 @@ DEF_TEST(ImageFilterScaledBlurRadius, reporter) {
scaleMatrix.setScale(1, -1);
SkIRect bounds = SkIRect::MakeLTRB(0, -100, 100, 0);
- SkIRect expectedBlurBounds = SkIRect::MakeLTRB(-3, -103, 103, 3);
+ SkIRect expectedBlurBounds = SkIRect::MakeLTRB(-2, -102, 102, 2);
SkIRect blurBounds = blur->filterBounds(
bounds, scaleMatrix, SkImageFilter::kForward_MapDirection);
REPORTER_ASSERT(reporter, blurBounds == expectedBlurBounds);
@@ -947,7 +947,7 @@ DEF_TEST(ImageFilterComposedBlurFastBounds, reporter) {
SkRect boundsSrc = SkRect::MakeWH(SkIntToScalar(100), SkIntToScalar(100));
SkRect expectedBounds = SkRect::MakeXYWH(
- SkIntToScalar(-6), SkIntToScalar(-6), SkIntToScalar(112), SkIntToScalar(112));
+ SkIntToScalar(-4), SkIntToScalar(-4), SkIntToScalar(108), SkIntToScalar(108));
SkRect boundsDst = composedFilter->computeFastBounds(boundsSrc);
REPORTER_ASSERT(reporter, boundsDst == expectedBounds);