aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2014-09-03 11:54:58 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-09-03 11:54:58 -0700
commite5ea500d4714a7d84de2bf913e81be3b65d2de68 (patch)
tree0c94feeb709b17b954f5e97fad463ec9cfc4dc18 /tools
parent42b0dfeb29e993b7fd247dcecff705d3dd4cf191 (diff)
Hide fields in SkImageInfo
R=rmistry@google.com TBR=bsalomon Author: reed@google.com Review URL: https://codereview.chromium.org/536003002
Diffstat (limited to 'tools')
-rw-r--r--tools/LazyDecodeBitmap.cpp2
-rw-r--r--tools/sk_tool_utils.cpp4
2 files changed, 2 insertions, 4 deletions
diff --git a/tools/LazyDecodeBitmap.cpp b/tools/LazyDecodeBitmap.cpp
index 4459cf114a..ec275eacab 100644
--- a/tools/LazyDecodeBitmap.cpp
+++ b/tools/LazyDecodeBitmap.cpp
@@ -39,7 +39,7 @@ bool sk_tools::LazyDecodeBitmap(const void* src,
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 6a2beacac1..02001238e9 100644
--- a/tools/sk_tool_utils.cpp
+++ b/tools/sk_tool_utils.cpp
@@ -54,9 +54,7 @@ void write_pixels(SkCanvas* canvas, const SkBitmap& bitmap, int x, int y,
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);
}