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

Side by Side Diff: tests/MipMapTest.cpp

Issue 1598803002: use pixmaps in mipmap api (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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/SkMipMap.cpp ('k') | no next file » | 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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkMipMap.h" 9 #include "SkMipMap.h"
10 #include "SkRandom.h" 10 #include "SkRandom.h"
(...skipping 21 matching lines...) Expand all
32 32
33 SkMipMap::Level prevLevel; 33 SkMipMap::Level prevLevel;
34 sk_bzero(&prevLevel, sizeof(prevLevel)); 34 sk_bzero(&prevLevel, sizeof(prevLevel));
35 35
36 SkScalar scale = SK_Scalar1; 36 SkScalar scale = SK_Scalar1;
37 for (int j = 0; j < 30; ++j) { 37 for (int j = 0; j < 30; ++j) {
38 scale = scale * 2 / 3; 38 scale = scale * 2 / 3;
39 39
40 SkMipMap::Level level; 40 SkMipMap::Level level;
41 if (mm->extractLevel(scale, &level)) { 41 if (mm->extractLevel(scale, &level)) {
42 REPORTER_ASSERT(reporter, level.fPixels); 42 REPORTER_ASSERT(reporter, level.fPixmap.addr());
43 REPORTER_ASSERT(reporter, level.fWidth > 0); 43 REPORTER_ASSERT(reporter, level.fPixmap.width() > 0);
44 REPORTER_ASSERT(reporter, level.fHeight > 0); 44 REPORTER_ASSERT(reporter, level.fPixmap.height() > 0);
45 REPORTER_ASSERT(reporter, level.fRowBytes >= level.fWidth * 4); 45 REPORTER_ASSERT(reporter, (int)level.fPixmap.rowBytes() >= level .fPixmap.width() * 4);
46 46
47 if (prevLevel.fPixels) { 47 if (prevLevel.fPixmap.addr()) {
48 REPORTER_ASSERT(reporter, level.fWidth <= prevLevel.fWidth); 48 REPORTER_ASSERT(reporter, level.fPixmap.width() <= prevLevel .fPixmap.width());
49 REPORTER_ASSERT(reporter, level.fHeight <= prevLevel.fHeight ); 49 REPORTER_ASSERT(reporter, level.fPixmap.height() <= prevLeve l.fPixmap.height());
50 } 50 }
51 prevLevel = level; 51 prevLevel = level;
52 } 52 }
53 } 53 }
54 } 54 }
55 } 55 }
OLDNEW
« no previous file with comments | « src/core/SkMipMap.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698