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

Unified Diff: bench/nanobench.cpp

Issue 2337163002: Add ContextOptions field to SkCommandLineConfigGpu (Closed)
Patch Set: Add ContextOptions field to SkCommandLineConfigGpu Created 4 years, 3 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 | dm/DM.cpp » ('j') | 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 ae415fa06b694ee8c278f400b4ad94526d449d23..238e8f6029b8882c462b13c99e4b39269f05484e 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -390,7 +390,7 @@ static int setup_gpu_bench(Target* target, Benchmark* bench, int maxGpuFrameLag)
#if SK_SUPPORT_GPU
#define kBogusContextType GrContextFactory::kNativeGL_ContextType
-#define kBogusContextOptions GrContextFactory::kNone_ContextOptions
+#define kBogusContextOptions GrContextFactory::ContextOptions::kNone
#else
#define kBogusContextType 0
#define kBogusContextOptions 0
@@ -403,21 +403,8 @@ static void create_config(const SkCommandLineConfig* config, SkTArray<Config>* c
if (!FLAGS_gpu)
return;
- auto ctxOptions = GrContextFactory::kNone_ContextOptions;
- if (gpuConfig->getUseNVPR()) {
- ctxOptions = static_cast<GrContextFactory::ContextOptions>(
- ctxOptions | GrContextFactory::kEnableNVPR_ContextOptions);
- }
- if (gpuConfig->getUseInstanced()) {
- ctxOptions = static_cast<GrContextFactory::ContextOptions>(
- ctxOptions | GrContextFactory::kUseInstanced_ContextOptions);
- }
- if (SkColorAndColorSpaceAreGammaCorrect(gpuConfig->getColorType(),
- gpuConfig->getColorSpace())) {
- ctxOptions = static_cast<GrContextFactory::ContextOptions>(
- ctxOptions | GrContextFactory::kRequireSRGBSupport_ContextOptions);
- }
const auto ctxType = gpuConfig->getContextType();
+ const auto ctxOptions = gpuConfig->getContextOptions();
const auto sampleCount = gpuConfig->getSamples();
if (const GrContext* ctx = gGrFactory->get(ctxType, ctxOptions)) {
« no previous file with comments | « no previous file | dm/DM.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698