aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench
diff options
context:
space:
mode:
authorGravatar csmartdalton <csmartdalton@google.com>2017-02-21 12:36:05 -0700
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-02-21 21:45:45 +0000
commite812d496aaa5e5e9f2117de8f442c297c9cb1367 (patch)
tree7342c7c6e048e3a226e162d7d1bcbf6ffbcddc55 /bench
parente026511f4c4b90bfe842f89966d088b663fc8c13 (diff)
Rename GrContextFactory::ContextOptions to ContextOverrides
Also changes the behavior of these flags to only override their corresponding context options when set, and to leave them unchanged when not set. BUG=skia: Change-Id: I09f6be09997594fa888d9045dd4901354ef3f880 Reviewed-on: https://skia-review.googlesource.com/8780 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'bench')
-rw-r--r--bench/nanobench.cpp18
-rw-r--r--bench/nanobench.h2
2 files changed, 10 insertions, 10 deletions
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index 92475d31f8..e97e9a0bf3 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -189,11 +189,11 @@ struct GPUTarget : public Target {
0;
SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType);
this->surface = SkSurface::MakeRenderTarget(gGrFactory->get(this->config.ctxType,
- this->config.ctxOptions),
+ this->config.ctxOverrides),
SkBudgeted::kNo, info,
this->config.samples, &props);
this->context = gGrFactory->getContextInfo(this->config.ctxType,
- this->config.ctxOptions).testContext();
+ this->config.ctxOverrides).testContext();
if (!this->surface.get()) {
return false;
}
@@ -392,10 +392,10 @@ static int setup_gpu_bench(Target* target, Benchmark* bench, int maxGpuFrameLag)
#if SK_SUPPORT_GPU
#define kBogusContextType GrContextFactory::kNativeGL_ContextType
-#define kBogusContextOptions GrContextFactory::ContextOptions::kNone
+#define kBogusContextOverrides GrContextFactory::ContextOverrides::kNone
#else
#define kBogusContextType 0
-#define kBogusContextOptions 0
+#define kBogusContextOverrides 0
#endif
static void create_config(const SkCommandLineConfig* config, SkTArray<Config>* configs) {
@@ -406,10 +406,10 @@ static void create_config(const SkCommandLineConfig* config, SkTArray<Config>* c
return;
const auto ctxType = gpuConfig->getContextType();
- const auto ctxOptions = gpuConfig->getContextOptions();
+ const auto ctxOverrides = gpuConfig->getContextOverrides();
const auto sampleCount = gpuConfig->getSamples();
- if (const GrContext* ctx = gGrFactory->get(ctxType, ctxOptions)) {
+ if (const GrContext* ctx = gGrFactory->get(ctxType, ctxOverrides)) {
const auto maxSampleCount = ctx->caps()->maxSampleCount();
if (sampleCount > ctx->caps()->maxSampleCount()) {
SkDebugf("Configuration sample count %d exceeds maximum %d.\n",
@@ -429,7 +429,7 @@ static void create_config(const SkCommandLineConfig* config, SkTArray<Config>* c
sk_ref_sp(gpuConfig->getColorSpace()),
sampleCount,
ctxType,
- ctxOptions,
+ ctxOverrides,
gpuConfig->getUseDIText()
};
@@ -442,7 +442,7 @@ static void create_config(const SkCommandLineConfig* config, SkTArray<Config>* c
if (config->getTag().equals(#name)) { \
Config config = { \
SkString(#name), Benchmark::backend, color, alpha, colorSpace, \
- 0, kBogusContextType, kBogusContextOptions, false \
+ 0, kBogusContextType, kBogusContextOverrides, false \
}; \
configs->push_back(config); \
return; \
@@ -1333,7 +1333,7 @@ int main(int argc, char** argv) {
#if SK_SUPPORT_GPU
if (FLAGS_gpuStats && Benchmark::kGPU_Backend == configs[i].backend) {
GrContext* context = gGrFactory->get(configs[i].ctxType,
- configs[i].ctxOptions);
+ configs[i].ctxOverrides);
context->printCacheStats();
context->printGpuStats();
}
diff --git a/bench/nanobench.h b/bench/nanobench.h
index ce1e33ec4f..ffd6893c4a 100644
--- a/bench/nanobench.h
+++ b/bench/nanobench.h
@@ -30,7 +30,7 @@ struct Config {
int samples;
#if SK_SUPPORT_GPU
sk_gpu_test::GrContextFactory::ContextType ctxType;
- sk_gpu_test::GrContextFactory::ContextOptions ctxOptions;
+ sk_gpu_test::GrContextFactory::ContextOverrides ctxOverrides;
bool useDFText;
#else
int bogusInt;