aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar djsollen <djsollen@google.com>2016-03-29 19:07:07 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-29 19:07:07 -0700
commit890579051d4096a8f769eadb9cde3f931d7abd7c (patch)
tree3c683bc8f4fc81d6b48fbf763c50540c39a64098 /tests
parent308d988cba909ffbb456d4f327820a57df0d1d51 (diff)
Revert of Switch SkLocalMatrixImageFilter and SkPaintImageFilter over to sk_sp (patchset #6 id:100001 of https://codereview.chromium.org/1842793002/ )
Reason for revert: This CL is causing the autoroll into Chromium & google3 to fail. Original issue's description: > Switch SkLocalMatrixImageFilter and SkPaintImageFilter over to sk_sp > > TBR=reed@google.com > > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1842793002 > > Committed: https://skia.googlesource.com/skia/+/a33cf07a2273315363c0b6fb5d3ce811742f5a85 TBR=fmalita@chromium.org,reed@google.com,robertphillips@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1837293003
Diffstat (limited to 'tests')
-rw-r--r--tests/ImageFilterTest.cpp13
-rw-r--r--tests/PaintImageFilterTest.cpp4
2 files changed, 8 insertions, 9 deletions
diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp
index cd900e3df1..9d2039687d 100644
--- a/tests/ImageFilterTest.cpp
+++ b/tests/ImageFilterTest.cpp
@@ -138,17 +138,17 @@ public:
SkPaint paint;
paint.setShader(shader);
- sk_sp<SkImageFilter> paintFilter(SkPaintImageFilter::Make(paint));
+ SkAutoTUnref<SkImageFilter> paintFilter(SkPaintImageFilter::Create(paint));
sk_sp<SkShader> greenColorShader(SkShader::MakeColorShader(SK_ColorGREEN));
SkPaint greenColorShaderPaint;
greenColorShaderPaint.setShader(greenColorShader);
SkImageFilter::CropRect leftSideCropRect(SkRect::MakeXYWH(0, 0, 32, 64));
- sk_sp<SkImageFilter> paintFilterLeft(SkPaintImageFilter::Make(greenColorShaderPaint,
- &leftSideCropRect));
+ SkAutoTUnref<SkImageFilter> paintFilterLeft(SkPaintImageFilter::Create(
+ greenColorShaderPaint, &leftSideCropRect));
SkImageFilter::CropRect rightSideCropRect(SkRect::MakeXYWH(32, 0, 32, 64));
- sk_sp<SkImageFilter> paintFilterRight(SkPaintImageFilter::Make(greenColorShaderPaint,
- &rightSideCropRect));
+ SkAutoTUnref<SkImageFilter> paintFilterRight(SkPaintImageFilter::Create(
+ greenColorShaderPaint, &rightSideCropRect));
this->addFilter("color filter",
SkColorFilterImageFilter::Create(cf.get(), input, cropRect));
@@ -172,8 +172,7 @@ public:
this->addFilter("merge", SkMergeImageFilter::Create(input, input, SkXfermode::kSrcOver_Mode,
cropRect));
this->addFilter("merge with disjoint inputs", SkMergeImageFilter::Create(
- paintFilterLeft.get(), paintFilterRight.get(),
- SkXfermode::kSrcOver_Mode, cropRect));
+ paintFilterLeft, paintFilterRight, SkXfermode::kSrcOver_Mode, cropRect));
this->addFilter("offset",
SkOffsetImageFilter::Create(SK_Scalar1, SK_Scalar1, input, cropRect));
this->addFilter("dilate", SkDilateImageFilter::Create(3, 2, input, cropRect));
diff --git a/tests/PaintImageFilterTest.cpp b/tests/PaintImageFilterTest.cpp
index 03653368ab..f1c0c2eb97 100644
--- a/tests/PaintImageFilterTest.cpp
+++ b/tests/PaintImageFilterTest.cpp
@@ -38,7 +38,7 @@ static void test_unscaled(skiatest::Reporter* reporter) {
{
SkPaint paint;
SkImageFilter::CropRect cr(r);
- paint.setImageFilter(SkPaintImageFilter::Make(gradientPaint, &cr));
+ paint.setImageFilter(SkPaintImageFilter::Create(gradientPaint, &cr))->unref();
canvasFilter.drawRect(r, paint);
}
@@ -84,7 +84,7 @@ static void test_scaled(skiatest::Reporter* reporter) {
{
SkPaint paint;
SkImageFilter::CropRect cr(r);
- paint.setImageFilter(SkPaintImageFilter::Make(gradientPaint, &cr));
+ paint.setImageFilter(SkPaintImageFilter::Create(gradientPaint, &cr))->unref();
canvasFilter.scale(SkIntToScalar(2), SkIntToScalar(2));
canvasFilter.drawRect(r, paint);
}