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

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

Issue 388103002: Make GrAtlas::removePlot static (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/GrAtlas.cpp ('k') | no next file » | 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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 } 271 }
272 272
273 void GrTextStrike::removePlot(const GrPlot* plot) { 273 void GrTextStrike::removePlot(const GrPlot* plot) {
274 SkTDArray<GrGlyph*>& glyphArray = fCache.getArray(); 274 SkTDArray<GrGlyph*>& glyphArray = fCache.getArray();
275 for (int i = 0; i < glyphArray.count(); ++i) { 275 for (int i = 0; i < glyphArray.count(); ++i) {
276 if (plot == glyphArray[i]->fPlot) { 276 if (plot == glyphArray[i]->fPlot) {
277 glyphArray[i]->fPlot = NULL; 277 glyphArray[i]->fPlot = NULL;
278 } 278 }
279 } 279 }
280 280
281 fAtlas->removePlot(&fPlotUsage, plot); 281 GrAtlas::RemovePlot(&fPlotUsage, plot);
282 } 282 }
283 283
284 284
285 bool GrTextStrike::addGlyphToAtlas(GrGlyph* glyph, GrFontScaler* scaler) { 285 bool GrTextStrike::addGlyphToAtlas(GrGlyph* glyph, GrFontScaler* scaler) {
286 #if 0 // testing hack to force us to flush our cache often 286 #if 0 // testing hack to force us to flush our cache often
287 static int gCounter; 287 static int gCounter;
288 if ((++gCounter % 10) == 0) return false; 288 if ((++gCounter % 10) == 0) return false;
289 #endif 289 #endif
290 290
291 SkASSERT(glyph); 291 SkASSERT(glyph);
(...skipping 26 matching lines...) Expand all
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/GrAtlas.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698