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

Side by Side Diff: gm/blurs.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/blurrect.cpp ('k') | gm/colorcube.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 2011 Google Inc. 2 * Copyright 2011 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 "SkBlurMask.h" 9 #include "SkBlurMask.h"
10 #include "SkBlurMaskFilter.h" 10 #include "SkBlurMaskFilter.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 for (int j = 0; j < 2; j++) { 49 for (int j = 0; j < 2; j++) {
50 canvas->save(); 50 canvas->save();
51 paint.setColor(SK_ColorBLUE); 51 paint.setColor(SK_ColorBLUE);
52 for (size_t i = 0; i < SK_ARRAY_COUNT(gRecs); i++) { 52 for (size_t i = 0; i < SK_ARRAY_COUNT(gRecs); i++) {
53 if (gRecs[i].fStyle != NONE) { 53 if (gRecs[i].fStyle != NONE) {
54 SkMaskFilter* mf = SkBlurMaskFilter::Create(gRecs[i].fStyle, 54 SkMaskFilter* mf = SkBlurMaskFilter::Create(gRecs[i].fStyle,
55 SkBlurMask::ConvertRadiusToSigma(SkIn tToScalar(20)), 55 SkBlurMask::ConvertRadiusToSigma(SkIn tToScalar(20)),
56 flags); 56 flags);
57 paint.setMaskFilter(mf)->unref(); 57 paint.setMaskFilter(mf)->unref();
58 } else { 58 } else {
59 paint.setMaskFilter(NULL); 59 paint.setMaskFilter(nullptr);
60 } 60 }
61 canvas->drawCircle(SkIntToScalar(200 + gRecs[i].fCx*100), 61 canvas->drawCircle(SkIntToScalar(200 + gRecs[i].fCx*100),
62 SkIntToScalar(200 + gRecs[i].fCy*100), 62 SkIntToScalar(200 + gRecs[i].fCy*100),
63 SkIntToScalar(50), 63 SkIntToScalar(50),
64 paint); 64 paint);
65 } 65 }
66 // draw text 66 // draw text
67 { 67 {
68 SkMaskFilter* mf = SkBlurMaskFilter::Create(kNormal_SkBlurStyle, 68 SkMaskFilter* mf = SkBlurMaskFilter::Create(kNormal_SkBlurStyle,
69 SkBlurMask::ConvertRadiusToSigma(SkIn tToScalar(4)), 69 SkBlurMask::ConvertRadiusToSigma(SkIn tToScalar(4)),
70 flags); 70 flags);
71 paint.setMaskFilter(mf)->unref(); 71 paint.setMaskFilter(mf)->unref();
72 SkScalar x = SkIntToScalar(70); 72 SkScalar x = SkIntToScalar(70);
73 SkScalar y = SkIntToScalar(400); 73 SkScalar y = SkIntToScalar(400);
74 paint.setColor(SK_ColorBLACK); 74 paint.setColor(SK_ColorBLACK);
75 canvas->drawText("Hamburgefons Style", 18, x, y, paint); 75 canvas->drawText("Hamburgefons Style", 18, x, y, paint);
76 canvas->drawText("Hamburgefons Style", 18, 76 canvas->drawText("Hamburgefons Style", 18,
77 x, y + SkIntToScalar(50), paint); 77 x, y + SkIntToScalar(50), paint);
78 paint.setMaskFilter(NULL); 78 paint.setMaskFilter(nullptr);
79 paint.setColor(SK_ColorWHITE); 79 paint.setColor(SK_ColorWHITE);
80 x -= SkIntToScalar(2); 80 x -= SkIntToScalar(2);
81 y -= SkIntToScalar(2); 81 y -= SkIntToScalar(2);
82 canvas->drawText("Hamburgefons Style", 18, x, y, paint); 82 canvas->drawText("Hamburgefons Style", 18, x, y, paint);
83 } 83 }
84 canvas->restore(); 84 canvas->restore();
85 flags = SkBlurMaskFilter::kHighQuality_BlurFlag; 85 flags = SkBlurMaskFilter::kHighQuality_BlurFlag;
86 canvas->translate(SkIntToScalar(350), SkIntToScalar(0)); 86 canvas->translate(SkIntToScalar(350), SkIntToScalar(0));
87 } 87 }
88 } 88 }
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 canvas->translate(dx, 0); 158 canvas->translate(dx, 0);
159 canvas->drawPath(path, paint); 159 canvas->drawPath(path, paint);
160 160
161 // Translate to outside of clip bounds. 161 // Translate to outside of clip bounds.
162 canvas->translate(-dx, 0); 162 canvas->translate(-dx, 0);
163 canvas->translate(-30, -150); 163 canvas->translate(-30, -150);
164 canvas->drawPath(path, paint); 164 canvas->drawPath(path, paint);
165 } 165 }
166 }; 166 };
167 DEF_GM( return new Blur2RectsNonNinePatchGM; ) 167 DEF_GM( return new Blur2RectsNonNinePatchGM; )
OLDNEW
« no previous file with comments | « gm/blurrect.cpp ('k') | gm/colorcube.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698