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

Unified Diff: tests/MipMapTest.cpp

Issue 2036313002: SkMipMap::ComputeLevelSize to return SkISize (Closed) Base URL: https://skia.googlesource.com/skia.git@pipe-mipmap-levels-to-creation
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkMipMap.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/MipMapTest.cpp
diff --git a/tests/MipMapTest.cpp b/tests/MipMapTest.cpp
index 5070d04df67989fa2169c4743829665d300d337c..e8d02b878d9c2650069734eea565e97e3d1caccd 100644
--- a/tests/MipMapTest.cpp
+++ b/tests/MipMapTest.cpp
@@ -155,45 +155,46 @@ struct LevelSizeScenario {
int fBaseWidth;
int fBaseHeight;
int fLevel;
- SkSize fExpectedMipMapLevelSize;
+ SkISize fExpectedMipMapLevelSize;
};
DEF_TEST(MipMap_ComputeLevelSize, reporter) {
const LevelSizeScenario tests[] = {
// Test mipmaps with negative sizes
- {-100, 100, 1, SkSize::Make(0, 0)},
- {100, -100, 1, SkSize::Make(0, 0)},
- {-100, -100, 1, SkSize::Make(0, 0)},
+ {-100, 100, 1, SkISize::Make(0, 0)},
+ {100, -100, 1, SkISize::Make(0, 0)},
+ {-100, -100, 1, SkISize::Make(0, 0)},
// Test mipmaps with 0, 1, 2 as dimensions
// (SkMipMap::Build requires a min size of 1)
//
// 0
- {0, 100, 1, SkSize::Make(0, 0)},
- {100, 0, 1, SkSize::Make(0, 0)},
- {0, 0, 1, SkSize::Make(0, 0)},
+ {0, 100, 1, SkISize::Make(0, 0)},
+ {100, 0, 1, SkISize::Make(0, 0)},
+ {0, 0, 1, SkISize::Make(0, 0)},
// 1
- {1, 100, 1, SkSize::Make(1, 50)},
- {100, 1, 1, SkSize::Make(50, 1)},
- {1, 1, 1, SkSize::Make(0, 0)},
+ {1, 100, 1, SkISize::Make(1, 50)},
+ {100, 1, 1, SkISize::Make(50, 1)},
+ {1, 1, 1, SkISize::Make(0, 0)},
// 2
- {2, 100, 1, SkSize::Make(1, 50)},
- {100, 2, 2, SkSize::Make(25, 1)},
- {2, 2, 1, SkSize::Make(1, 1)},
+ {2, 100, 1, SkISize::Make(1, 50)},
+ {100, 2, 2, SkISize::Make(25, 1)},
+ {2, 2, 1, SkISize::Make(1, 1)},
// Test a handful of cases
- {63, 63, 3, SkSize::Make(7, 7)},
- {64, 64, 3, SkSize::Make(8, 8)},
- {127, 127, 3, SkSize::Make(15, 15)},
- {64, 129, 4, SkSize::Make(4, 8)},
- {255, 32, 7, SkSize::Make(1, 1)},
- {500, 1000, 2, SkSize::Make(125, 250)},
+ {63, 63, 3, SkISize::Make(7, 7)},
+ {64, 64, 3, SkISize::Make(8, 8)},
+ {127, 127, 3, SkISize::Make(15, 15)},
+ {64, 129, 4, SkISize::Make(4, 8)},
+ {255, 32, 7, SkISize::Make(1, 1)},
+ {500, 1000, 2, SkISize::Make(125, 250)},
};
for (auto& currentTest : tests) {
- SkSize levelSize = SkMipMap::ComputeLevelSize(currentTest.fBaseWidth,
- currentTest.fBaseHeight, currentTest.fLevel);
+ SkISize levelSize = SkMipMap::ComputeLevelSize(currentTest.fBaseWidth,
+ currentTest.fBaseHeight,
+ currentTest.fLevel);
REPORTER_ASSERT(reporter, currentTest.fExpectedMipMapLevelSize == levelSize);
}
}
« 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