aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/DeferredDisplayListTest.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-03-16 08:48:24 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-16 13:30:01 +0000
commit874b5357daa72c9fcdc14fc425b63ebc2219c034 (patch)
tree3d5cdb7653674cdee37de3f6746be251c94feeb7 /tests/DeferredDisplayListTest.cpp
parent91fba61f24943a6e12f69732d9308beb76f8a7c6 (diff)
Prevent crash when flushing while DDL recording
Change-Id: I35e96d3c3020092b33d9b952394d40d4fd5a587b Reviewed-on: https://skia-review.googlesource.com/114685 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
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