aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--bench/nanobench.cpp40
-rw-r--r--bench/nanobench.h1
2 files changed, 26 insertions, 15 deletions
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index 81bd4f2b5b..dd792dd39a 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -396,7 +396,7 @@ static void create_config(const SkCommandLineConfig* config, SkTArray<Config>* c
if (!FLAGS_gpu)
return;
- const auto ctxOptions = gpuConfig->getUseNVPR() ? GrContextFactory::kEnableNVPR_GLContextOptions
+ const auto ctxOptions = gpuConfig->getUseNVPR() ? GrContextFactory::kEnableNVPR_GLContextOptions
: GrContextFactory::kNone_GLContextOptions;
const auto ctxType = gpuConfig->getContextType();
const auto sampleCount = gpuConfig->getSamples();
@@ -418,6 +418,7 @@ static void create_config(const SkCommandLineConfig* config, SkTArray<Config>* c
Benchmark::kGPU_Backend,
kN32_SkColorType,
kPremul_SkAlphaType,
+ kLinear_SkColorProfileType,
sampleCount,
ctxType,
ctxOptions,
@@ -429,28 +430,37 @@ static void create_config(const SkCommandLineConfig* config, SkTArray<Config>* c
}
#endif
- #define CPU_CONFIG(name, backend, color, alpha) \
- if (config->getTag().equals(#name)) { \
- Config config = { SkString(#name), Benchmark::backend, color, alpha, 0, \
- kBogusGLContextType, kBogusGLContextOptions, \
- false }; \
- configs->push_back(config); \
- return; \
+ #define CPU_CONFIG(name, backend, color, alpha, profile) \
+ if (config->getTag().equals(#name)) { \
+ Config config = { \
+ SkString(#name), Benchmark::backend, color, alpha, profile, \
+ 0, kBogusGLContextType, kBogusGLContextOptions, false \
+ }; \
+ configs->push_back(config); \
+ return; \
}
if (FLAGS_cpu) {
- CPU_CONFIG(nonrendering, kNonRendering_Backend, kUnknown_SkColorType, kUnpremul_SkAlphaType)
- CPU_CONFIG(8888, kRaster_Backend, kN32_SkColorType, kPremul_SkAlphaType)
- CPU_CONFIG(565, kRaster_Backend, kRGB_565_SkColorType, kOpaque_SkAlphaType)
+ CPU_CONFIG(nonrendering, kNonRendering_Backend,
+ kUnknown_SkColorType, kUnpremul_SkAlphaType, kLinear_SkColorProfileType);
+
+ CPU_CONFIG(8888, kRaster_Backend,
+ kN32_SkColorType, kPremul_SkAlphaType, kLinear_SkColorProfileType)
+ CPU_CONFIG(565, kRaster_Backend,
+ kRGB_565_SkColorType, kOpaque_SkAlphaType, kLinear_SkColorProfileType)
+ CPU_CONFIG(srgb, kRaster_Backend,
+ kN32_SkColorType, kPremul_SkAlphaType, kSRGB_SkColorProfileType)
+ CPU_CONFIG(f16, kRaster_Backend,
+ kRGBA_F16_SkColorType, kPremul_SkAlphaType, kLinear_SkColorProfileType)
}
#undef CPU_CONFIG
#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
if (config->getTag().equals("hwui")) {
- Config config = { SkString("hwui"), Benchmark::kHWUI_Backend, kRGBA_8888_SkColorType,
- kPremul_SkAlphaType, 0, kBogusGLContextType, kBogusGLContextOptions,
- false };
+ Config config = { SkString("hwui"), Benchmark::kHWUI_Backend,
+ kRGBA_8888_SkColorType, kPremul_SkAlphaType, kLinear_SkColorProfileType,
+ 0, kBogusGLContextType, kBogusGLContextOptions, false };
configs->push_back(config);
}
#endif
@@ -472,7 +482,7 @@ static Target* is_enabled(Benchmark* bench, const Config& config) {
}
SkImageInfo info = SkImageInfo::Make(bench->getSize().fX, bench->getSize().fY,
- config.color, config.alpha);
+ config.color, config.alpha, config.profile);
Target* target = nullptr;
diff --git a/bench/nanobench.h b/bench/nanobench.h
index 204ada6a4d..ad538dd896 100644
--- a/bench/nanobench.h
+++ b/bench/nanobench.h
@@ -26,6 +26,7 @@ struct Config {
Benchmark::Backend backend;
SkColorType color;
SkAlphaType alpha;
+ SkColorProfileType profile;
int samples;
#if SK_SUPPORT_GPU
GrContextFactory::GLContextType ctxType;