Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/gpu/GrTextStrike.cpp

Issue 354533004: Begin atlasing (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Readd missing file Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/GrLayerCache.cpp ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « src/gpu/GrLayerCache.cpp ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698