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

Side by Side Diff: gm/fontcache.cpp

Issue 26675004: Give the new font cache GM a name (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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"
(...skipping 30 matching lines...) Expand all
41 } 41 }
42 42
43 virtual ~FontCacheGM() { 43 virtual ~FontCacheGM() {
44 for (size_t i = 0; i < TYPEFACE_COUNT; ++i) { 44 for (size_t i = 0; i < TYPEFACE_COUNT; ++i) {
45 SkSafeUnref(fTypefaces[i]); 45 SkSafeUnref(fTypefaces[i]);
46 } 46 }
47 } 47 }
48 48
49 protected: 49 protected:
50 virtual SkString onShortName() SK_OVERRIDE { 50 virtual SkString onShortName() SK_OVERRIDE {
51 return fName; 51 return SkString("fontcache");
52 } 52 }
53 53
54 virtual SkISize onISize() SK_OVERRIDE { 54 virtual SkISize onISize() SK_OVERRIDE {
55 return SkISize::Make(640, 320); 55 return SkISize::Make(640, 320);
56 } 56 }
57 57
58 virtual void onOnceBeforeDraw() SK_OVERRIDE { 58 virtual void onOnceBeforeDraw() SK_OVERRIDE {
59 int typefaceCount = 0; 59 int typefaceCount = 0;
60 for (size_t i = 0; i < SK_ARRAY_COUNT(gFamilyNames); ++i) { 60 for (size_t i = 0; i < SK_ARRAY_COUNT(gFamilyNames); ++i) {
61 for (size_t j = 0; j < SK_ARRAY_COUNT(gStyles); ++j) { 61 for (size_t j = 0; j < SK_ARRAY_COUNT(gStyles); ++j) {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 103
104 } 104 }
105 105
106 virtual uint32_t onGetFlags() const SK_OVERRIDE { 106 virtual uint32_t onGetFlags() const SK_OVERRIDE {
107 // this GM is meant only for the GPU 107 // this GM is meant only for the GPU
108 return kGPUOnly_Flag; 108 return kGPUOnly_Flag;
109 } 109 }
110 110
111 private: 111 private:
112 SkTypeface* fTypefaces[TYPEFACE_COUNT]; 112 SkTypeface* fTypefaces[TYPEFACE_COUNT];
113 SkString fName;
114 typedef GM INHERITED; 113 typedef GM INHERITED;
115 }; 114 };
116 115
117 116
118 ////////////////////////////////////////////////////////////////////////////// 117 //////////////////////////////////////////////////////////////////////////////
119 118
120 DEF_GM( return SkNEW(FontCacheGM); ) 119 DEF_GM( return SkNEW(FontCacheGM); )
121 120
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698