Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: bench/subset/SubsetBenchPriv.h

Issue 1531833002: Remove Subset*Benches (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « bench/nanobench.cpp ('k') | bench/subset/SubsetSingleBench.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2015 The Android Open Source Project
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef SubsetBenchPriv_DEFINED
9 #define SubsetBenchPriv_DEFINED
10
11 #include "SkCodec.h"
12 #include "SkData.h"
13 #include "SkImageGenerator.h"
14
15 /*
16 * If we plan to decode to kIndex8, we must create a color table and pass it to the
17 * bitmap when we allocate pixels. Otherwise, we simply allocate pixels using t he
18 * decode info.
19 */
20 static inline void alloc_pixels(SkBitmap* bitmap, const SkImageInfo& info, SkPMC olor* colors,
21 int colorCount) {
22 if (kIndex_8_SkColorType == info.colorType()) {
23 SkAutoTUnref<SkColorTable> colorTable(new SkColorTable(colors, colorCoun t));
24 bitmap->allocPixels(info, nullptr, colorTable);
25 } else {
26 bitmap->allocPixels(info);
27 }
28 }
29
30 #endif // SubsetBenchPriv_DEFINED
OLDNEW
« no previous file with comments | « bench/nanobench.cpp ('k') | bench/subset/SubsetSingleBench.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698