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

Side by Side Diff: src/core/SkMipMap.cpp

Issue 1249543003: Creating functions for uploading a mipmapped texture. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Rebasing. Created 4 years, 10 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 | « src/core/SkImageCacherator.cpp ('k') | src/effects/SkBlurMaskFilter.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 * Copyright 2013 Google Inc. 2 * Copyright 2013 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 "SkMipMap.h" 8 #include "SkMipMap.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 proc_3_3 = downsample_3_3<ColorTypeFilter_8>; 226 proc_3_3 = downsample_3_3<ColorTypeFilter_8>;
227 break; 227 break;
228 default: 228 default:
229 // TODO: We could build miplevels for kIndex8 if the levels were in 8888. 229 // TODO: We could build miplevels for kIndex8 if the levels were in 8888.
230 // Means using more ram, but the quality would be fine. 230 // Means using more ram, but the quality would be fine.
231 return nullptr; 231 return nullptr;
232 } 232 }
233 233
234 // whip through our loop to compute the exact size needed 234 // whip through our loop to compute the exact size needed
235 size_t size = 0; 235 size_t size = 0;
236 int countLevels = 0; 236 int countLevels = 0;
237 { 237 {
238 int width = src.width(); 238 int width = src.width();
239 int height = src.height(); 239 int height = src.height();
240 for (;;) { 240 for (;;) {
241 width >>= 1; 241 width >>= 1;
242 height >>= 1; 242 height >>= 1;
243 if (0 == width || 0 == height) { 243 if (0 == width || 0 == height) {
244 break; 244 break;
245 } 245 }
246 size += SkColorTypeMinRowBytes(ct, width) * height; 246 size += SkColorTypeMinRowBytes(ct, width) * height;
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 return false; 435 return false;
436 } 436 }
437 if (index > fCount - 1) { 437 if (index > fCount - 1) {
438 return false; 438 return false;
439 } 439 }
440 if (levelPtr) { 440 if (levelPtr) {
441 *levelPtr = fLevels[index]; 441 *levelPtr = fLevels[index];
442 } 442 }
443 return true; 443 return true;
444 } 444 }
OLDNEW
« no previous file with comments | « src/core/SkImageCacherator.cpp ('k') | src/effects/SkBlurMaskFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698