Add optional param to setBackendTextureState to return previous state.

Bug: skia:10742
Change-Id: I334e7896d0a1509eb666c46d5731d2573a5c1aba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318698
Reviewed-by: Austin Eng <enga@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index e6100c8..96edd6f 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -754,6 +754,7 @@
 
 bool GrContext::setBackendTextureState(const GrBackendTexture& backendTexture,
                                        const GrBackendSurfaceMutableState& state,
+                                       GrBackendSurfaceMutableState* previousState,
                                        GrGpuFinishedProc finishedProc,
                                        GrGpuFinishedContext finishedContext) {
     sk_sp<GrRefCntedCallback> callback;
@@ -769,7 +770,7 @@
         return false;
     }
 
-    return fGpu->setBackendTextureState(backendTexture, state, std::move(callback));
+    return fGpu->setBackendTextureState(backendTexture, state, previousState, std::move(callback));
 }
 
 bool GrContext::updateCompressedBackendTexture(const GrBackendTexture& backendTexture,
@@ -824,6 +825,7 @@
 
 bool GrContext::setBackendRenderTargetState(const GrBackendRenderTarget& backendRenderTarget,
                                             const GrBackendSurfaceMutableState& state,
+                                            GrBackendSurfaceMutableState* previousState,
                                             GrGpuFinishedProc finishedProc,
                                             GrGpuFinishedContext finishedContext) {
     sk_sp<GrRefCntedCallback> callback;
@@ -839,7 +841,8 @@
         return false;
     }
 
-    return fGpu->setBackendRenderTargetState(backendRenderTarget, state, std::move(callback));
+    return fGpu->setBackendRenderTargetState(backendRenderTarget, state, previousState,
+                                             std::move(callback));
 }
 
 void GrContext::deleteBackendTexture(GrBackendTexture backendTex) {