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

Side by Side Diff: gm/imagefiltersscaled.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/imagefiltersgraph.cpp ('k') | gm/imagefilterstransformed.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 2014 Google Inc. 2 * Copyright 2014 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 "sk_tool_utils.h" 8 #include "sk_tool_utils.h"
9 #include "SkBitmapSource.h" 9 #include "SkBitmapSource.h"
10 #include "SkBlurImageFilter.h" 10 #include "SkBlurImageFilter.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 SkScalar x = SkIntToScalar(width / 2); 45 SkScalar x = SkIntToScalar(width / 2);
46 SkScalar y = SkIntToScalar(height / 2); 46 SkScalar y = SkIntToScalar(height / 2);
47 SkScalar radius = SkScalarMul(SkMinScalar(x, y), SkIntToScalar(4) / SkIn tToScalar(5)); 47 SkScalar radius = SkScalarMul(SkMinScalar(x, y), SkIntToScalar(4) / SkIn tToScalar(5));
48 fGradientCircle.allocN32Pixels(width, height); 48 fGradientCircle.allocN32Pixels(width, height);
49 SkCanvas canvas(fGradientCircle); 49 SkCanvas canvas(fGradientCircle);
50 canvas.clear(0x00000000); 50 canvas.clear(0x00000000);
51 SkColor colors[2]; 51 SkColor colors[2];
52 colors[0] = SK_ColorWHITE; 52 colors[0] = SK_ColorWHITE;
53 colors[1] = SK_ColorBLACK; 53 colors[1] = SK_ColorBLACK;
54 SkAutoTUnref<SkShader> shader( 54 SkAutoTUnref<SkShader> shader(
55 SkGradientShader::CreateRadial(SkPoint::Make(x, y), radius, colors, NULL, 2, 55 SkGradientShader::CreateRadial(SkPoint::Make(x, y), radius, colors, nullptr, 2,
56 SkShader::kClamp_TileMode) 56 SkShader::kClamp_TileMode)
57 ); 57 );
58 SkPaint paint; 58 SkPaint paint;
59 paint.setShader(shader); 59 paint.setShader(shader);
60 canvas.drawCircle(x, y, radius, paint); 60 canvas.drawCircle(x, y, radius, paint);
61 } 61 }
62 62
63 virtual void onDraw(SkCanvas* canvas) { 63 virtual void onDraw(SkCanvas* canvas) {
64 if (!fInitialized) { 64 if (!fInitialized) {
65 fCheckerboard.allocN32Pixels(64, 64); 65 fCheckerboard.allocN32Pixels(64, 64);
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 SkBitmap fGradientCircle; 157 SkBitmap fGradientCircle;
158 typedef GM INHERITED; 158 typedef GM INHERITED;
159 }; 159 };
160 160
161 ////////////////////////////////////////////////////////////////////////////// 161 //////////////////////////////////////////////////////////////////////////////
162 162
163 static GM* MyFactory(void*) { return new ImageFiltersScaledGM; } 163 static GM* MyFactory(void*) { return new ImageFiltersScaledGM; }
164 static GMRegistry reg(MyFactory); 164 static GMRegistry reg(MyFactory);
165 165
166 } 166 }
OLDNEW
« no previous file with comments | « gm/imagefiltersgraph.cpp ('k') | gm/imagefilterstransformed.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698