| 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 "GrTextStrike.h" | 10 #include "GrTextStrike.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 } | 75 } |
| 76 | 76 |
| 77 GrTextStrike* GrFontCache::generateStrike(GrFontScaler* scaler, | 77 GrTextStrike* GrFontCache::generateStrike(GrFontScaler* scaler, |
| 78 const Key& key) { | 78 const Key& key) { |
| 79 GrMaskFormat format = scaler->getMaskFormat(); | 79 GrMaskFormat format = scaler->getMaskFormat(); |
| 80 GrPixelConfig config = mask_format_to_pixel_config(format); | 80 GrPixelConfig config = mask_format_to_pixel_config(format); |
| 81 int atlasIndex = mask_format_to_atlas_index(format); | 81 int atlasIndex = mask_format_to_atlas_index(format); |
| 82 if (NULL == fAtlases[atlasIndex]) { | 82 if (NULL == fAtlases[atlasIndex]) { |
| 83 SkISize textureSize = SkISize::Make(GR_ATLAS_TEXTURE_WIDTH, | 83 SkISize textureSize = SkISize::Make(GR_ATLAS_TEXTURE_WIDTH, |
| 84 GR_ATLAS_TEXTURE_HEIGHT); | 84 GR_ATLAS_TEXTURE_HEIGHT); |
| 85 fAtlases[atlasIndex] = SkNEW_ARGS(GrAtlas, (fGpu, config, | 85 fAtlases[atlasIndex] = SkNEW_ARGS(GrAtlas, (fGpu, config, kNone_GrTextur
eFlags, |
| 86 textureSize, | 86 textureSize, |
| 87 GR_NUM_PLOTS_X, | 87 GR_NUM_PLOTS_X, |
| 88 GR_NUM_PLOTS_Y, | 88 GR_NUM_PLOTS_Y, |
| 89 true)); | 89 true)); |
| 90 } | 90 } |
| 91 GrTextStrike* strike = SkNEW_ARGS(GrTextStrike, | 91 GrTextStrike* strike = SkNEW_ARGS(GrTextStrike, |
| 92 (this, scaler->getKey(), format, fAtlases[
atlasIndex])); | 92 (this, scaler->getKey(), format, fAtlases[
atlasIndex])); |
| 93 fCache.insert(key, strike); | 93 fCache.insert(key, strike); |
| 94 | 94 |
| 95 if (fHead) { | 95 if (fHead) { |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 glyph->height(), storage.get(), | 318 glyph->height(), storage.get(), |
| 319 &glyph->fAtlasLocation); | 319 &glyph->fAtlasLocation); |
| 320 | 320 |
| 321 if (NULL == plot) { | 321 if (NULL == plot) { |
| 322 return false; | 322 return false; |
| 323 } | 323 } |
| 324 | 324 |
| 325 glyph->fPlot = plot; | 325 glyph->fPlot = plot; |
| 326 return true; | 326 return true; |
| 327 } | 327 } |
| OLD | NEW |