diff options
author | reed <reed@google.com> | 2014-09-03 11:54:58 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-03 11:54:58 -0700 |
commit | e5ea500d4714a7d84de2bf913e81be3b65d2de68 (patch) | |
tree | 0c94feeb709b17b954f5e97fad463ec9cfc4dc18 /bench | |
parent | 42b0dfeb29e993b7fd247dcecff705d3dd4cf191 (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 'bench')
-rw-r--r-- | bench/WritePixelsBench.cpp | 4 | ||||
-rw-r--r-- | bench/nanobench.cpp | 9 |
2 files changed, 4 insertions, 9 deletions
diff --git a/bench/WritePixelsBench.cpp b/bench/WritePixelsBench.cpp index 5138375ffb..88b2e62ca5 100644 --- a/bench/WritePixelsBench.cpp +++ b/bench/WritePixelsBench.cpp @@ -54,9 +54,7 @@ protected: bmp.allocN32Pixels(size.width(), size.height()); canvas->readPixels(&bmp, 0, 0); - SkImageInfo info = bmp.info(); - info.fColorType = fColorType; - info.fAlphaType = fAlphaType; + SkImageInfo info = SkImageInfo::Make(bmp.width(), bmp.height(), fColorType, fAlphaType); for (int loop = 0; loop < loops; ++loop) { canvas->writePixels(info, bmp.getPixels(), bmp.rowBytes(), 0, 0); diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp index 3dcd9db2d9..a484fc2b40 100644 --- a/bench/nanobench.cpp +++ b/bench/nanobench.cpp @@ -133,7 +133,7 @@ static bool write_canvas_png(SkCanvas* canvas, const SkString& filename) { if (filename.isEmpty()) { return false; } - if (kUnknown_SkColorType == canvas->imageInfo().fColorType) { + if (kUnknown_SkColorType == canvas->imageInfo().colorType()) { return false; } SkBitmap bmp; @@ -357,11 +357,8 @@ static Target* is_enabled(Benchmark* bench, const Config& config) { return NULL; } - SkImageInfo info; - info.fAlphaType = config.alpha; - info.fColorType = config.color; - info.fWidth = bench->getSize().fX; - info.fHeight = bench->getSize().fY; + SkImageInfo info = SkImageInfo::Make(bench->getSize().fX, bench->getSize().fY, + config.color, config.alpha); Target* target = new Target(config); |