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

Side by Side Diff: gm/dropshadowimagefilter.cpp

Issue 1316233002: Style Change: NULL->nullptr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-27 (Thursday) 10:25:06 EDT Created 5 years, 3 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/drawminibitmaprect.cpp ('k') | gm/etc1bitmap.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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 static void draw_bitmap(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) { 51 static void draw_bitmap(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) {
52 SkPaint paint; 52 SkPaint paint;
53 53
54 SkIRect bounds; 54 SkIRect bounds;
55 r.roundOut(&bounds); 55 r.roundOut(&bounds);
56 56
57 SkBitmap bm; 57 SkBitmap bm;
58 bm.allocN32Pixels(bounds.width(), bounds.height()); 58 bm.allocN32Pixels(bounds.width(), bounds.height());
59 bm.eraseColor(SK_ColorTRANSPARENT); 59 bm.eraseColor(SK_ColorTRANSPARENT);
60 SkCanvas c(bm); 60 SkCanvas c(bm);
61 draw_path(&c, r, NULL); 61 draw_path(&c, r, nullptr);
62 62
63 paint.setImageFilter(imf); 63 paint.setImageFilter(imf);
64 canvas->save(); 64 canvas->save();
65 canvas->clipRect(r); 65 canvas->clipRect(r);
66 canvas->drawBitmap(bm, 0, 0, &paint); 66 canvas->drawBitmap(bm, 0, 0, &paint);
67 canvas->restore(); 67 canvas->restore();
68 } 68 }
69 69
70 static void draw_sprite(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) { 70 static void draw_sprite(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) {
71 SkPaint paint; 71 SkPaint paint;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 118
119 SkAutoTUnref<SkColorFilter> cf( 119 SkAutoTUnref<SkColorFilter> cf(
120 SkColorFilter::CreateModeFilter(SK_ColorMAGENTA, SkXfermode::kSrcIn_ Mode)); 120 SkColorFilter::CreateModeFilter(SK_ColorMAGENTA, SkXfermode::kSrcIn_ Mode));
121 SkAutoTUnref<SkImageFilter> cfif(SkColorFilterImageFilter::Create(cf.get ())); 121 SkAutoTUnref<SkImageFilter> cfif(SkColorFilterImageFilter::Create(cf.get ()));
122 SkImageFilter::CropRect cropRect(SkRect::Make(SkIRect::MakeXYWH(10, 10, 44, 44)), 122 SkImageFilter::CropRect cropRect(SkRect::Make(SkIRect::MakeXYWH(10, 10, 44, 44)),
123 SkImageFilter::CropRect::kHasAll_CropEd ge); 123 SkImageFilter::CropRect::kHasAll_CropEd ge);
124 SkImageFilter::CropRect bogusRect(SkRect::Make(SkIRect::MakeXYWH(-100, - 100, 10, 10)), 124 SkImageFilter::CropRect bogusRect(SkRect::Make(SkIRect::MakeXYWH(-100, - 100, 10, 10)),
125 SkImageFilter::CropRect::kHasAll_CropE dge); 125 SkImageFilter::CropRect::kHasAll_CropE dge);
126 126
127 SkImageFilter* filters[] = { 127 SkImageFilter* filters[] = {
128 NULL, 128 nullptr,
129 SkDropShadowImageFilter::Create(7.0f, 0.0f, 0.0f, 3.0f, SK_ColorBLUE , 129 SkDropShadowImageFilter::Create(7.0f, 0.0f, 0.0f, 3.0f, SK_ColorBLUE ,
130 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode), 130 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode),
131 SkDropShadowImageFilter::Create(0.0f, 7.0f, 3.0f, 0.0f, SK_ColorBLUE , 131 SkDropShadowImageFilter::Create(0.0f, 7.0f, 3.0f, 0.0f, SK_ColorBLUE ,
132 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode), 132 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode),
133 SkDropShadowImageFilter::Create(7.0f, 7.0f, 3.0f, 3.0f, SK_ColorBLUE , 133 SkDropShadowImageFilter::Create(7.0f, 7.0f, 3.0f, 3.0f, SK_ColorBLUE ,
134 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode), 134 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode),
135 SkDropShadowImageFilter::Create(7.0f, 7.0f, 3.0f, 3.0f, SK_ColorBLUE , 135 SkDropShadowImageFilter::Create(7.0f, 7.0f, 3.0f, 3.0f, SK_ColorBLUE ,
136 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode, cf if, NULL), 136 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode, cf if, nullptr),
137 SkDropShadowImageFilter::Create(7.0f, 7.0f, 3.0f, 3.0f, SK_ColorBLUE , 137 SkDropShadowImageFilter::Create(7.0f, 7.0f, 3.0f, 3.0f, SK_ColorBLUE ,
138 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode, NU LL, &cropRect), 138 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode, nu llptr, &cropRect),
139 SkDropShadowImageFilter::Create(7.0f, 7.0f, 3.0f, 3.0f, SK_ColorBLUE , 139 SkDropShadowImageFilter::Create(7.0f, 7.0f, 3.0f, 3.0f, SK_ColorBLUE ,
140 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode, NU LL, &bogusRect), 140 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode, nu llptr, &bogusRect),
141 SkDropShadowImageFilter::Create(7.0f, 7.0f, 3.0f, 3.0f, SK_ColorBLUE , 141 SkDropShadowImageFilter::Create(7.0f, 7.0f, 3.0f, 3.0f, SK_ColorBLUE ,
142 SkDropShadowImageFilter::kDrawShadowOnly_ShadowMode), 142 SkDropShadowImageFilter::kDrawShadowOnly_ShadowMode),
143 }; 143 };
144 144
145 SkRect r = SkRect::MakeWH(SkIntToScalar(64), SkIntToScalar(64)); 145 SkRect r = SkRect::MakeWH(SkIntToScalar(64), SkIntToScalar(64));
146 SkScalar MARGIN = SkIntToScalar(16); 146 SkScalar MARGIN = SkIntToScalar(16);
147 SkScalar DX = r.width() + MARGIN; 147 SkScalar DX = r.width() + MARGIN;
148 SkScalar DY = r.height() + MARGIN; 148 SkScalar DY = r.height() + MARGIN;
149 149
150 canvas->translate(MARGIN, MARGIN); 150 canvas->translate(MARGIN, MARGIN);
(...skipping 13 matching lines...) Expand all
164 } 164 }
165 165
166 private: 166 private:
167 typedef GM INHERITED; 167 typedef GM INHERITED;
168 }; 168 };
169 169
170 /////////////////////////////////////////////////////////////////////////////// 170 ///////////////////////////////////////////////////////////////////////////////
171 171
172 static skiagm::GM* MyFactory(void*) { return new DropShadowImageFilterGM; } 172 static skiagm::GM* MyFactory(void*) { return new DropShadowImageFilterGM; }
173 static skiagm::GMRegistry reg(MyFactory); 173 static skiagm::GMRegistry reg(MyFactory);
OLDNEW
« no previous file with comments | « gm/drawminibitmaprect.cpp ('k') | gm/etc1bitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698