| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include "GrAtlas.h" | 9 #include "GrAtlas.h" |
| 10 #include "GrContext.h" | 10 #include "GrContext.h" |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 // before we get a new plot, make sure we have a backing texture | 219 // before we get a new plot, make sure we have a backing texture |
| 220 if (NULL == fTexture) { | 220 if (NULL == fTexture) { |
| 221 // TODO: Update this to use the cache rather than directly creating a te
xture. | 221 // TODO: Update this to use the cache rather than directly creating a te
xture. |
| 222 GrSurfaceDesc desc; | 222 GrSurfaceDesc desc; |
| 223 desc.fFlags = fFlags; | 223 desc.fFlags = fFlags; |
| 224 desc.fWidth = fBackingTextureSize.width(); | 224 desc.fWidth = fBackingTextureSize.width(); |
| 225 desc.fHeight = fBackingTextureSize.height(); | 225 desc.fHeight = fBackingTextureSize.height(); |
| 226 desc.fConfig = fPixelConfig; | 226 desc.fConfig = fPixelConfig; |
| 227 | 227 |
| 228 fTexture = fGpu->createTexture(desc, true, NULL, 0); | 228 fTexture = fGpu->createTexture(desc, true, NULL, 0); |
| 229 | |
| 230 if (NULL == fTexture) { | 229 if (NULL == fTexture) { |
| 231 return NULL; | 230 return NULL; |
| 232 } | 231 } |
| 233 } | 232 } |
| 234 | 233 |
| 235 // now look through all allocated plots for one we can share, in MRU order | 234 // now look through all allocated plots for one we can share, in MRU order |
| 236 GrPlotList::Iter plotIter; | 235 GrPlotList::Iter plotIter; |
| 237 plotIter.init(fPlotList, GrPlotList::Iter::kHead_IterStart); | 236 plotIter.init(fPlotList, GrPlotList::Iter::kHead_IterStart); |
| 238 GrPlot* plot; | 237 GrPlot* plot; |
| 239 while ((plot = plotIter.get())) { | 238 while ((plot = plotIter.get())) { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 if (fBatchUploads) { | 278 if (fBatchUploads) { |
| 280 GrPlotList::Iter plotIter; | 279 GrPlotList::Iter plotIter; |
| 281 plotIter.init(fPlotList, GrPlotList::Iter::kHead_IterStart); | 280 plotIter.init(fPlotList, GrPlotList::Iter::kHead_IterStart); |
| 282 GrPlot* plot; | 281 GrPlot* plot; |
| 283 while ((plot = plotIter.get())) { | 282 while ((plot = plotIter.get())) { |
| 284 plot->uploadToTexture(); | 283 plot->uploadToTexture(); |
| 285 plotIter.next(); | 284 plotIter.next(); |
| 286 } | 285 } |
| 287 } | 286 } |
| 288 } | 287 } |
| OLD | NEW |