Revert "Remove deprecated flush calls."

This reverts commit d8fd0bf5749c62302eb1d1c9f4eaab151d839341.

Reason for revert: chrome roll

Original change's description:
> Remove deprecated flush calls.
> 
> Bug: skia:10118
> Change-Id: I13758b5416784c296b8b5be9f3228230ac1be05f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290540
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=egdaniel@google.com,bsalomon@google.com

Change-Id: I49d35cdb258e632f645974c5ec62075d3392efe0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10118
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290834
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index 106ce20..bcb29c4 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -9,9 +9,6 @@
 
   * <insert new release notes here>
 
-  * Remove deprecated version of flush calls on GrContext and SkSurface.
-    https://review.skia.org/2290540
-
   * SkCanvas::drawVertices and drawPatch now support mapping an SkShader without explicit
     texture coordinates. If they're not supplied, the local positions (vertex position or
     patch cubic positions) will be directly used to sample the SkShader.
diff --git a/include/core/SkSurface.h b/include/core/SkSurface.h
index 99024e2..62698bb 100644
--- a/include/core/SkSurface.h
+++ b/include/core/SkSurface.h
@@ -920,6 +920,11 @@
     */
     void flushAndSubmit();
 
+    /**
+     * Deprecated.
+     */
+    void flush() { this->flushAndSubmit(); }
+
     enum class BackendSurfaceAccess {
         kNoAccess,  //!< back-end object will not be used by client
         kPresent,   //!< back-end surface will be used for presenting to screen
@@ -956,6 +961,28 @@
     */
     GrSemaphoresSubmitted flush(BackendSurfaceAccess access, const GrFlushInfo& info);
 
+    /** Deprecated
+     */
+    GrSemaphoresSubmitted flush(BackendSurfaceAccess access, GrFlushFlags flags,
+                                int numSemaphores, GrBackendSemaphore signalSemaphores[],
+                                GrGpuFinishedProc finishedProc = nullptr,
+                                GrGpuFinishedContext finishedContext = nullptr);
+
+    /** The below enum and flush call are deprecated
+     */
+    enum FlushFlags {
+        kNone_FlushFlags = 0,
+        // flush will wait till all submitted GPU work is finished before returning.
+        kSyncCpu_FlushFlag = 0x1,
+    };
+    GrSemaphoresSubmitted flush(BackendSurfaceAccess access, FlushFlags flags,
+                                int numSemaphores, GrBackendSemaphore signalSemaphores[]);
+
+    /** Deprecated.
+    */
+    GrSemaphoresSubmitted flushAndSignalSemaphores(int numSemaphores,
+                                                   GrBackendSemaphore signalSemaphores[]);
+
     /** Inserts a list of GPU semaphores that the current GPU-backed API must wait on before
         executing any more commands on the GPU for this surface. Skia will take ownership of the
         underlying semaphores and delete them once they have been signaled and waited on.
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index aaf1c6d..9dcba2c 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -312,6 +312,11 @@
     void flushAndSubmit() { this->flush(GrFlushInfo(), GrPrepareForExternalIORequests()); }
 
     /**
+     * Deprecated.
+     */
+    void flush() { this->flushAndSubmit(); }
+
+    /**
      * Call to ensure all drawing to the context has been issued to the underlying 3D API.
      *
      * If the return is GrSemaphoresSubmitted::kYes, only initialized GrBackendSemaphores will have
@@ -348,6 +353,33 @@
     GrSemaphoresSubmitted flush(const GrFlushInfo&, const GrPrepareForExternalIORequests&);
 
     /**
+     * Deprecated.
+     */
+    GrSemaphoresSubmitted flush(GrFlushFlags flags, int numSemaphores,
+                                GrBackendSemaphore signalSemaphores[],
+                                GrGpuFinishedProc finishedProc = nullptr,
+                                GrGpuFinishedContext finishedContext = nullptr) {
+        GrFlushInfo info;
+        info.fFlags = flags;
+        info.fNumSemaphores = numSemaphores;
+        info.fSignalSemaphores = signalSemaphores;
+        info.fFinishedProc = finishedProc;
+        info.fFinishedContext = finishedContext;
+        return this->flush(info);
+    }
+
+    /**
+     * Deprecated.
+     */
+    GrSemaphoresSubmitted flushAndSignalSemaphores(int numSemaphores,
+                                                   GrBackendSemaphore signalSemaphores[]) {
+        GrFlushInfo info;
+        info.fNumSemaphores = numSemaphores;
+        info.fSignalSemaphores = signalSemaphores;
+        return this->flush(info);
+    }
+
+    /**
      * Placeholder no-op submit call.
      */
     bool submit(bool syncToCpu = false);
diff --git a/modules/canvaskit/canvaskit_bindings.cpp b/modules/canvaskit/canvaskit_bindings.cpp
index 5dfcf4d..5823f0a 100644
--- a/modules/canvaskit/canvaskit_bindings.cpp
+++ b/modules/canvaskit/canvaskit_bindings.cpp
@@ -1455,7 +1455,7 @@
 
     class_<SkSurface>("SkSurface")
         .smart_ptr<sk_sp<SkSurface>>("sk_sp<SkSurface>")
-        .function("_flush", select_overload<void()>(&SkSurface::flushAndSubmit))
+        .function("_flush", select_overload<void()>(&SkSurface::flush))
         .function("getCanvas", &SkSurface::getCanvas, allow_raw_pointers())
         .function("height", &SkSurface::height)
         .function("makeImageSnapshot", select_overload<sk_sp<SkImage>()>(&SkSurface::makeImageSnapshot))
diff --git a/src/image/SkSurface.cpp b/src/image/SkSurface.cpp
index 77269a8..db8ec53 100644
--- a/src/image/SkSurface.cpp
+++ b/src/image/SkSurface.cpp
@@ -452,6 +452,37 @@
     return asSB(this)->onFlush(access, flushInfo);
 }
 
