Index: samplecode/SampleApp.cpp |
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp |
index 9be7567ea08ec651782cd2244c501f96e851fc11..07a7a87b7fb2ac83b68a7f927d05ec751b456e99 100644 |
--- a/samplecode/SampleApp.cpp |
+++ b/samplecode/SampleApp.cpp |
@@ -2257,6 +2257,12 @@ void SampleView::onDraw(SkCanvas* canvas) { |
for (int i = 0; i < fRepeatCount; i++) { |
SkAutoCanvasRestore acr(canvas, true); |
this->onDrawContent(canvas); |
+#if SK_SUPPORT_GPU |
+ // Ensure the GrContext doesn't batch across draw loops. |
+ if (GrContext* context = canvas->getGrContext()) { |
+ context->flush(); |
+ } |
+#endif |
} |
} |