| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 119 |
| 120 | 120 |
| 121 GrPlot* GrFontCache::addToAtlas(GrMaskFormat format, GrAtlas::ClientPlotUsage* u
sage, | 121 GrPlot* GrFontCache::addToAtlas(GrMaskFormat format, GrAtlas::ClientPlotUsage* u
sage, |
| 122 int width, int height, const void* image, | 122 int width, int height, const void* image, |
| 123 SkIPoint16* loc) { | 123 SkIPoint16* loc) { |
| 124 GrPixelConfig config = mask_format_to_pixel_config(format); | 124 GrPixelConfig config = mask_format_to_pixel_config(format); |
| 125 int atlasIndex = mask_format_to_atlas_index(format); | 125 int atlasIndex = mask_format_to_atlas_index(format); |
| 126 if (NULL == fAtlases[atlasIndex]) { | 126 if (NULL == fAtlases[atlasIndex]) { |
| 127 SkISize textureSize = SkISize::Make(GR_ATLAS_TEXTURE_WIDTH, | 127 SkISize textureSize = SkISize::Make(GR_ATLAS_TEXTURE_WIDTH, |
| 128 GR_ATLAS_TEXTURE_HEIGHT); | 128 GR_ATLAS_TEXTURE_HEIGHT); |
| 129 fAtlases[atlasIndex] = SkNEW_ARGS(GrAtlas, (fGpu, config, kNone_GrTextur
eFlags, | 129 fAtlases[atlasIndex] = SkNEW_ARGS(GrAtlas, (fGpu, config, kNone_GrSurfac
eFlags, |
| 130 textureSize, | 130 textureSize, |
| 131 GR_NUM_PLOTS_X, | 131 GR_NUM_PLOTS_X, |
| 132 GR_NUM_PLOTS_Y, | 132 GR_NUM_PLOTS_Y, |
| 133 true)); | 133 true)); |
| 134 } | 134 } |
| 135 return fAtlases[atlasIndex]->addToAtlas(usage, width, height, image, loc); | 135 return fAtlases[atlasIndex]->addToAtlas(usage, width, height, image, loc); |
| 136 } | 136 } |
| 137 | 137 |
| 138 | 138 |
| 139 bool GrFontCache::freeUnusedPlot(GrTextStrike* preserveStrike, const GrGlyph* gl
yph) { | 139 bool GrFontCache::freeUnusedPlot(GrTextStrike* preserveStrike, const GrGlyph* gl
yph) { |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 glyph->width(), glyph->height(), | 338 glyph->width(), glyph->height(), |
| 339 storage.get(), &glyph->fAtlasLocation)
; | 339 storage.get(), &glyph->fAtlasLocation)
; |
| 340 | 340 |
| 341 if (NULL == plot) { | 341 if (NULL == plot) { |
| 342 return false; | 342 return false; |
| 343 } | 343 } |
| 344 | 344 |
| 345 glyph->fPlot = plot; | 345 glyph->fPlot = plot; |
| 346 return true; | 346 return true; |
| 347 } | 347 } |
| OLD | NEW |