Chromium Code Reviews| Index: bench/subset/SubsetTranslateBench.cpp |
| diff --git a/bench/subset/SubsetTranslateBench.cpp b/bench/subset/SubsetTranslateBench.cpp |
| index 620b6f4903b8da291ee0c8eb34809385825fb188..70c4458e4fd83a1e8e696ade097689e287daf171 100644 |
| --- a/bench/subset/SubsetTranslateBench.cpp |
| +++ b/bench/subset/SubsetTranslateBench.cpp |
| @@ -68,7 +68,12 @@ void SubsetTranslateBench::onDraw(const int n, SkCanvas* canvas) { |
| SkBitmap bitmap; |
| // Note that we use the same bitmap for all of the subsets. |
| // It might be larger than necessary for the end subsets. |
| - bitmap.allocPixels(info.makeWH(fSubsetWidth, fSubsetHeight)); |
| + if (kIndex_8_SkColorType == fColorType) { |
|
scroggo
2015/06/30 16:40:19
This code is almost exactly the same. Can we write
msarett
2015/06/30 18:40:28
Yes there is, good idea.
|
| + bitmap.allocPixels(info.makeWH(fSubsetWidth, fSubsetHeight), NULL, |
| + SkNEW_ARGS(SkColorTable, (colors, colorCount))); |
| + } else { |
| + bitmap.allocPixels(info.makeWH(fSubsetWidth, fSubsetHeight)); |
| + } |
| for (int x = 0; x < info.width(); x += fSubsetWidth) { |
| for (int y = 0; y < info.height(); y += fSubsetHeight) { |