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 "GrAtlas.h" | |
9 #include "GrGpu.h" | 8 #include "GrGpu.h" |
10 #include "GrRectanizer.h" | 9 #include "GrRectanizer.h" |
11 #include "GrTextStrike.h" | 10 #include "GrTextStrike.h" |
12 #include "GrTextStrike_impl.h" | 11 #include "GrTextStrike_impl.h" |
13 #include "SkString.h" | 12 #include "SkString.h" |
14 | 13 |
15 #include "SkDistanceFieldGen.h" | 14 #include "SkDistanceFieldGen.h" |
16 | 15 |
17 /////////////////////////////////////////////////////////////////////////////// | 16 /////////////////////////////////////////////////////////////////////////////// |
18 | 17 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 const Key& key) { | 78 const Key& key) { |
80 GrMaskFormat format = scaler->getMaskFormat(); | 79 GrMaskFormat format = scaler->getMaskFormat(); |
81 GrPixelConfig config = mask_format_to_pixel_config(format); | 80 GrPixelConfig config = mask_format_to_pixel_config(format); |
82 int atlasIndex = mask_format_to_atlas_index(format); | 81 int atlasIndex = mask_format_to_atlas_index(format); |
83 if (NULL == fAtlasMgr[atlasIndex]) { | 82 if (NULL == fAtlasMgr[atlasIndex]) { |
84 SkISize textureSize = SkISize::Make(GR_ATLAS_TEXTURE_WIDTH, | 83 SkISize textureSize = SkISize::Make(GR_ATLAS_TEXTURE_WIDTH, |
85 GR_ATLAS_TEXTURE_HEIGHT); | 84 GR_ATLAS_TEXTURE_HEIGHT); |
86 fAtlasMgr[atlasIndex] = SkNEW_ARGS(GrAtlasMgr, (fGpu, config, | 85 fAtlasMgr[atlasIndex] = SkNEW_ARGS(GrAtlasMgr, (fGpu, config, |
87 textureSize, | 86 textureSize, |
88 GR_NUM_PLOTS_X, | 87 GR_NUM_PLOTS_X, |
89 GR_NUM_PLOTS_Y)); | 88 GR_NUM_PLOTS_Y, |
| 89 true)); |
90 } | 90 } |
91 GrTextStrike* strike = SkNEW_ARGS(GrTextStrike, | 91 GrTextStrike* strike = SkNEW_ARGS(GrTextStrike, |
92 (this, scaler->getKey(), format, fAtlasMgr
[atlasIndex])); | 92 (this, scaler->getKey(), format, fAtlasMgr
[atlasIndex])); |
93 fCache.insert(key, strike); | 93 fCache.insert(key, strike); |
94 | 94 |
95 if (fHead) { | 95 if (fHead) { |
96 fHead->fPrev = strike; | 96 fHead->fPrev = strike; |
97 } else { | 97 } else { |
98 SkASSERT(NULL == fTail); | 98 SkASSERT(NULL == fTail); |
99 fTail = strike; | 99 fTail = strike; |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 glyph->height(), storage.get(), | 320 glyph->height(), storage.get(), |
321 &glyph->fAtlasLocation); | 321 &glyph->fAtlasLocation); |
322 | 322 |
323 if (NULL == plot) { | 323 if (NULL == plot) { |
324 return false; | 324 return false; |
325 } | 325 } |
326 | 326 |
327 glyph->fPlot = plot; | 327 glyph->fPlot = plot; |
328 return true; | 328 return true; |
329 } | 329 } |
OLD | NEW |