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

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

Issue 304743004: Move ETC1 and LATC enums value to GrPixelConfig (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Only generate mipmaps for uncompressed textures. Created 6 years, 6 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 | « include/gpu/GrTypes.h ('k') | src/gpu/GrContext.cpp » ('j') | 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 /* 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 156
157 int textureWidth = fBackingTextureSize.width(); 157 int textureWidth = fBackingTextureSize.width();
158 int textureHeight = fBackingTextureSize.height(); 158 int textureHeight = fBackingTextureSize.height();
159 159
160 int plotWidth = textureWidth / fNumPlotsX; 160 int plotWidth = textureWidth / fNumPlotsX;
161 int plotHeight = textureHeight / fNumPlotsY; 161 int plotHeight = textureHeight / fNumPlotsY;
162 162
163 SkASSERT(plotWidth * fNumPlotsX == textureWidth); 163 SkASSERT(plotWidth * fNumPlotsX == textureWidth);
164 SkASSERT(plotHeight * fNumPlotsY == textureHeight); 164 SkASSERT(plotHeight * fNumPlotsY == textureHeight);
165 165
166 // We currently do not support compressed atlases...
167 SkASSERT(!GrPixelConfigIsCompressed(config));
168
166 // set up allocated plots 169 // set up allocated plots
167 size_t bpp = GrBytesPerPixel(fPixelConfig); 170 size_t bpp = GrBytesPerPixel(fPixelConfig);
168 fPlotArray = SkNEW_ARRAY(GrPlot, (fNumPlotsX*fNumPlotsY)); 171 fPlotArray = SkNEW_ARRAY(GrPlot, (fNumPlotsX*fNumPlotsY));
169 172
170 GrPlot* currPlot = fPlotArray; 173 GrPlot* currPlot = fPlotArray;
171 for (int y = numPlotsY-1; y >= 0; --y) { 174 for (int y = numPlotsY-1; y >= 0; --y) {
172 for (int x = numPlotsX-1; x >= 0; --x) { 175 for (int x = numPlotsX-1; x >= 0; --x) {
173 currPlot->init(this, x, y, plotWidth, plotHeight, bpp, batchUploads) ; 176 currPlot->init(this, x, y, plotWidth, plotHeight, bpp, batchUploads) ;
174 177
175 // build LRU list 178 // build LRU list
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 if (fBatchUploads) { 281 if (fBatchUploads) {
279 GrPlotList::Iter plotIter; 282 GrPlotList::Iter plotIter;
280 plotIter.init(fPlotList, GrPlotList::Iter::kHead_IterStart); 283 plotIter.init(fPlotList, GrPlotList::Iter::kHead_IterStart);
281 GrPlot* plot; 284 GrPlot* plot;
282 while (NULL != (plot = plotIter.get())) { 285 while (NULL != (plot = plotIter.get())) {
283 plot->uploadToTexture(); 286 plot->uploadToTexture();
284 plotIter.next(); 287 plotIter.next();
285 } 288 }
286 } 289 }
287 } 290 }
OLDNEW
« no previous file with comments | « include/gpu/GrTypes.h ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698