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

Side by Side Diff: gm/spritebitmap.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/simpleaaclip.cpp ('k') | gm/srcmode.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 "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkBlurImageFilter.h" 10 #include "SkBlurImageFilter.h"
11 #include "SkRSXform.h" 11 #include "SkRSXform.h"
12 #include "SkSurface.h" 12 #include "SkSurface.h"
13 13
14 static void make_bm(SkBitmap* bm) { 14 static void make_bm(SkBitmap* bm) {
15 bm->allocN32Pixels(100, 100); 15 bm->allocN32Pixels(100, 100);
16 bm->eraseColor(SK_ColorBLUE); 16 bm->eraseColor(SK_ColorBLUE);
17 17
18 SkCanvas canvas(*bm); 18 SkCanvas canvas(*bm);
19 SkPaint paint; 19 SkPaint paint;
20 paint.setAntiAlias(true); 20 paint.setAntiAlias(true);
21 paint.setColor(SK_ColorRED); 21 paint.setColor(SK_ColorRED);
22 canvas.drawCircle(50, 50, 50, paint); 22 canvas.drawCircle(50, 50, 50, paint);
23 } 23 }
24 24
25 static void draw_2_bitmaps(SkCanvas* canvas, const SkBitmap& bm, bool doClip, 25 static void draw_2_bitmaps(SkCanvas* canvas, const SkBitmap& bm, bool doClip,
26 int dx, int dy, SkImageFilter* filter = NULL) { 26 int dx, int dy, SkImageFilter* filter = nullptr) {
27 SkAutoCanvasRestore acr(canvas, true); 27 SkAutoCanvasRestore acr(canvas, true);
28 SkPaint paint; 28 SkPaint paint;
29 29
30 SkRect clipR = SkRect::MakeXYWH(SkIntToScalar(dx), 30 SkRect clipR = SkRect::MakeXYWH(SkIntToScalar(dx),
31 SkIntToScalar(dy), 31 SkIntToScalar(dy),
32 SkIntToScalar(bm.width()), 32 SkIntToScalar(bm.width()),
33 SkIntToScalar(bm.height())); 33 SkIntToScalar(bm.height()));
34 34
35 paint.setImageFilter(filter); 35 paint.setImageFilter(filter);
36 clipR.inset(5, 5); 36 clipR.inset(5, 5);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 draw_2_bitmaps(canvas, bm, true, dx, dy); 90 draw_2_bitmaps(canvas, bm, true, dx, dy);
91 dy += bm.height() + 20; 91 dy += bm.height() + 20;
92 draw_2_bitmaps(canvas, bm, true, dx, dy, filter); 92 draw_2_bitmaps(canvas, bm, true, dx, dy, filter);
93 } 93 }
94 94
95 private: 95 private:
96 typedef GM INHERITED; 96 typedef GM INHERITED;
97 }; 97 };
98 DEF_GM( return new SpriteBitmapGM; ) 98 DEF_GM( return new SpriteBitmapGM; )
99 99
OLDNEW
« no previous file with comments | « gm/simpleaaclip.cpp ('k') | gm/srcmode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698