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

Unified Diff: tools/VisualBench/VisualBench.cpp

Issue 1413713006: Wire up configurations properly in VisualBench (Closed) Base URL: https://skia.googlesource.com/skia.git@detachattach
Patch Set: Created 5 years, 2 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 | « tools/VisualBench/VisualBench.h ('k') | tools/VisualBench/VisualBenchmarkStream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/VisualBench/VisualBench.cpp
diff --git a/tools/VisualBench/VisualBench.cpp b/tools/VisualBench/VisualBench.cpp
index 893dba6ab3ff9741207654664716d90da69d60c6..c16f4cc835100d1867c9e175ccaae384c7f5bd18 100644
--- a/tools/VisualBench/VisualBench.cpp
+++ b/tools/VisualBench/VisualBench.cpp
@@ -29,6 +29,26 @@ VisualBench::VisualBench(void* hwnd, int argc, char** argv)
: INHERITED(hwnd) {
SkCommandLineFlags::Parse(argc, argv);
+ for (int i = 0; i < FLAGS_config.count(); i++) {
+ SkString configStr(FLAGS_config[i]);
+
+ Configs::Config& config = fConfigs.push_back();
+
+ if (configStr.contains("gpu")) {
+ config.fType = Configs::Config::kGpu_Type;
+ config.fNumSamples = 0;
+ } else if (configStr.contains("msaa")) {
+ config.fType = Configs::Config::kMsaa_Type;
+ SkAssertResult(scanf("msaa%d", &config.fNumSamples));
+ } else if (configStr.contains("cpu")) {
+ config.fType = Configs::Config::kCpu_Type;
+ config.fNumSamples = 0;
+ } else if (configStr.contains("nvprmsaa")) {
+ config.fType = Configs::Config::kNvpr_Type;
+ SkAssertResult(scanf("nvprmsaa%d", &config.fNumSamples));
+ }
+ }
+
// this has to happen after commandline parsing
fModule.reset(new VisualLightweightBenchModule(this));
if (FLAGS_interactive) {
@@ -79,7 +99,10 @@ void VisualBench::resetContext() {
}
void VisualBench::setupContext() {
- if (!this->attach(kNativeGL_BackEndType, FLAGS_msaa, &fAttachmentInfo)) {
+ // We only set the number of samples on the base render target for MSAA
+ int numSamples = fConfigs.current().fType == Configs::Config::kMsaa_Type ?
+ fConfigs.current().fNumSamples : 0;
+ if (!this->attach(kNativeGL_BackEndType, numSamples, &fAttachmentInfo)) {
SkDebugf("Not possible to create backend.\n");
INHERITED::detach();
SkFAIL("Could not create backend\n");
@@ -91,8 +114,7 @@ void VisualBench::setupContext() {
fInterface.reset(GrGLCreateNativeInterface());
- // TODO use the GLContext creation factories and also set this all up in configs
- if (!FLAGS_nvpr) {
+ if (!fConfigs.current().fType == Configs::Config::kNvpr_Type) {
fInterface.reset(GrGLInterfaceRemoveNVPR(fInterface));
}
SkASSERT(fInterface);
« no previous file with comments | « tools/VisualBench/VisualBench.h ('k') | tools/VisualBench/VisualBenchmarkStream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698