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

Unified Diff: samplecode/SampleAll.cpp

Issue 1820303002: Revert of switch colorfilters to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 70ecd9fe7e57dea95258bccb8810c738b00a60f3..b8b0ee677d168dfc8d84b4b5a697879a5dc947a0 100644
--- a/samplecode/SampleAll.cpp
+++ b/samplecode/SampleAll.cpp
@@ -384,7 +384,7 @@
SkMaskFilter* embossFilter = SkEmbossMaskFilter::Create(sigma, light);
SkXfermode* xfermode = SkXfermode::Create(SkXfermode::kXor_Mode);
- auto lightingFilter = SkColorMatrixFilter::MakeLightingFilter(
+ SkColorFilter* lightingFilter = SkColorMatrixFilter::CreateLightingFilter(
0xff89bc45, 0xff112233);
canvas->save();
@@ -406,7 +406,7 @@
paint.setStrokeWidth(SkIntToScalar(10));
paint.setStyle(SkPaint::kStroke_Style);
paint.setXfermode(xfermode)->unref();
- paint.setColorFilter(lightingFilter);
+ paint.setColorFilter(lightingFilter)->unref();
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 @@
#if 01
int index = i % SK_ARRAY_COUNT(gLightingColors);
- paint.setColorFilter(SkColorMatrixFilter::MakeLightingFilter(
+ paint.setColorFilter(SkColorMatrixFilter::CreateLightingFilter(
gLightingColors[index].fMul,
- gLightingColors[index].fAdd));
+ gLightingColors[index].fAdd))->unref();
#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