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

Side by Side Diff: gm/dropshadowimagefilter.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 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 auto cf(SkColorFilter::MakeModeFilter(SK_ColorMAGENTA, SkXfermode::kSrcI n_Mode)); 96 SkAutoTUnref<SkColorFilter> cf(
97 SkColorFilter::CreateModeFilter(SK_ColorMAGENTA, SkXfermode::kSrcIn_ Mode));
97 SkAutoTUnref<SkImageFilter> cfif(SkColorFilterImageFilter::Create(cf.get ())); 98 SkAutoTUnref<SkImageFilter> cfif(SkColorFilterImageFilter::Create(cf.get ()));
98 SkImageFilter::CropRect cropRect(SkRect::Make(SkIRect::MakeXYWH(10, 10, 44, 44)), 99 SkImageFilter::CropRect cropRect(SkRect::Make(SkIRect::MakeXYWH(10, 10, 44, 44)),
99 SkImageFilter::CropRect::kHasAll_CropEd ge); 100 SkImageFilter::CropRect::kHasAll_CropEd ge);
100 SkImageFilter::CropRect bogusRect(SkRect::Make(SkIRect::MakeXYWH(-100, - 100, 10, 10)), 101 SkImageFilter::CropRect bogusRect(SkRect::Make(SkIRect::MakeXYWH(-100, - 100, 10, 10)),
101 SkImageFilter::CropRect::kHasAll_CropE dge); 102 SkImageFilter::CropRect::kHasAll_CropE dge);
102 103
103 SkImageFilter* filters[] = { 104 SkImageFilter* filters[] = {
104 nullptr, 105 nullptr,
105 SkDropShadowImageFilter::Create(7.0f, 0.0f, 0.0f, 3.0f, SK_ColorBLUE , 106 SkDropShadowImageFilter::Create(7.0f, 0.0f, 0.0f, 3.0f, SK_ColorBLUE ,
106 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode), 107 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode),
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 } 140 }
140 } 141 }
141 142
142 private: 143 private:
143 typedef GM INHERITED; 144 typedef GM INHERITED;
144 }; 145 };
145 146
146 /////////////////////////////////////////////////////////////////////////////// 147 ///////////////////////////////////////////////////////////////////////////////
147 148
148 DEF_GM( return new DropShadowImageFilterGM; ) 149 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