Chromium Code Reviews| Index: bench/subset/SubsetBenchPriv.h |
| diff --git a/bench/subset/SubsetBenchPriv.h b/bench/subset/SubsetBenchPriv.h |
| index e0eb2ff82676dde1a6401fd948ecbd1a793a35ab..d4bb9139fb1ec83020c9942a43232094fd04e6d7 100644 |
| --- a/bench/subset/SubsetBenchPriv.h |
| +++ b/bench/subset/SubsetBenchPriv.h |
| @@ -32,4 +32,14 @@ static const char* get_color_name(SkColorType colorType) { |
| } |
| } |
| +static inline void alloc_pixels(SkBitmap* bitmap, const SkImageInfo& info, SkPMColor* colors, |
|
scroggo
2015/06/30 19:37:55
Maybe add a comment explaining what this does/why
msarett
2015/06/30 20:21:30
Done.
|
| + int colorCount) { |
| + if (kIndex_8_SkColorType == info.colorType()) { |
| + SkAutoTUnref<SkColorTable> colorTable(SkNEW_ARGS(SkColorTable, (colors, colorCount))); |
| + bitmap->allocPixels(info, NULL, colorTable); |
| + } else { |
| + bitmap->allocPixels(info); |
| + } |
| +} |
| + |
| #endif // SubsetBenchPriv_DEFINED |