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

Unified Diff: tools/VisualBench/VisualBench.cpp

Issue 1473253002: Add offscreen mode to visualbench (Closed) Base URL: https://skia.googlesource.com/skia.git@visualbench_blit2
Patch Set: rebase Created 5 years, 1 month 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 | tools/VisualBench/VisualBenchmarkStream.cpp » ('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 3f695d619f133446c78f8bcbb310371c90a5bebe..4b76307f984bfc83e572942cedc2f1766c059e29 100644
--- a/tools/VisualBench/VisualBench.cpp
+++ b/tools/VisualBench/VisualBench.cpp
@@ -22,6 +22,8 @@
#include "VisualInteractiveModule.h"
#include "gl/GrGLInterface.h"
+#include <stdlib.h>
+
DEFINE_bool2(fullscreen, f, true, "Run fullscreen.");
DEFINE_bool2(interactive, n, false, "Run in interactive mode.");
DEFINE_bool2(dif, d, false, "Use device-independent fonts.");
@@ -35,6 +37,11 @@ VisualBench::VisualBench(void* hwnd, int argc, char** argv)
SkCommandLineFlags::Parse(argc, argv);
+ if (FLAGS_nvpr && !FLAGS_msaa) {
+ SkDebugf("Got nvpr without msaa. Exiting.\n");
+ exit(-1);
+ }
+
// these have to happen after commandline parsing
if (FLAGS_dif) {
const SkSurfaceProps& props(INHERITED::getSurfaceProps());
@@ -90,7 +97,8 @@ void VisualBench::resetContext() {
}
void VisualBench::setupContext() {
- if (!this->attach(kNativeGL_BackEndType, FLAGS_msaa, &fAttachmentInfo)) {
+ int screenSamples = FLAGS_offscreen ? 0 : FLAGS_msaa;
+ if (!this->attach(kNativeGL_BackEndType, screenSamples, &fAttachmentInfo)) {
SkDebugf("Not possible to create backend.\n");
INHERITED::detach();
SkFAIL("Could not create backend\n");
@@ -103,7 +111,7 @@ void VisualBench::setupContext() {
fInterface.reset(GrGLCreateNativeInterface());
// TODO use the GLContext creation factories and also set this all up in configs
- if (0 == FLAGS_nvpr) {
+ if (!FLAGS_nvpr) {
fInterface.reset(GrGLInterfaceRemoveNVPR(fInterface));
}
SkASSERT(fInterface);
« no previous file with comments | « no previous file | tools/VisualBench/VisualBenchmarkStream.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698