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

Unified Diff: bench/SKPBench.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 | « no previous file | samplecode/SampleApp.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/SKPBench.cpp
diff --git a/bench/SKPBench.cpp b/bench/SKPBench.cpp
index 44261335daa3bb750b7891b8acd224b3426caff9..910af6b802337a700557f1ceedc24ab5a1375458 100644
--- a/bench/SKPBench.cpp
+++ b/bench/SKPBench.cpp
@@ -10,6 +10,10 @@
#include "SkMultiPictureDraw.h"
#include "SkSurface.h"
+#if SK_SUPPORT_GPU
+#include "GrContext.h"
+#endif
+
// These CPU tile sizes are not good per se, but they are similar to what Chrome uses.
DEFINE_int32(CPUbenchTileW, 256, "Tile width used for CPU SKP playback.");
DEFINE_int32(CPUbenchTileH, 256, "Tile height used for CPU SKP playback.");
@@ -115,6 +119,12 @@ void SKPBench::onDraw(int loops, SkCanvas* canvas) {
this->drawPicture();
}
}
+#if SK_SUPPORT_GPU
+ // Ensure the GrContext doesn't batch across draw loops.
+ if (GrContext* context = canvas->getGrContext()) {
+ context->flush();
+ }
+#endif
}
void SKPBench::drawMPDPicture() {
« no previous file with comments | « no previous file | samplecode/SampleApp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698