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

Side by Side Diff: gm/fontcache.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/filterindiabox.cpp ('k') | gm/fontmgr.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 "SkGraphics.h" 10 #include "SkGraphics.h"
11 #include "SkTypeface.h" 11 #include "SkTypeface.h"
12 12
13 // GM to stress the GPU font cache 13 // GM to stress the GPU font cache
14 14
15 static SkScalar draw_string(SkCanvas* canvas, const SkString& text, SkScalar x, 15 static SkScalar draw_string(SkCanvas* canvas, const SkString& text, SkScalar x,
16 SkScalar y, const SkPaint& paint) { 16 SkScalar y, const SkPaint& paint) {
17 canvas->drawText(text.c_str(), text.size(), x, y, paint); 17 canvas->drawText(text.c_str(), text.size(), x, y, paint);
18 return x + paint.measureText(text.c_str(), text.size()); 18 return x + paint.measureText(text.c_str(), text.size());
19 } 19 }
20 20
21 class FontCacheGM : public skiagm::GM { 21 class FontCacheGM : public skiagm::GM {
22 public: 22 public:
23 FontCacheGM() { 23 FontCacheGM() {
24 fTypefaces[0] = NULL; 24 fTypefaces[0] = nullptr;
25 fTypefaces[1] = NULL; 25 fTypefaces[1] = nullptr;
26 } 26 }
27 27
28 virtual ~FontCacheGM() { 28 virtual ~FontCacheGM() {
29 SkSafeUnref(fTypefaces[0]); 29 SkSafeUnref(fTypefaces[0]);
30 SkSafeUnref(fTypefaces[1]); 30 SkSafeUnref(fTypefaces[1]);
31 } 31 }
32 32
33 protected: 33 protected:
34 SkString onShortName() override { 34 SkString onShortName() override {
35 return SkString("fontcache"); 35 return SkString("fontcache");
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 77
78 private: 78 private:
79 SkTypeface* fTypefaces[2]; 79 SkTypeface* fTypefaces[2];
80 typedef GM INHERITED; 80 typedef GM INHERITED;
81 }; 81 };
82 82
83 83
84 ////////////////////////////////////////////////////////////////////////////// 84 //////////////////////////////////////////////////////////////////////////////
85 85
86 DEF_GM(return new FontCacheGM;) 86 DEF_GM(return new FontCacheGM;)
OLDNEW
« no previous file with comments | « gm/filterindiabox.cpp ('k') | gm/fontmgr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698