Reland "Remove deprecated flush calls."

This reverts commit 5e6d789ce47c8ce474b597073f7580602fcca467.

Reason for revert: Relanding with fix landed in chrome

Original change's description:
> 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>

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

# Not skipping CQ checks because this is a reland.

Bug: skia:10118
Change-Id: Ie24d7845a4ad75f95afe59037ea80a9f38082f13
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290918
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 bcb29c4..106ce20 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -9,6 +9,9 @@
 
   * <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/experimental/minimal_ios_mtl_skia_app/main.mm b/experimental/minimal_ios_mtl_skia_app/main.mm
index a49c7f3..26ef3bd 100644
--- a/experimental/minimal_ios_mtl_skia_app/main.mm
+++ b/experimental/minimal_ios_mtl_skia_app/main.mm
@@ -67,7 +67,7 @@
     draw_example(surface.get(), fPaint, rotation);
 
     // Must flush *and* present for this to work!
-    surface->flush();
+    surface->flushAndSubmit();
     surface = nullptr;
 
     id<MTLCommandBuffer> commandBuffer = [[self metalQueue] commandBuffer];
diff --git a/experimental/wasm-skp-debugger/debugger_bindings.cpp b/experimental/wasm-skp-debugger/debugger_bindings.cpp
index 5b5090d..b934809 100644
--- a/experimental/wasm-skp-debugger/debugger_bindings.cpp
+++ b/experimental/wasm-skp-debugger/debugger_bindings.cpp
@@ -498,7 +498,7 @@
     .smart_ptr<sk_sp<SkSurface>>("sk_sp<SkSurface>")
     .function("width", &SkSurface::width)
     .function("height", &SkSurface::height)
-    .function("_flush", select_overload<void()>(&SkSurface::flush))
+    .function("_flush", select_overload<void()>(&SkSurface::flushAndSubmit))
     .function("getCanvas", &SkSurface::getCanvas, allow_raw_pointers());
   class_<SkCanvas>("SkCanvas")
     .function("clear", optional_override([](SkCanvas& self, JSColor color)->void {
diff --git a/include/core/SkSurface.h b/include/core/SkSurface.h
index 62698bb..99024e2 100644
--- a/include/core/SkSurface.h
+++ b/include/core/SkSurface.h
@@ -920,11 +920,6 @@
     */
     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
@@ -961,28 +956,6 @@
     */
     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 9dcba2c..aaf1c6d 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -312,11 +312,6 @@
     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
@@ -353,33 +348,6 @@
     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 5823f0a..5dfcf4d 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::flush))
+        .function("_flush", select_overload<void()>(&SkSurface::flushAndSubmit))
         .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 db8ec53..77269a8 100644
--- a/src/image/SkSurface.cpp
+++ b/src/image/SkSurface.cpp
@@ -452,37 +452,6 @@
     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 be27dcf..787d2c4 100644
--- a/tests/SurfaceSemaphoreTest.cpp
+++ b/tests/SurfaceSemaphoreTest.cpp
@@ -242,7 +242,11 @@
     mainSurface->flushAndSubmit();
 
     GrBackendSemaphore semaphore;
-    GrSemaphoresSubmitted submitted = mainSurface->flushAndSignalSemaphores(1, &semaphore);
+    GrFlushInfo flushInfo;
+    flushInfo.fNumSemaphores = 1;
+    flushInfo.fSignalSemaphores = &semaphore;
+    GrSemaphoresSubmitted submitted = mainSurface->flush(SkSurface::BackendSurfaceAccess::kNoAccess,
+                                                         flushInfo);
     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 4b12f38..e6e4e04 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->flush();
+        surface->flushAndSubmit();
     }
     if (next) {
         [NSTimer scheduledTimerWithTimeInterval:std::max(0.0, next - SkTime::GetNSecs() * 1e-9)
diff --git a/tools/skottie_ios_app/SkiaMetalContext.mm b/tools/skottie_ios_app/SkiaMetalContext.mm
index b49e360..f67d547 100644
--- a/tools/skottie_ios_app/SkiaMetalContext.mm
+++ b/tools/skottie_ios_app/SkiaMetalContext.mm
@@ -55,7 +55,7 @@
         return;
     }
     [viewController draw:rect toCanvas:surface->getCanvas() atSize:size];
-    surface->flush();
+    surface->flushAndSubmit();
     surface = nullptr;
 
     id<MTLCommandBuffer> commandBuffer = [fQueue commandBuffer];