Hide fields in SkImageInfo
R=rmistry@google.com
TBR=bsalomon
Author: reed@google.com
Review URL: https://codereview.chromium.org/536003002
diff --git a/tools/LazyDecodeBitmap.cpp b/tools/LazyDecodeBitmap.cpp
index 4459cf1..ec275ea 100644
--- a/tools/LazyDecodeBitmap.cpp
+++ b/tools/LazyDecodeBitmap.cpp
@@ -39,7 +39,7 @@
return false;
}
SkDiscardableMemory::Factory* pool = NULL;
- if ((!FLAGS_useVolatileCache) || (info.fWidth * info.fHeight < 32 * 1024)) {
+ if ((!FLAGS_useVolatileCache) || (info.width() * info.height() < 32 * 1024)) {
// how to do switching with SkDiscardableMemory.
pool = SkGetGlobalDiscardableMemoryPool();
// Only meaningful if platform has a default discardable
diff --git a/tools/sk_tool_utils.cpp b/tools/sk_tool_utils.cpp
index 6a2beac..0200123 100644
--- a/tools/sk_tool_utils.cpp
+++ b/tools/sk_tool_utils.cpp
@@ -54,9 +54,7 @@
SkBitmap tmp(bitmap);
tmp.lockPixels();
- SkImageInfo info = tmp.info();
- info.fColorType = colorType;
- info.fAlphaType = alphaType;
+ const SkImageInfo info = SkImageInfo::Make(tmp.width(), tmp.height(), colorType, alphaType);
canvas->writePixels(info, tmp.getPixels(), tmp.rowBytes(), x, y);
}