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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 | 218 |
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, NULL, 0); | 228 fTexture = fGpu->createTexture(desc, true, NULL, 0); |
229 if (NULL == fTexture) { | 229 if (NULL == fTexture) { |
230 return NULL; | 230 return NULL; |
231 } | 231 } |
232 } | 232 } |
233 | 233 |
234 // 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 |
235 GrPlotList::Iter plotIter; | 235 GrPlotList::Iter plotIter; |
236 plotIter.init(fPlotList, GrPlotList::Iter::kHead_IterStart); | 236 plotIter.init(fPlotList, GrPlotList::Iter::kHead_IterStart); |
237 GrPlot* plot; | 237 GrPlot* plot; |
238 while ((plot = plotIter.get())) { | 238 while ((plot = plotIter.get())) { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 if (fBatchUploads) { | 278 if (fBatchUploads) { |
279 GrPlotList::Iter plotIter; | 279 GrPlotList::Iter plotIter; |
280 plotIter.init(fPlotList, GrPlotList::Iter::kHead_IterStart); | 280 plotIter.init(fPlotList, GrPlotList::Iter::kHead_IterStart); |
281 GrPlot* plot; | 281 GrPlot* plot; |
282 while ((plot = plotIter.get())) { | 282 while ((plot = plotIter.get())) { |
283 plot->uploadToTexture(); | 283 plot->uploadToTexture(); |
284 plotIter.next(); | 284 plotIter.next(); |
285 } | 285 } |
286 } | 286 } |
287 } | 287 } |
OLD | NEW |