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

Side by Side Diff: gm/textbloblooper.cpp

Issue 1827433002: Reland of [2] of "switch colorfilters to sk_sp (patchset #11 id:200001 of https://codereview.chromium.o… (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 unified diff | Download patch
« no previous file with comments | « gm/testimagefilters.cpp ('k') | gm/tileimagefilter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "gm.h" 8 #include "gm.h"
9 9
10 #include "Sk2DPathEffect.h" 10 #include "Sk2DPathEffect.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 SK_ColorCYAN, SK_ColorMAGENTA, SK_ColorYELLOW, 90 SK_ColorCYAN, SK_ColorMAGENTA, SK_ColorYELLOW,
91 }; 91 };
92 return SkGradientShader::MakeLinear(pts, colors, nullptr, SK_ARRAY_COUNT(col ors), 92 return SkGradientShader::MakeLinear(pts, colors, nullptr, SK_ARRAY_COUNT(col ors),
93 SkShader::kClamp_TileMode); 93 SkShader::kClamp_TileMode);
94 } 94 }
95 95
96 static void color_filter(SkPaint* paint) { 96 static void color_filter(SkPaint* paint) {
97 SkRect r; 97 SkRect r;
98 r.setWH(SkIntToScalar(kWidth), 50); 98 r.setWH(SkIntToScalar(kWidth), 50);
99 paint->setShader(make_shader(r)); 99 paint->setShader(make_shader(r));
100 paint->setColorFilter(SkColorMatrixFilter::CreateLightingFilter(0xF0F0F0, 0) )->unref(); 100 paint->setColorFilter(SkColorMatrixFilter::MakeLightingFilter(0xF0F0F0, 0));
101 } 101 }
102 102
103 static void kitchen_sink(SkPaint* paint) { 103 static void kitchen_sink(SkPaint* paint) {
104 color_filter(paint); 104 color_filter(paint);
105 path_effect(paint); 105 path_effect(paint);
106 mask_filter(paint); 106 mask_filter(paint);
107 107
108 } 108 }
109 109
110 static sk_sp<SkDrawLooper> setupLooper(SkLayerDrawLooper::BitFlags bits, 110 static sk_sp<SkDrawLooper> setupLooper(SkLayerDrawLooper::BitFlags bits,
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 SkAutoTUnref<const SkTextBlob> fBlob; 249 SkAutoTUnref<const SkTextBlob> fBlob;
250 SkTArray<sk_sp<SkDrawLooper>, true> fLoopers; 250 SkTArray<sk_sp<SkDrawLooper>, true> fLoopers;
251 251
252 typedef GM INHERITED; 252 typedef GM INHERITED;
253 }; 253 };
254 254
255 ////////////////////////////////////////////////////////////////////////////// 255 //////////////////////////////////////////////////////////////////////////////
256 256
257 DEF_GM(return new TextBlobLooperGM;) 257 DEF_GM(return new TextBlobLooperGM;)
258 } 258 }
OLDNEW
« no previous file with comments | « gm/testimagefilters.cpp ('k') | gm/tileimagefilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698