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 "GrGpu.h" | 8 #include "GrGpu.h" |
9 #include "GrRectanizer.h" | 9 #include "GrRectanizer.h" |
10 #include "GrSurfacePriv.h" | 10 #include "GrSurfacePriv.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 fGpu->unref(); | 51 fGpu->unref(); |
52 #if FONT_CACHE_STATS | 52 #if FONT_CACHE_STATS |
53 SkDebugf("Num purges: %d\n", g_PurgeCount); | 53 SkDebugf("Num purges: %d\n", g_PurgeCount); |
54 #endif | 54 #endif |
55 } | 55 } |
56 | 56 |
57 static GrPixelConfig mask_format_to_pixel_config(GrMaskFormat format) { | 57 static GrPixelConfig mask_format_to_pixel_config(GrMaskFormat format) { |
58 static const GrPixelConfig sPixelConfigs[] = { | 58 static const GrPixelConfig sPixelConfigs[] = { |
59 kAlpha_8_GrPixelConfig, | 59 kAlpha_8_GrPixelConfig, |
60 kRGB_565_GrPixelConfig, | 60 kRGB_565_GrPixelConfig, |
61 kSkia8888_GrPixelConfig, | |
62 kSkia8888_GrPixelConfig | 61 kSkia8888_GrPixelConfig |
63 }; | 62 }; |
64 SK_COMPILE_ASSERT(SK_ARRAY_COUNT(sPixelConfigs) == kMaskFormatCount, array_s
ize_mismatch); | 63 SK_COMPILE_ASSERT(SK_ARRAY_COUNT(sPixelConfigs) == kMaskFormatCount, array_s
ize_mismatch); |
65 | 64 |
66 return sPixelConfigs[format]; | 65 return sPixelConfigs[format]; |
67 } | 66 } |
68 | 67 |
69 static int mask_format_to_atlas_index(GrMaskFormat format) { | 68 static int mask_format_to_atlas_index(GrMaskFormat format) { |
70 static const int sAtlasIndices[] = { | 69 static const int sAtlasIndices[] = { |
71 GrFontCache::kA8_AtlasType, | 70 GrFontCache::kA8_AtlasType, |
72 GrFontCache::k565_AtlasType, | 71 GrFontCache::k565_AtlasType, |
73 GrFontCache::k8888_AtlasType, | |
74 GrFontCache::k8888_AtlasType | 72 GrFontCache::k8888_AtlasType |
75 }; | 73 }; |
76 SK_COMPILE_ASSERT(SK_ARRAY_COUNT(sAtlasIndices) == kMaskFormatCount, array_s
ize_mismatch); | 74 SK_COMPILE_ASSERT(SK_ARRAY_COUNT(sAtlasIndices) == kMaskFormatCount, array_s
ize_mismatch); |
77 | 75 |
78 SkASSERT(sAtlasIndices[format] < GrFontCache::kAtlasCount); | 76 SkASSERT(sAtlasIndices[format] < GrFontCache::kAtlasCount); |
79 return sAtlasIndices[format]; | 77 return sAtlasIndices[format]; |
80 } | 78 } |
81 | 79 |
82 GrTextStrike* GrFontCache::generateStrike(GrFontScaler* scaler) { | 80 GrTextStrike* GrFontCache::generateStrike(GrFontScaler* scaler) { |
83 GrTextStrike* strike = SkNEW_ARGS(GrTextStrike, (this, scaler->getKey())); | 81 GrTextStrike* strike = SkNEW_ARGS(GrTextStrike, (this, scaler->getKey())); |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 glyph->width(), glyph->height(), | 336 glyph->width(), glyph->height(), |
339 storage.get(), &glyph->fAtlasLocation)
; | 337 storage.get(), &glyph->fAtlasLocation)
; |
340 | 338 |
341 if (NULL == plot) { | 339 if (NULL == plot) { |
342 return false; | 340 return false; |
343 } | 341 } |
344 | 342 |
345 glyph->fPlot = plot; | 343 glyph->fPlot = plot; |
346 return true; | 344 return true; |
347 } | 345 } |
OLD | NEW |