| 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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 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 |