Add GrSimpleMeshDrawOpHelper::CreateProgramInfo

This helper method can be used by the MeshDrawOps to (pre-)create their GrProgramInfos.

Bug: skia:9455
Change-Id: I41b7c2aefc0f633a1d32996c7f0cce3d11f8fcb1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273815
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index 5b05da7..8dce76e 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -1647,6 +1647,8 @@
     Result result = src.draw(recorder.beginRecording(SkIntToScalar(size.width()),
                                                      SkIntToScalar(size.height())));
     if (!result.isOk()) {
+        gpuTaskGroup->add([gpuTestCtx] { gpuTestCtx->makeNotCurrent(); });
+        gpuTaskGroup->wait();
         return result;
     }
     sk_sp<SkPicture> inputPicture(recorder.finishRecordingAsPicture());
@@ -1657,6 +1659,8 @@
     DDLPromiseImageHelper promiseImageHelper;
     sk_sp<SkData> compressedPictureData = promiseImageHelper.deflateSKP(inputPicture.get());
     if (!compressedPictureData) {
+        gpuTaskGroup->add([gpuTestCtx] { gpuTestCtx->makeNotCurrent(); });
+        gpuTaskGroup->wait();
         return Result::Fatal("GPUDDLSink: Couldn't deflate SkPicture");
     }