diff options
author | msarett <msarett@google.com> | 2015-06-30 13:29:37 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-30 13:29:37 -0700 |
commit | 7f6283bdf8926f72b886389588e3e2d3bc0ea066 (patch) | |
tree | 84977e601181d660f3736f2124c292765bbb6fa1 /bench/subset/SubsetSingleBench.cpp | |
parent | d3e259a16cf85454f629f5fe75b60b9863c1e138 (diff) | |
download | platform_external_skqp-7f6283bdf8926f72b886389588e3e2d3bc0ea066.tar.gz platform_external_skqp-7f6283bdf8926f72b886389588e3e2d3bc0ea066.tar.bz2 platform_external_skqp-7f6283bdf8926f72b886389588e3e2d3bc0ea066.zip |
Fix CodecSubset benches seg faults for kIndex8
All of the CodecSubset benches fail when the color type is
kIndex8. We need to pass a color table to allocPixels()
when we want to decode to kIndex8 or it will throw a failure.
BUG=skia:
Review URL: https://codereview.chromium.org/1213983003
Diffstat (limited to 'bench/subset/SubsetSingleBench.cpp')
-rw-r--r-- | bench/subset/SubsetSingleBench.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bench/subset/SubsetSingleBench.cpp b/bench/subset/SubsetSingleBench.cpp index 68c94cd246..6c1da5c39e 100644 --- a/bench/subset/SubsetSingleBench.cpp +++ b/bench/subset/SubsetSingleBench.cpp @@ -70,7 +70,8 @@ void SubsetSingleBench::onDraw(const int n, SkCanvas* canvas) { info, NULL, colors, &colorCount); SkBitmap bitmap; - bitmap.allocPixels(info.makeWH(fSubsetWidth, fSubsetHeight)); + SkImageInfo subsetInfo = info.makeWH(fSubsetWidth, fSubsetHeight); + alloc_pixels(&bitmap, subsetInfo, colors, colorCount); scanlineDecoder->skipScanlines(fOffsetTop); uint32_t bpp = info.bytesPerPixel(); |