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

Side by Side Diff: gm/drawminibitmaprect.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/drawlooper.cpp ('k') | gm/dropshadowimagefilter.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 "gm.h" 8 #include "gm.h"
9 #include "SkColorPriv.h" 9 #include "SkColorPriv.h"
10 #include "SkGradientShader.h" 10 #include "SkGradientShader.h"
11 #include "SkImage.h" 11 #include "SkImage.h"
12 #include "SkRandom.h" 12 #include "SkRandom.h"
13 #include "SkShader.h" 13 #include "SkShader.h"
14 #include "SkSurface.h" 14 #include "SkSurface.h"
15 15
16 static SkImage* makebm(SkCanvas* caller, int w, int h) { 16 static SkImage* makebm(SkCanvas* caller, int w, int h) {
17 SkImageInfo info = SkImageInfo::MakeN32Premul(w, h); 17 SkImageInfo info = SkImageInfo::MakeN32Premul(w, h);
18 SkAutoTUnref<SkSurface> surface(caller->newSurface(info)); 18 SkAutoTUnref<SkSurface> surface(caller->newSurface(info));
19 if (NULL == surface) { 19 if (nullptr == surface) {
20 surface.reset(SkSurface::NewRaster(info)); 20 surface.reset(SkSurface::NewRaster(info));
21 } 21 }
22 SkCanvas* canvas = surface->getCanvas(); 22 SkCanvas* canvas = surface->getCanvas();
23 23
24 const SkScalar wScalar = SkIntToScalar(w); 24 const SkScalar wScalar = SkIntToScalar(w);
25 const SkScalar hScalar = SkIntToScalar(h); 25 const SkScalar hScalar = SkIntToScalar(h);
26 26
27 const SkPoint pt = { wScalar / 2, hScalar / 2 }; 27 const SkPoint pt = { wScalar / 2, hScalar / 2 };
28 28
29 const SkScalar radius = 4 * SkMaxScalar(wScalar, hScalar); 29 const SkScalar radius = 4 * SkMaxScalar(wScalar, hScalar);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 fName.appendf("_aa"); 72 fName.appendf("_aa");
73 } 73 }
74 } 74 }
75 75
76 protected: 76 protected:
77 SkString onShortName() override { return fName; } 77 SkString onShortName() override { return fName; }
78 78
79 SkISize onISize() override { return SkISize::Make(gSize, gSize); } 79 SkISize onISize() override { return SkISize::Make(gSize, gSize); }
80 80
81 void onDraw(SkCanvas* canvas) override { 81 void onDraw(SkCanvas* canvas) override {
82 if (NULL == fImage) { 82 if (nullptr == fImage) {
83 fImage.reset(makebm(canvas, gSurfaceSize, gSurfaceSize)); 83 fImage.reset(makebm(canvas, gSurfaceSize, gSurfaceSize));
84 } 84 }
85 85
86 const SkRect dstRect = { 0, 0, SkIntToScalar(64), SkIntToScalar(64)}; 86 const SkRect dstRect = { 0, 0, SkIntToScalar(64), SkIntToScalar(64)};
87 static const int kMaxSrcRectSize = 1 << (SkNextLog2(gSurfaceSize) + 2); 87 static const int kMaxSrcRectSize = 1 << (SkNextLog2(gSurfaceSize) + 2);
88 88
89 static const int kPadX = 30; 89 static const int kPadX = 30;
90 static const int kPadY = 40; 90 static const int kPadY = 40;
91 91
92 int rowCount = 0; 92 int rowCount = 0;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 bool fAA; 134 bool fAA;
135 SkAutoTUnref<SkImage> fImage; 135 SkAutoTUnref<SkImage> fImage;
136 SkString fName; 136 SkString fName;
137 137
138 typedef skiagm::GM INHERITED; 138 typedef skiagm::GM INHERITED;
139 }; 139 };
140 140
141 DEF_GM( return new DrawMiniBitmapRectGM(true); ) 141 DEF_GM( return new DrawMiniBitmapRectGM(true); )
142 DEF_GM( return new DrawMiniBitmapRectGM(false); ) 142 DEF_GM( return new DrawMiniBitmapRectGM(false); )
143 143
OLDNEW
« no previous file with comments | « gm/drawlooper.cpp ('k') | gm/dropshadowimagefilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698