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

Unified Diff: bench/nanobench.cpp

Issue 2075133003: Respect color type and gamma settings in nanobench GPU configs (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 6 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/nanobench.cpp
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index 94402cc770488c7c5c34f7bf207d81ddda7b579a..300729017cc396fe45ea45f655310113d5bae40a 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -402,8 +402,16 @@ static void create_config(const SkCommandLineConfig* config, SkTArray<Config>* c
if (!FLAGS_gpu)
return;
- const auto ctxOptions = gpuConfig->getUseNVPR() ? GrContextFactory::kEnableNVPR_ContextOptions
- : GrContextFactory::kNone_ContextOptions;
+ auto ctxOptions = 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 sampleCount = gpuConfig->getSamples();
@@ -422,9 +430,9 @@ static void create_config(const SkCommandLineConfig* config, SkTArray<Config>* c
Config target = {
gpuConfig->getTag(),
Benchmark::kGPU_Backend,
- kN32_SkColorType,
+ gpuConfig->getColorType(),
kPremul_SkAlphaType,
- nullptr,
+ sk_ref_sp(gpuConfig->getColorSpace()),
sampleCount,
ctxType,
ctxOptions,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698