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

Side by Side Diff: gm/textblob.cpp

Issue 806653007: Fix up all the easy virtual ... SK_OVERRIDE cases. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 11 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/texdata.cpp ('k') | gm/textblobshader.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 "gm.h" 8 #include "gm.h"
9 9
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 SkPaint p; 71 SkPaint p;
72 p.setTypeface(fTypeface); 72 p.setTypeface(fTypeface);
73 size_t txtLen = strlen(txt); 73 size_t txtLen = strlen(txt);
74 int glyphCount = p.textToGlyphs(txt, txtLen, NULL); 74 int glyphCount = p.textToGlyphs(txt, txtLen, NULL);
75 75
76 fGlyphs.append(glyphCount); 76 fGlyphs.append(glyphCount);
77 p.textToGlyphs(txt, txtLen, fGlyphs.begin()); 77 p.textToGlyphs(txt, txtLen, fGlyphs.begin());
78 } 78 }
79 79
80 protected: 80 protected:
81 virtual SkString onShortName() SK_OVERRIDE { 81 SkString onShortName() SK_OVERRIDE {
82 return SkString("textblob"); 82 return SkString("textblob");
83 } 83 }
84 84
85 virtual SkISize onISize() SK_OVERRIDE { 85 SkISize onISize() SK_OVERRIDE {
86 return SkISize::Make(640, 480); 86 return SkISize::Make(640, 480);
87 } 87 }
88 88
89 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { 89 void onDraw(SkCanvas* canvas) SK_OVERRIDE {
90 for (unsigned b = 0; b < SK_ARRAY_COUNT(blobConfigs); ++b) { 90 for (unsigned b = 0; b < SK_ARRAY_COUNT(blobConfigs); ++b) {
91 SkAutoTUnref<const SkTextBlob> blob(this->makeBlob(b)); 91 SkAutoTUnref<const SkTextBlob> blob(this->makeBlob(b));
92 92
93 SkPaint p; 93 SkPaint p;
94 SkPoint offset = SkPoint::Make(SkIntToScalar(10 + 300 * (b % 2)), 94 SkPoint offset = SkPoint::Make(SkIntToScalar(10 + 300 * (b % 2)),
95 SkIntToScalar(20 + 150 * (b / 2))); 95 SkIntToScalar(20 + 150 * (b / 2)));
96 96
97 canvas->drawTextBlob(blob, offset.x(), offset.y(), p); 97 canvas->drawTextBlob(blob, offset.x(), offset.y(), p);
98 98
99 p.setColor(SK_ColorBLUE); 99 p.setColor(SK_ColorBLUE);
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 return builder.build(); 176 return builder.build();
177 } 177 }
178 178
179 SkTDArray<uint16_t> fGlyphs; 179 SkTDArray<uint16_t> fGlyphs;
180 SkAutoTUnref<SkTypeface> fTypeface; 180 SkAutoTUnref<SkTypeface> fTypeface;
181 181
182 typedef skiagm::GM INHERITED; 182 typedef skiagm::GM INHERITED;
183 }; 183 };
184 184
185 DEF_GM( return SkNEW_ARGS(TextBlobGM, ("hamburgefons")); ) 185 DEF_GM( return SkNEW_ARGS(TextBlobGM, ("hamburgefons")); )
OLDNEW
« no previous file with comments | « gm/texdata.cpp ('k') | gm/textblobshader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698