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

Side by Side Diff: gm/dropshadowimagefilter.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 unified diff | Download patch
« no previous file with comments | « gm/colormatrix.cpp ('k') | gm/emboss.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 #include "SkColorFilter.h" 9 #include "SkColorFilter.h"
10 10
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 paint.setStyle(SkPaint::kStroke_Style); 86 paint.setStyle(SkPaint::kStroke_Style);
87 paint.setColor(SK_ColorRED); 87 paint.setColor(SK_ColorRED);
88 canvas->drawRect(r, paint); 88 canvas->drawRect(r, paint);
89 } 89 }
90 90
91 virtual void onDraw(SkCanvas* canvas) { 91 virtual void onDraw(SkCanvas* canvas) {
92 void (*drawProc[])(SkCanvas*, const SkRect&, SkImageFilter*) = { 92 void (*drawProc[])(SkCanvas*, const SkRect&, SkImageFilter*) = {
93 draw_bitmap, draw_path, draw_paint, draw_text 93 draw_bitmap, draw_path, draw_paint, draw_text
94 }; 94 };
95 95
96 SkAutoTUnref<SkColorFilter> cf( 96 auto cf(SkColorFilter::MakeModeFilter(SK_ColorMAGENTA, SkXfermode::kSrcI n_Mode));
97 SkColorFilter::CreateModeFilter(SK_ColorMAGENTA, SkXfermode::kSrcIn_ Mode));
98 SkAutoTUnref<SkImageFilter> cfif(SkColorFilterImageFilter::Create(cf.get ())); 97 SkAutoTUnref<SkImageFilter> cfif(SkColorFilterImageFilter::Create(cf.get ()));
99 SkImageFilter::CropRect cropRect(SkRect::Make(SkIRect::MakeXYWH(10, 10, 44, 44)), 98 SkImageFilter::CropRect cropRect(SkRect::Make(SkIRect::MakeXYWH(10, 10, 44, 44)),
100 SkImageFilter::CropRect::kHasAll_CropEd ge); 99 SkImageFilter::CropRect::kHasAll_CropEd ge);
101 SkImageFilter::CropRect bogusRect(SkRect::Make(SkIRect::MakeXYWH(-100, - 100, 10, 10)), 100 SkImageFilter::CropRect bogusRect(SkRect::Make(SkIRect::MakeXYWH(-100, - 100, 10, 10)),
102 SkImageFilter::CropRect::kHasAll_CropE dge); 101 SkImageFilter::CropRect::kHasAll_CropE dge);
103 102
104 SkImageFilter* filters[] = { 103 SkImageFilter* filters[] = {
105 nullptr, 104 nullptr,
106 SkDropShadowImageFilter::Create(7.0f, 0.0f, 0.0f, 3.0f, SK_ColorBLUE , 105 SkDropShadowImageFilter::Create(7.0f, 0.0f, 0.0f, 3.0f, SK_ColorBLUE ,
107 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode), 106 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode),
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 } 139 }
141 } 140 }
142 141
143 private: 142 private:
144 typedef GM INHERITED; 143 typedef GM INHERITED;
145 }; 144 };
146 145
147 /////////////////////////////////////////////////////////////////////////////// 146 ///////////////////////////////////////////////////////////////////////////////
148 147
149 DEF_GM( return new DropShadowImageFilterGM; ) 148 DEF_GM( return new DropShadowImageFilterGM; )
OLDNEW
« no previous file with comments | « gm/colormatrix.cpp ('k') | gm/emboss.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698