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>
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/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)