OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 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 "GrFontCache.h" | 8 #include "GrFontCache.h" |
9 #include "GrGpu.h" | 9 #include "GrGpu.h" |
10 #include "GrRectanizer.h" | 10 #include "GrRectanizer.h" |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 #endif | 219 #endif |
220 | 220 |
221 /* | 221 /* |
222 The text strike is specific to a given font/style/matrix setup, which is | 222 The text strike is specific to a given font/style/matrix setup, which is |
223 represented by the GrHostFontScaler object we are given in getGlyph(). | 223 represented by the GrHostFontScaler object we are given in getGlyph(). |
224 | 224 |
225 We map a 32bit glyphID to a GrGlyph record, which in turn points to a | 225 We map a 32bit glyphID to a GrGlyph record, which in turn points to a |
226 atlas and a position within that texture. | 226 atlas and a position within that texture. |
227 */ | 227 */ |
228 | 228 |
229 GrTextStrike::GrTextStrike(GrFontCache* cache, const GrFontDescKey* key) { | 229 GrTextStrike::GrTextStrike(GrFontCache* cache, const GrFontDescKey* key) |
| 230 : fPool(9/*start allocations at 512 bytes*/) { |
230 fFontScalerKey = key; | 231 fFontScalerKey = key; |
231 fFontScalerKey->ref(); | 232 fFontScalerKey->ref(); |
232 | 233 |
233 fFontCache = cache; // no need to ref, it won't go away before we do | 234 fFontCache = cache; // no need to ref, it won't go away before we do |
234 | 235 |
235 #ifdef SK_DEBUG | 236 #ifdef SK_DEBUG |
236 // SkDebugf(" GrTextStrike %p %d\n", this, gCounter); | 237 // SkDebugf(" GrTextStrike %p %d\n", this, gCounter); |
237 gCounter += 1; | 238 gCounter += 1; |
238 #endif | 239 #endif |
239 } | 240 } |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 glyph->width(), glyph->height(), | 336 glyph->width(), glyph->height(), |
336 storage.get(), &glyph->fAtlasLocation)
; | 337 storage.get(), &glyph->fAtlasLocation)
; |
337 | 338 |
338 if (NULL == plot) { | 339 if (NULL == plot) { |
339 return false; | 340 return false; |
340 } | 341 } |
341 | 342 |
342 glyph->fPlot = plot; | 343 glyph->fPlot = plot; |
343 return true; | 344 return true; |
344 } | 345 } |
OLD | NEW |