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

Unified Diff: tests/ColorMatrixTest.cpp

Issue 1822623002: switch colorfilters to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 4 years, 9 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 | « tests/ColorFilterTest.cpp ('k') | tests/GpuColorFilterTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/ColorMatrixTest.cpp
diff --git a/tests/ColorMatrixTest.cpp b/tests/ColorMatrixTest.cpp
index 1eea4f5a9de4c252a55a59f88f8bb3a773e369fc..7919b40242a1dd262e190c7999dcc92fc45f6eeb 100644
--- a/tests/ColorMatrixTest.cpp
+++ b/tests/ColorMatrixTest.cpp
@@ -45,7 +45,7 @@ static inline void test_colorMatrixCTS(skiatest::Reporter* reporter) {
0.0f, 1.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 0.0f, 1.0f, 0.0f };
- paint.setColorFilter(SkColorMatrixFilter::Create(blueToCyan))->unref();
+ paint.setColorFilter(SkColorFilter::MakeMatrixFilterRowMajor255(blueToCyan));
paint.setColor(SK_ColorBLUE);
canvas.drawPoint(0, 0, paint);
@@ -70,7 +70,7 @@ static inline void test_colorMatrixCTS(skiatest::Reporter* reporter) {
0.0f, 0.0f, 1.0f, 0.0f, 64.0f,
-0.5f, 0.0f, 0.0f, 1.0f, 0.0f
};
- paint.setColorFilter(SkColorMatrixFilter::Create(transparentRedAddBlue))->unref();
+ paint.setColorFilter(SkColorFilter::MakeMatrixFilterRowMajor255(transparentRedAddBlue));
bitmap.eraseColor(SK_ColorTRANSPARENT);
paint.setColor(SK_ColorRED);
@@ -91,7 +91,7 @@ static inline void test_colorMatrixCTS(skiatest::Reporter* reporter) {
assert_color(reporter, SK_ColorCYAN, bitmap.getColor(0, 0));
// create a new filter with the changed matrix
- paint.setColorFilter(SkColorMatrixFilter::Create(transparentRedAddBlue))->unref();
+ paint.setColorFilter(SkColorFilter::MakeMatrixFilterRowMajor255(transparentRedAddBlue));
canvas.drawPoint(0, 0, paint);
assert_color(reporter, SK_ColorBLUE, bitmap.getColor(0, 0));
}
« no previous file with comments | « tests/ColorFilterTest.cpp ('k') | tests/GpuColorFilterTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698