aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar cblume <cblume@chromium.org>2016-06-03 11:59:50 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-06-03 11:59:50 -0700
commit44e09ec810e6d28df87caa3df61cf6fbfd806544 (patch)
tree12ac17c24b37183c0b20f559de0ae8b64ecd4622 /src/core
parent87fee2380cba0ca13b8b2892ac2232fb8e04b6ab (diff)
SkMipMap::ComputeLevelSize to return SkISize
This previously returned SkSize, which had scalar components. That doesn't make sense for a mipmap size. R=bsalomon@google.com BUG=578304 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2036313002 Review-Url: https://codereview.chromium.org/2036313002
Diffstat (limited to 'src/core')
-rw-r--r--src/core/SkMipMap.cpp12
-rw-r--r--src/core/SkMipMap.h2
2 files changed, 7 insertions, 7 deletions
diff --git a/src/core/SkMipMap.cpp b/src/core/SkMipMap.cpp
index 4c075ea6bb..76f1718e7f 100644
--- a/src/core/SkMipMap.cpp
+++ b/src/core/SkMipMap.cpp
@@ -373,7 +373,7 @@ SkMipMap* SkMipMap::Build(const SkPixmap& src, SkDiscardableFactoryProc fact) {
size_t size = 0;
int countLevels = ComputeLevelCount(src.width(), src.height());
for (int currentMipLevel = countLevels; currentMipLevel > 0; currentMipLevel--) {
- SkSize mipSize = ComputeLevelSize(src.width(), src.height(), currentMipLevel);
+ SkISize mipSize = ComputeLevelSize(src.width(), src.height(), currentMipLevel);
size += SkColorTypeMinRowBytes(ct, mipSize.fWidth) * mipSize.fHeight;
}
@@ -496,17 +496,17 @@ int SkMipMap::ComputeLevelCount(int baseWidth, int baseHeight) {
return mipLevelCount;
}
-SkSize SkMipMap::ComputeLevelSize(int baseWidth, int baseHeight, int level) {
+SkISize SkMipMap::ComputeLevelSize(int baseWidth, int baseHeight, int level) {
if (baseWidth < 1 || baseHeight < 1) {
- return SkSize::Make(0, 0);
+ return SkISize::Make(0, 0);
}
int maxLevelCount = ComputeLevelCount(baseWidth, baseHeight);
if (level > maxLevelCount || level < 0) {
- return SkSize::Make(0, 0);
+ return SkISize::Make(0, 0);
}
if (level == 0) {
- return SkSize::Make(baseWidth, baseHeight);
+ return SkISize::Make(baseWidth, baseHeight);
}
// OpenGL's spec requires that each mipmap level have height/width equal to
@@ -516,7 +516,7 @@ SkSize SkMipMap::ComputeLevelSize(int baseWidth, int baseHeight, int level) {
int width = SkTMax(1, baseWidth >> level);
int height = SkTMax(1, baseHeight >> level);
- return SkSize::Make(width, height);
+ return SkISize::Make(width, height);
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/src/core/SkMipMap.h b/src/core/SkMipMap.h
index 5cb4ea8ce6..a230a23392 100644
--- a/src/core/SkMipMap.h
+++ b/src/core/SkMipMap.h
@@ -27,7 +27,7 @@ public:
static int ComputeLevelCount(int baseWidth, int baseHeight);
// Determines the size of a given mipmap level.
- static SkSize ComputeLevelSize(int baseWidth, int baseHeight, int level);
+ static SkISize ComputeLevelSize(int baseWidth, int baseHeight, int level);
struct Level {
SkPixmap fPixmap;