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 "GrAtlas.h" | 8 #include "GrAtlas.h" |
9 #include "GrGpu.h" | 9 #include "GrGpu.h" |
10 #include "GrRectanizer.h" | 10 #include "GrRectanizer.h" |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 while (strike) { | 166 while (strike) { |
167 count2 += 1; | 167 count2 += 1; |
168 strike = strike->fPrev; | 168 strike = strike->fPrev; |
169 } | 169 } |
170 SkASSERT(count == count2); | 170 SkASSERT(count == count2); |
171 } | 171 } |
172 #endif | 172 #endif |
173 | 173 |
174 #ifdef SK_DEVELOPER | 174 #ifdef SK_DEVELOPER |
175 void GrFontCache::dump() const { | 175 void GrFontCache::dump() const { |
176 /* Disabled for now | |
177 static int gDumpCount = 0; | 176 static int gDumpCount = 0; |
178 for (int i = 0; i < kMaskFormatCount; ++i) { | 177 for (int i = 0; i < kMaskFormatCount; ++i) { |
179 if (NULL != fAtlasMgr[i]) { | 178 if (NULL != fAtlasMgr[i]) { |
180 GrTexture* texture = fAtlasMgr[i]->getTexture(); | 179 GrTexture* texture = fAtlasMgr[i]->getTexture(); |
181 if (NULL != texture) { | 180 if (NULL != texture) { |
182 SkString filename; | 181 SkString filename; |
183 filename.printf("fontcache_%d%d.png", gDumpCount, i); | 182 filename.printf("fontcache_%d%d.png", gDumpCount, i); |
184 texture->savePixels(filename.c_str()); | 183 texture->savePixels(filename.c_str()); |
185 } | 184 } |
186 } | 185 } |
187 } | 186 } |
188 ++gDumpCount; | 187 ++gDumpCount; |
189 */ | |
190 } | 188 } |
191 #endif | 189 #endif |
192 | 190 |
193 /////////////////////////////////////////////////////////////////////////////// | 191 /////////////////////////////////////////////////////////////////////////////// |
194 | 192 |
195 #ifdef SK_DEBUG | 193 #ifdef SK_DEBUG |
196 static int gCounter; | 194 static int gCounter; |
197 #endif | 195 #endif |
198 | 196 |
199 /* | 197 /* |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 GrPlot* plot = fAtlasMgr->addToAtlas(&fAtlas, glyph->width(), | 283 GrPlot* plot = fAtlasMgr->addToAtlas(&fAtlas, glyph->width(), |
286 glyph->height(), storage.get(), | 284 glyph->height(), storage.get(), |
287 &glyph->fAtlasLocation); | 285 &glyph->fAtlasLocation); |
288 if (NULL == plot) { | 286 if (NULL == plot) { |
289 return false; | 287 return false; |
290 } | 288 } |
291 | 289 |
292 glyph->fPlot = plot; | 290 glyph->fPlot = plot; |
293 return true; | 291 return true; |
294 } | 292 } |
OLD | NEW |