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

Side by Side Diff: gm/imagefiltersstroked.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/imagefiltersscaled.cpp ('k') | gm/imagefilterstransformed.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 2015 Google Inc. 2 * Copyright 2015 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 "sk_tool_utils.h" 8 #include "sk_tool_utils.h"
9 #include "SkBlurImageFilter.h" 9 #include "SkBlurImageFilter.h"
10 #include "SkColor.h" 10 #include "SkColor.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 draw_line, draw_rect, draw_circle, 52 draw_line, draw_rect, draw_circle,
53 }; 53 };
54 54
55 canvas->clear(SK_ColorBLACK); 55 canvas->clear(SK_ColorBLACK);
56 56
57 SkMatrix resizeMatrix; 57 SkMatrix resizeMatrix;
58 resizeMatrix.setScale(RESIZE_FACTOR_X, RESIZE_FACTOR_Y); 58 resizeMatrix.setScale(RESIZE_FACTOR_X, RESIZE_FACTOR_Y);
59 59
60 sk_sp<SkImageFilter> filters[] = { 60 sk_sp<SkImageFilter> filters[] = {
61 SkBlurImageFilter::Make(5, 5, nullptr), 61 SkBlurImageFilter::Make(5, 5, nullptr),
62 sk_sp<SkImageFilter>(SkDropShadowImageFilter::Create(10, 10, 3, 3, S K_ColorGREEN, 62 SkDropShadowImageFilter::Make(10, 10, 3, 3, SK_ColorGREEN,
63 SkDropShadowImageFilter::kDrawShadowAndForeground_Sh adowMode)), 63 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode,
64 nullptr),
64 SkOffsetImageFilter::Make(-16, 32, nullptr), 65 SkOffsetImageFilter::Make(-16, 32, nullptr),
65 SkImageFilter::MakeMatrixFilter(resizeMatrix, kNone_SkFilterQuality, nullptr), 66 SkImageFilter::MakeMatrixFilter(resizeMatrix, kNone_SkFilterQuality, nullptr),
66 }; 67 };
67 68
68 SkRect r = SkRect::MakeWH(64, 64); 69 SkRect r = SkRect::MakeWH(64, 64);
69 SkScalar margin = 32; 70 SkScalar margin = 32;
70 SkPaint paint; 71 SkPaint paint;
71 paint.setColor(SK_ColorWHITE); 72 paint.setColor(SK_ColorWHITE);
72 paint.setAntiAlias(true); 73 paint.setAntiAlias(true);
73 paint.setStrokeWidth(10); 74 paint.setStrokeWidth(10);
(...skipping 25 matching lines...) Expand all
99 100
100 private: 101 private:
101 typedef GM INHERITED; 102 typedef GM INHERITED;
102 }; 103 };
103 104
104 ////////////////////////////////////////////////////////////////////////////// 105 //////////////////////////////////////////////////////////////////////////////
105 106
106 DEF_GM(return new ImageFiltersStrokedGM;) 107 DEF_GM(return new ImageFiltersStrokedGM;)
107 108
108 } 109 }
OLDNEW
« no previous file with comments | « gm/imagefiltersscaled.cpp ('k') | gm/imagefilterstransformed.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698