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

Unified Diff: samplecode/SampleAll.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 | « public.bzl ('k') | samplecode/SampleColorFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleAll.cpp
diff --git a/samplecode/SampleAll.cpp b/samplecode/SampleAll.cpp
index b8b0ee677d168dfc8d84b4b5a697879a5dc947a0..70ecd9fe7e57dea95258bccb8810c738b00a60f3 100644
--- a/samplecode/SampleAll.cpp
+++ b/samplecode/SampleAll.cpp
@@ -384,7 +384,7 @@ protected:
SkMaskFilter* embossFilter = SkEmbossMaskFilter::Create(sigma, light);
SkXfermode* xfermode = SkXfermode::Create(SkXfermode::kXor_Mode);
- SkColorFilter* lightingFilter = SkColorMatrixFilter::CreateLightingFilter(
+ auto lightingFilter = SkColorMatrixFilter::MakeLightingFilter(
0xff89bc45, 0xff112233);
canvas->save();
@@ -406,7 +406,7 @@ protected:
paint.setStrokeWidth(SkIntToScalar(10));
paint.setStyle(SkPaint::kStroke_Style);
paint.setXfermode(xfermode)->unref();
- paint.setColorFilter(lightingFilter)->unref();
+ paint.setColorFilter(lightingFilter);
canvas->drawLine(start.fX, start.fY, stop.fX, stop.fY, paint); // should not be green
paint.setXfermode(nullptr);
paint.setColorFilter(nullptr);
@@ -543,9 +543,9 @@ protected:
#if 01
int index = i % SK_ARRAY_COUNT(gLightingColors);
- paint.setColorFilter(SkColorMatrixFilter::CreateLightingFilter(
+ paint.setColorFilter(SkColorMatrixFilter::MakeLightingFilter(
gLightingColors[index].fMul,
- gLightingColors[index].fAdd))->unref();
+ gLightingColors[index].fAdd));
#endif
canvas->drawText(str.c_str(), str.size(), x, y, paint);
« no previous file with comments | « public.bzl ('k') | samplecode/SampleColorFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698