Respect color type and gamma settings in nanobench GPU configs

We were ignoring the requested properties in things like gpuf16 and
gpusrgb.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2075133003

Review-Url: https://codereview.chromium.org/2075133003
This commit is contained in:
brianosman 2016-06-20 09:41:41 -07:00 committed by Commit bot
parent 52ede1d905
commit 1a48e13303

View File

@ -402,8 +402,16 @@ static void create_config(const SkCommandLineConfig* config, SkTArray<Config>* c
if (!FLAGS_gpu) if (!FLAGS_gpu)
return; return;
const auto ctxOptions = gpuConfig->getUseNVPR() ? GrContextFactory::kEnableNVPR_ContextOptions auto ctxOptions = GrContextFactory::kNone_ContextOptions;
: GrContextFactory::kNone_ContextOptions; if (gpuConfig->getUseNVPR()) {
ctxOptions = static_cast<GrContextFactory::ContextOptions>(
ctxOptions | GrContextFactory::kEnableNVPR_ContextOptions);
}
if (SkColorAndColorSpaceAreGammaCorrect(gpuConfig->getColorType(),
gpuConfig->getColorSpace())) {
ctxOptions = static_cast<GrContextFactory::ContextOptions>(
ctxOptions | GrContextFactory::kRequireSRGBSupport_ContextOptions);
}
const auto ctxType = gpuConfig->getContextType(); const auto ctxType = gpuConfig->getContextType();
const auto sampleCount = gpuConfig->getSamples(); const auto sampleCount = gpuConfig->getSamples();
@ -422,9 +430,9 @@ static void create_config(const SkCommandLineConfig* config, SkTArray<Config>* c
Config target = { Config target = {
gpuConfig->getTag(), gpuConfig->getTag(),
Benchmark::kGPU_Backend, Benchmark::kGPU_Backend,
kN32_SkColorType, gpuConfig->getColorType(),
kPremul_SkAlphaType, kPremul_SkAlphaType,
nullptr, sk_ref_sp(gpuConfig->getColorSpace()),
sampleCount, sampleCount,
ctxType, ctxType,
ctxOptions, ctxOptions,