+GrSemaphoresSubmitted SkSurface::flush(BackendSurfaceAccess access, GrFlushFlags flags,
+                                       int numSemaphores, GrBackendSemaphore signalSemaphores[],
+                                       GrGpuFinishedProc finishedProc,
+                                       GrGpuFinishedContext finishedContext) {
+    GrFlushInfo info;
+    info.fFlags = flags;
+    info.fNumSemaphores = numSemaphores;
+    info.fSignalSemaphores = signalSemaphores;
+    info.fFinishedProc = finishedProc;
+    info.fFinishedContext = finishedContext;
+    return this->flush(access, info);
+}
+
+GrSemaphoresSubmitted SkSurface::flush(BackendSurfaceAccess access, FlushFlags flags,
+                                       int numSemaphores, GrBackendSemaphore signalSemaphores[]) {
+    GrFlushFlags grFlags = flags == kSyncCpu_FlushFlag ? kSyncCpu_GrFlushFlag : kNone_GrFlushFlags;
+    GrFlushInfo info;
+    info.fFlags = grFlags;
+    info.fNumSemaphores = numSemaphores;
+    info.fSignalSemaphores = signalSemaphores;
+    return this->flush(access, info);
+}
+
+GrSemaphoresSubmitted SkSurface::flushAndSignalSemaphores(int numSemaphores,
+                                                          GrBackendSemaphore signalSemaphores[]) {
+    GrFlushInfo info;
+    info.fNumSemaphores = numSemaphores;
+    info.fSignalSemaphores = signalSemaphores;
+    return this->flush(BackendSurfaceAccess::kNoAccess, info);
+}
+
 bool SkSurface::wait(int numSemaphores, const GrBackendSemaphore* waitSemaphores) {
     return asSB(this)->onWait(numSemaphores, waitSemaphores);
 }
diff --git a/tests/SurfaceSemaphoreTest.cpp b/tests/SurfaceSemaphoreTest.cpp
index 787d2c4..be27dcf 100644
--- a/tests/SurfaceSemaphoreTest.cpp
+++ b/tests/SurfaceSemaphoreTest.cpp
@@ -242,11 +242,7 @@
     mainSurface->flushAndSubmit();
 
     GrBackendSemaphore semaphore;
-    GrFlushInfo flushInfo;
-    flushInfo.fNumSemaphores = 1;
-    flushInfo.fSignalSemaphores = &semaphore;
-    GrSemaphoresSubmitted submitted = mainSurface->flush(SkSurface::BackendSurfaceAccess::kNoAccess,
-                                                         flushInfo);
+    GrSemaphoresSubmitted submitted = mainSurface->flushAndSignalSemaphores(1, &semaphore);
     REPORTER_ASSERT(reporter, GrSemaphoresSubmitted::kYes == submitted);
 
 #ifdef SK_GL
diff --git a/tools/skottie_ios_app/SkiaGLContext.mm b/tools/skottie_ios_app/SkiaGLContext.mm
index e6e4e04..4b12f38 100644
--- a/tools/skottie_ios_app/SkiaGLContext.mm
+++ b/tools/skottie_ios_app/SkiaGLContext.mm
@@ -87,7 +87,7 @@
         [viewController draw:rect
                         toCanvas:(surface->getCanvas())
                         atSize:CGSize{(CGFloat)width, (CGFloat)height}];
-        surface->flushAndSubmit();
+        surface->flush();
     }
     if (next) {
         [NSTimer scheduledTimerWithTimeInterval:std::max(0.0, next - SkTime::GetNSecs() * 1e-9)