aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/DeferredDisplayListTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/DeferredDisplayListTest.cpp')
-rw-r--r--tests/DeferredDisplayListTest.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/DeferredDisplayListTest.cpp b/tests/DeferredDisplayListTest.cpp
index b85388f9c9..f17957c9c8 100644
--- a/tests/DeferredDisplayListTest.cpp
+++ b/tests/DeferredDisplayListTest.cpp
@@ -445,5 +445,21 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(DDLInvalidRecorder, reporter, ctxInfo) {
}
+// Ensure that flushing while DDL recording doesn't cause a crash
+DEF_GPUTEST_FOR_RENDERING_CONTEXTS(DDLFlushWhileRecording, reporter, ctxInfo) {
+ GrContext* context = ctxInfo.grContext();
+
+ SkImageInfo ii = SkImageInfo::MakeN32Premul(32, 32);
+ sk_sp<SkSurface> s = SkSurface::MakeRenderTarget(context, SkBudgeted::kNo, ii);
+
+ SkSurfaceCharacterization characterization;
+ SkAssertResult(s->characterize(&characterization));
+
+ SkDeferredDisplayListRecorder recorder(characterization);
+ SkCanvas* canvas = recorder.getCanvas();
+
+ canvas->flush();
+ canvas->getGrContext()->flush();
+}
#endif