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

Unified Diff: tools/VisualBench/VisualBenchmarkStream.cpp

Issue 1427533002: Flush GrContext between benchmark draw loops (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Check for SK_SUPPORT_GPU 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 | « samplecode/SampleApp.cpp ('k') | tools/VisualBench/VisualSKPBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/VisualBench/VisualBenchmarkStream.cpp
diff --git a/tools/VisualBench/VisualBenchmarkStream.cpp b/tools/VisualBench/VisualBenchmarkStream.cpp
index 906aab27886d44d9fbbaaf6bb6954595b3c33e6d..a6c6ee92f31976317d4a394e1b11eec0660eede6 100644
--- a/tools/VisualBench/VisualBenchmarkStream.cpp
+++ b/tools/VisualBench/VisualBenchmarkStream.cpp
@@ -17,6 +17,10 @@
#include "VisualFlags.h"
#include "VisualSKPBench.h"
+#if SK_SUPPORT_GPU
+#include "GrContext.h"
+#endif
+
DEFINE_bool(cpu, false, "Run in CPU mode?");
DEFINE_string2(match, m, nullptr,
"[~][^]substring[$] [...] of bench name to run.\n"
@@ -52,6 +56,12 @@ private:
for (int i = 0; i < loops; i++) {
canvas->drawPath(fPath, paint);
canvas->drawRect(rect, perlinPaint);
+#if SK_SUPPORT_GPU
+ // Ensure the GrContext doesn't batch across draw loops.
+ if (GrContext* context = canvas->getGrContext()) {
+ context->flush();
+ }
+#endif
}
}
SkPath fPath;
« no previous file with comments | « samplecode/SampleApp.cpp ('k') | tools/VisualBench/VisualSKPBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698