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

Side by Side Diff: tests/MipMapTest.cpp

Issue 1750303002: Adding anisotropic mipmap levels to SkMipMap. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Changing width >>= 1; width = SkTMax(1, width); to width = SkTMax(1, width >> 1); Created 4 years, 9 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 {-100, -100, 0}, 118 {-100, -100, 0},
119 119
120 // Test mipmaps with 0, 1, 2 as dimensions 120 // Test mipmaps with 0, 1, 2 as dimensions
121 // (SkMipMap::Build requires a min size of 2) 121 // (SkMipMap::Build requires a min size of 2)
122 // 122 //
123 // 0 123 // 0
124 {0, 100, 0}, 124 {0, 100, 0},
125 {100, 0, 0}, 125 {100, 0, 0},
126 {0, 0, 0}, 126 {0, 0, 0},
127 // 1 127 // 1
128 {1, 100, 0}, 128 {1, 100, 6},
129 {100, 1, 0}, 129 {100, 1, 6},
130 {1, 1, 0}, 130 {1, 1, 0},
131 // 2 131 // 2
132 {2, 100, 1}, 132 {2, 100, 6},
133 {100, 2, 1}, 133 {100, 2, 6},
134 {2, 2, 1}, 134 {2, 2, 1},
135 135
136 // Test a handful of boundaries such as 63x63 and 64x64 136 // Test a handful of boundaries such as 63x63 and 64x64
137 {63, 63, 5}, 137 {63, 63, 5},
138 {64, 64, 6}, 138 {64, 64, 6},
139 {127, 127, 6}, 139 {127, 127, 6},
140 {128, 128, 7}, 140 {128, 128, 7},
141 {255, 255, 7}, 141 {255, 255, 7},
142 {256, 256, 8}, 142 {256, 256, 8},
143 143
144 // Test different dimensions, such as 256x64 144 // Test different dimensions, such as 256x64
145 {64, 129, 6}, 145 {64, 129, 7},
146 {255, 32, 5}, 146 {255, 32, 7},
147 {500, 1000, 8} 147 {500, 1000, 9}
148 }; 148 };
149 149
150 for (auto& currentTest : tests) { 150 for (auto& currentTest : tests) {
151 int levelCount = SkMipMap::ComputeLevelCount(currentTest.fWidth, current Test.fHeight); 151 int levelCount = SkMipMap::ComputeLevelCount(currentTest.fWidth, current Test.fHeight);
152 REPORTER_ASSERT(reporter, currentTest.fExpectedLevelCount == levelCount) ; 152 REPORTER_ASSERT(reporter, currentTest.fExpectedLevelCount == levelCount) ;
153 } 153 }
154 } 154 }
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