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

Unified Diff: tools/VisualBench/VisualSKPBench.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 | « tools/VisualBench/VisualBenchmarkStream.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/VisualBench/VisualSKPBench.cpp
diff --git a/tools/VisualBench/VisualSKPBench.cpp b/tools/VisualBench/VisualSKPBench.cpp
index 649d324a668474e69ed0e36ba44fc9f7546859f2..628265e53e103d9a485fd4d5c6dc76fc01c960a8 100644
--- a/tools/VisualBench/VisualSKPBench.cpp
+++ b/tools/VisualBench/VisualSKPBench.cpp
@@ -8,6 +8,10 @@
#include "VisualSKPBench.h"
+#if SK_SUPPORT_GPU
+#include "GrContext.h"
+#endif
+
VisualSKPBench::VisualSKPBench(const char* name, const SkPicture* pic)
: fPic(SkRef(pic))
, fName(name) {
@@ -29,5 +33,11 @@ bool VisualSKPBench::isSuitableFor(Backend backend) {
void VisualSKPBench::onDraw(int loops, SkCanvas* canvas) {
for (int i = 0; i < loops; i++) {
canvas->drawPicture(fPic);
+#if SK_SUPPORT_GPU
+ // Ensure the GrContext doesn't batch across draw loops.
+ if (GrContext* context = canvas->getGrContext()) {
+ context->flush();
+ }
+#endif
}
}
« no previous file with comments | « tools/VisualBench/VisualBenchmarkStream.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698