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

Side by Side Diff: gm/colortype.cpp

Issue 1316123003: Style Change: SkNEW->new; SkDELETE->delete (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-26 (Wednesday) 15:59:00 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/colorfilters.cpp ('k') | gm/colortypexfermode.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 "SkGradientShader.h" 10 #include "SkGradientShader.h"
(...skipping 22 matching lines...) Expand all
33 33
34 SkPaint paint; 34 SkPaint paint;
35 paint.setAntiAlias(true); 35 paint.setAntiAlias(true);
36 paint.setShader(s)->unref(); 36 paint.setShader(s)->unref();
37 37
38 SkTypeface* orig = sk_tool_utils::create_portable_typeface("serif", 38 SkTypeface* orig = sk_tool_utils::create_portable_typeface("serif",
39 SkTypeface::kBold); 39 SkTypeface::kBold);
40 if (NULL == orig) { 40 if (NULL == orig) {
41 orig = SkTypeface::RefDefault(); 41 orig = SkTypeface::RefDefault();
42 } 42 }
43 fColorType = SkNEW_ARGS(SkGTypeface, (orig, paint)); 43 fColorType = new SkGTypeface(orig, paint);
44 orig->unref(); 44 orig->unref();
45 } 45 }
46 46
47 SkString onShortName() override { 47 SkString onShortName() override {
48 return SkString("colortype"); 48 return SkString("colortype");
49 } 49 }
50 50
51 SkISize onISize() override { 51 SkISize onISize() override {
52 return SkISize::Make(640, 480); 52 return SkISize::Make(640, 480);
53 } 53 }
54 54
55 void onDraw(SkCanvas* canvas) override { 55 void onDraw(SkCanvas* canvas) override {
56 SkPaint paint; 56 SkPaint paint;
57 paint.setAntiAlias(true); 57 paint.setAntiAlias(true);
58 paint.setTypeface(fColorType); 58 paint.setTypeface(fColorType);
59 59
60 for (SkScalar size = 10; size <= 100; size += 10) { 60 for (SkScalar size = 10; size <= 100; size += 10) {
61 paint.setTextSize(size); 61 paint.setTextSize(size);
62 canvas->translate(0, paint.getFontMetrics(NULL)); 62 canvas->translate(0, paint.getFontMetrics(NULL));
63 canvas->drawText("Hamburgefons", 12, 10, 10, paint); 63 canvas->drawText("Hamburgefons", 12, 10, 10, paint);
64 } 64 }
65 } 65 }
66 66
67 private: 67 private:
68 SkTypeface* fColorType; 68 SkTypeface* fColorType;
69 69
70 typedef skiagm::GM INHERITED; 70 typedef skiagm::GM INHERITED;
71 }; 71 };
72 72
73 DEF_GM( return SkNEW(ColorTypeGM); ) 73 DEF_GM(return new ColorTypeGM;)
OLDNEW
« no previous file with comments | « gm/colorfilters.cpp ('k') | gm/colortypexfermode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698