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

Side by Side Diff: gm/imagefiltersbase.cpp

Issue 1861843002: Update DropShadowImageFilter to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address code review issues 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 unified diff | Download patch
« no previous file with comments | « gm/filterfastbounds.cpp ('k') | gm/imagefiltersclipped.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 2011 Google Inc. 2 * Copyright 2011 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 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkColorFilter.h" 10 #include "SkColorFilter.h"
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 draw_bitmap, 195 draw_bitmap,
196 }; 196 };
197 197
198 auto cf = SkColorFilter::MakeModeFilter(SK_ColorRED, SkXfermode::kSrcIn_ Mode); 198 auto cf = SkColorFilter::MakeModeFilter(SK_ColorRED, SkXfermode::kSrcIn_ Mode);
199 sk_sp<SkImageFilter> filters[] = { 199 sk_sp<SkImageFilter> filters[] = {
200 nullptr, 200 nullptr,
201 IdentityImageFilter::Make(nullptr), 201 IdentityImageFilter::Make(nullptr),
202 FailImageFilter::Make(), 202 FailImageFilter::Make(),
203 SkColorFilterImageFilter::Make(std::move(cf), nullptr), 203 SkColorFilterImageFilter::Make(std::move(cf), nullptr),
204 SkBlurImageFilter::Make(12.0f, 0.0f, nullptr), 204 SkBlurImageFilter::Make(12.0f, 0.0f, nullptr),
205 sk_sp<SkImageFilter>(SkDropShadowImageFilter::Create( 205 SkDropShadowImageFilter::Make(
206 10.0f, 5.0f, 3.0f, 3.0f, SK_ColorBLUE, 206 10.0f, 5.0f, 3.0f, 3.0f, SK_ColorBLUE,
207 SkDropShadowImageFilter::kDrawShadowAndForeg round_ShadowMode)), 207 SkDropShadowImageFilter::kDrawShadowAndForeg round_ShadowMode,
208 nullptr),
208 }; 209 };
209 210
210 SkRect r = SkRect::MakeWH(SkIntToScalar(64), SkIntToScalar(64)); 211 SkRect r = SkRect::MakeWH(SkIntToScalar(64), SkIntToScalar(64));
211 SkScalar MARGIN = SkIntToScalar(16); 212 SkScalar MARGIN = SkIntToScalar(16);
212 SkScalar DX = r.width() + MARGIN; 213 SkScalar DX = r.width() + MARGIN;
213 SkScalar DY = r.height() + MARGIN; 214 SkScalar DY = r.height() + MARGIN;
214 215
215 canvas->translate(MARGIN, MARGIN); 216 canvas->translate(MARGIN, MARGIN);
216 for (size_t i = 0; i < SK_ARRAY_COUNT(drawProc); ++i) { 217 for (size_t i = 0; i < SK_ARRAY_COUNT(drawProc); ++i) {
217 canvas->save(); 218 canvas->save();
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 316
316 class ImageFiltersText_CF : public ImageFiltersTextBaseGM { 317 class ImageFiltersText_CF : public ImageFiltersTextBaseGM {
317 public: 318 public:
318 ImageFiltersText_CF() : ImageFiltersTextBaseGM("color") {} 319 ImageFiltersText_CF() : ImageFiltersTextBaseGM("color") {}
319 320
320 void installFilter(SkPaint* paint) override { 321 void installFilter(SkPaint* paint) override {
321 paint->setColorFilter(SkColorFilter::MakeModeFilter(SK_ColorBLUE, SkXfer mode::kSrcIn_Mode)); 322 paint->setColorFilter(SkColorFilter::MakeModeFilter(SK_ColorBLUE, SkXfer mode::kSrcIn_Mode));
322 } 323 }
323 }; 324 };
324 DEF_GM( return new ImageFiltersText_CF; ) 325 DEF_GM( return new ImageFiltersText_CF; )
OLDNEW
« no previous file with comments | « gm/filterfastbounds.cpp ('k') | gm/imagefiltersclipped.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698