Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(327)

Unified Diff: tests/ImageFilterTest.cpp

Issue 1858353002: Update SkMatrixImageFilter to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix fuzz Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkMatrixImageFilter.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/ImageFilterTest.cpp
diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp
index ea27d7bdcea4cc97fdb9479c166628cfc5098b04..b0b7349aeaeab7d2333d2197d2018c4a9ad06a81 100644
--- a/tests/ImageFilterTest.cpp
+++ b/tests/ImageFilterTest.cpp
@@ -225,8 +225,8 @@ public:
cropRect ? cropRect->rect() : SkRect::MakeXYWH(0, 0, 100, 100),
input.get()));
if (!cropRect) {
- this->addFilter("matrix", SkImageFilter::CreateMatrixFilter(
- matrix, kLow_SkFilterQuality, input.get()));
+ this->addFilter("matrix",
+ SkImageFilter::MakeMatrixFilter(matrix, kLow_SkFilterQuality, input).release());
}
{
@@ -801,9 +801,9 @@ static void draw_saveLayer_picture(int width, int height, int tileSize,
sk_sp<SkColorFilter> cf(SkColorFilter::MakeModeFilter(SK_ColorWHITE, SkXfermode::kSrc_Mode));
sk_sp<SkImageFilter> cfif(SkColorFilterImageFilter::Make(std::move(cf), nullptr));
- sk_sp<SkImageFilter> imageFilter(SkImageFilter::CreateMatrixFilter(matrix,
- kNone_SkFilterQuality,
- cfif.get()));
+ sk_sp<SkImageFilter> imageFilter(SkImageFilter::MakeMatrixFilter(matrix,
+ kNone_SkFilterQuality,
+ std::move(cfif)));
SkPaint paint;
paint.setImageFilter(std::move(imageFilter));
@@ -1397,15 +1397,15 @@ DEF_TEST(ImageFilterNestedSaveLayer, reporter) {
SkMatrix matrix;
matrix.setScale(SkIntToScalar(2), SkIntToScalar(2));
matrix.postTranslate(SkIntToScalar(-20), SkIntToScalar(-20));
- SkAutoTUnref<SkImageFilter> matrixFilter(
- SkImageFilter::CreateMatrixFilter(matrix, kLow_SkFilterQuality));
+ sk_sp<SkImageFilter> matrixFilter(
+ SkImageFilter::MakeMatrixFilter(matrix, kLow_SkFilterQuality, nullptr));
// Test that saveLayer() with a filter nested inside another saveLayer() applies the
// correct offset to the filter matrix.
SkRect bounds1 = SkRect::MakeXYWH(10, 10, 30, 30);
canvas.saveLayer(&bounds1, nullptr);
SkPaint filterPaint;
- filterPaint.setImageFilter(matrixFilter);
+ filterPaint.setImageFilter(std::move(matrixFilter));
SkRect bounds2 = SkRect::MakeXYWH(20, 20, 10, 10);
canvas.saveLayer(&bounds2, &filterPaint);
SkPaint greenPaint;
« no previous file with comments | « src/core/SkMatrixImageFilter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698