Remove deprecated SkSurface::prepareForExternalIO and related uses of the name.

In a future CL I intend to use prepareForExternalIO to be a specific operation
to do to an SkSurface/SkImage so this is a pre CL that removes our use of that
phrase when related to flushing.

Bug: skia:8802
Change-Id: I3efe4c4061fe962e2fc1339185feb5ded6e23005
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208223
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/include/core/SkSurface.h b/include/core/SkSurface.h
index d189ea1..7e68a88 100644
--- a/include/core/SkSurface.h
+++ b/include/core/SkSurface.h
@@ -696,10 +696,6 @@
     */
     const SkSurfaceProps& props() const { return fProps; }
 
-    /** Deprecated.
-    */
-    void prepareForExternalIO();
-
     /** Issues pending SkSurface commands to the GPU-backed API and resolves any SkSurface MSAA.
 
         Skia flushes as needed, so it is not necessary to call this if Skia manages
diff --git a/src/gpu/GrContextPriv.cpp b/src/gpu/GrContextPriv.cpp
index 9c1bc97..31aab9c 100644
--- a/src/gpu/GrContextPriv.cpp
+++ b/src/gpu/GrContextPriv.cpp
@@ -198,12 +198,12 @@
                                       kNone_GrFlushFlags, 0, nullptr, nullptr, nullptr);
 }
 
-void GrContextPriv::prepareSurfaceForExternalIO(GrSurfaceProxy* proxy) {
+void GrContextPriv::flushSurface(GrSurfaceProxy* proxy) {
     ASSERT_SINGLE_OWNER_PRIV
     RETURN_IF_ABANDONED_PRIV
     SkASSERT(proxy);
     ASSERT_OWNED_PROXY_PRIV(proxy);
-    fContext->drawingManager()->prepareSurfaceForExternalIO(proxy,
+    fContext->drawingManager()->flushSurface(proxy,
             SkSurface::BackendSurfaceAccess::kNoAccess, kNone_GrFlushFlags, 0, nullptr,
             nullptr, nullptr);
 }
diff --git a/src/gpu/GrContextPriv.h b/src/gpu/GrContextPriv.h
index 070cccb..2eb3b8d 100644
--- a/src/gpu/GrContextPriv.h
+++ b/src/gpu/GrContextPriv.h
@@ -184,7 +184,7 @@
      * GrContext will detect when it must perform a resolve before reading pixels back from the
      * surface or using it as a texture.
      */
-    void prepareSurfaceForExternalIO(GrSurfaceProxy*);
+    void flushSurface(GrSurfaceProxy*);
 
    /**
     * These flags can be used with the read/write pixels functions below.
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp
index 4f559ea..214cf6c 100644
--- a/src/gpu/GrDrawingManager.cpp
+++ b/src/gpu/GrDrawingManager.cpp
@@ -492,11 +492,10 @@
     return anyOpListsExecuted;
 }
 
-GrSemaphoresSubmitted GrDrawingManager::prepareSurfaceForExternalIO(
+GrSemaphoresSubmitted GrDrawingManager::flushSurface(
         GrSurfaceProxy* proxy, SkSurface::BackendSurfaceAccess access, GrFlushFlags flags,
         int numSemaphores, GrBackendSemaphore backendSemaphores[],
-        GrGpuFinishedProc finishedProc,
-        GrGpuFinishedContext finishedContext) {
+        GrGpuFinishedProc finishedProc, GrGpuFinishedContext finishedContext) {
     if (this->wasAbandoned()) {
         return GrSemaphoresSubmitted::kNo;
     }
diff --git a/src/gpu/GrDrawingManager.h b/src/gpu/GrDrawingManager.h
index ef937fe..2ed2c81 100644
--- a/src/gpu/GrDrawingManager.h
+++ b/src/gpu/GrDrawingManager.h
@@ -70,13 +70,13 @@
 
     static bool ProgramUnitTest(GrContext* context, int maxStages, int maxLevels);
 
-    GrSemaphoresSubmitted prepareSurfaceForExternalIO(GrSurfaceProxy*,
-                                                      SkSurface::BackendSurfaceAccess access,
-                                                      GrFlushFlags flags,
-                                                      int numSemaphores,
-                                                      GrBackendSemaphore backendSemaphores[],
-                                                      GrGpuFinishedProc finishedProc,
-                                                      GrGpuFinishedContext finishedContext);
+    GrSemaphoresSubmitted flushSurface(GrSurfaceProxy*,
+                                       SkSurface::BackendSurfaceAccess access,
+                                       GrFlushFlags flags,
+                                       int numSemaphores,
+                                       GrBackendSemaphore backendSemaphores[],
+                                       GrGpuFinishedProc finishedProc,
+                                       GrGpuFinishedContext finishedContext);
 
     void addOnFlushCallbackObject(GrOnFlushCallbackObject*);
 
diff --git a/src/gpu/GrRenderTargetContext.cpp b/src/gpu/GrRenderTargetContext.cpp
index 47806f8..31d0ecf 100644
--- a/src/gpu/GrRenderTargetContext.cpp
+++ b/src/gpu/GrRenderTargetContext.cpp
@@ -1740,7 +1740,7 @@
     this->getRTOpList()->addOp(std::move(op), *this->caps());
 }
 
-GrSemaphoresSubmitted GrRenderTargetContext::prepareForExternalIO(
+GrSemaphoresSubmitted GrRenderTargetContext::flush(
         SkSurface::BackendSurfaceAccess access, GrFlushFlags flags, int numSemaphores,
         GrBackendSemaphore backendSemaphores[], GrGpuFinishedProc finishedProc,
         GrGpuFinishedContext finishedContext) {
@@ -1751,12 +1751,9 @@
     SkDEBUGCODE(this->validate();)
     GR_CREATE_TRACE_MARKER_CONTEXT("GrRenderTargetContext", "prepareForExternalIO", fContext);
 
-    return this->drawingManager()->prepareSurfaceForExternalIO(fRenderTargetProxy.get(),
-                                                               access, flags,
-                                                               numSemaphores,
-                                                               backendSemaphores,
-                                                               finishedProc,
-                                                               finishedContext);
+    return this->drawingManager()->flushSurface(fRenderTargetProxy.get(), access, flags,
+                                                numSemaphores, backendSemaphores,
+                                                finishedProc, finishedContext);
 }
 
 bool GrRenderTargetContext::waitOnSemaphores(int numSemaphores,
diff --git a/src/gpu/GrRenderTargetContext.h b/src/gpu/GrRenderTargetContext.h
index 8e42227..c902dba 100644
--- a/src/gpu/GrRenderTargetContext.h
+++ b/src/gpu/GrRenderTargetContext.h
@@ -406,11 +406,9 @@
      * After this returns any pending surface IO will be issued to the backend 3D API and
      * if the surface has MSAA it will be resolved.
      */
-    GrSemaphoresSubmitted prepareForExternalIO(SkSurface::BackendSurfaceAccess access,
-                                               GrFlushFlags flags, int numSemaphores,
-                                               GrBackendSemaphore backendSemaphores[],
-                                               GrGpuFinishedProc finishedProc,
-                                               GrGpuFinishedContext finishedContext);
+    GrSemaphoresSubmitted flush(SkSurface::BackendSurfaceAccess access, GrFlushFlags flags,
+                                int numSemaphores, GrBackendSemaphore backendSemaphores[],
+                                GrGpuFinishedProc finishedProc, GrGpuFinishedContext finishedContext);
 
     /**
      *  The next time this GrRenderTargetContext is flushed, the gpu will wait on the passed in
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index e04c567..0884a5d 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1641,9 +1641,8 @@
                                          GrGpuFinishedContext finishedContext) {
     ASSERT_SINGLE_OWNER
 
-    return fRenderTargetContext->prepareForExternalIO(access, flags, numSemaphores,
-                                                      signalSemaphores, finishedProc,
-                                                      finishedContext);
+    return fRenderTargetContext->flush(access, flags, numSemaphores, signalSemaphores, finishedProc,
+                                       finishedContext);
 }
 
 bool SkGpuDevice::wait(int numSemaphores, const GrBackendSemaphore* waitSemaphores) {
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp
index bd99208..7d0c0c5 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -493,7 +493,7 @@
     }
 
     // Flush any writes or uploads
-    context->priv().prepareSurfaceForExternalIO(proxy.get());
+    context->priv().flushSurface(proxy.get());
     if (!proxy->isInstantiated()) {
         return codecImage;
     }
@@ -557,7 +557,7 @@
     sk_sp<GrTexture> texture = sk_ref_sp(proxy->peekTexture());
 
     // Flush any writes or uploads
-    context->priv().prepareSurfaceForExternalIO(proxy.get());
+    context->priv().flushSurface(proxy.get());
     GrGpu* gpu = context->priv().getGpu();
 
     sk_sp<GrSemaphore> sema = gpu->prepareTextureForCrossContextUsage(texture.get());
@@ -690,7 +690,7 @@
     }
 
     // Flush any pending IO on the texture.
-    ctx->priv().prepareSurfaceForExternalIO(as_IB(image)->peekProxy());
+    ctx->priv().flushSurface(as_IB(image)->peekProxy());
     SkASSERT(!texture->surfacePriv().hasPendingIO());
 
     // We must make a copy of the image if the image is not unique, if the GrTexture owned by the
@@ -709,7 +709,7 @@
         }
 
         // Flush to ensure that the copy is completed before we return the texture.
-        ctx->priv().prepareSurfaceForExternalIO(as_IB(image)->peekProxy());
+        ctx->priv().flushSurface(as_IB(image)->peekProxy());
         SkASSERT(!texture->surfacePriv().hasPendingIO());
     }
 
diff --git a/src/image/SkImage_GpuBase.cpp b/src/image/SkImage_GpuBase.cpp
index 4679a73..3606547 100644
--- a/src/image/SkImage_GpuBase.cpp
+++ b/src/image/SkImage_GpuBase.cpp
@@ -247,7 +247,7 @@
     GrTexture* texture = proxy->peekTexture();
     if (texture) {
         if (flushPendingGrContextIO) {
-            direct->priv().prepareSurfaceForExternalIO(proxy.get());
+            direct->priv().flushSurface(proxy.get());
         }
         if (origin) {
             *origin = proxy->origin();
diff --git a/src/image/SkSurface.cpp b/src/image/SkSurface.cpp
index 4f36205..c5c07dc 100644
--- a/src/image/SkSurface.cpp
+++ b/src/image/SkSurface.cpp
@@ -239,10 +239,6 @@
     return asSB(this)->onGetBackendRenderTarget(access);
 }
 
-void SkSurface::prepareForExternalIO() {
-    this->flush();
-}
-
 void SkSurface::flush() {
     asSB(this)->onFlush(BackendSurfaceAccess::kNoAccess, kNone_GrFlushFlags, 0, nullptr,
                         nullptr, nullptr);
diff --git a/tests/DefaultPathRendererTest.cpp b/tests/DefaultPathRendererTest.cpp
index 8b13ba6..677c924 100644
--- a/tests/DefaultPathRendererTest.cpp
+++ b/tests/DefaultPathRendererTest.cpp
@@ -99,8 +99,8 @@
         rtc->drawPath(GrNoClip(), std::move(paint), GrAA::kNo,
                       SkMatrix::I(), invPath, style);
 
-        rtc->prepareForExternalIO(SkSurface::BackendSurfaceAccess::kNoAccess,
-                                  kNone_GrFlushFlags, 0, nullptr, nullptr, nullptr);
+        rtc->flush(SkSurface::BackendSurfaceAccess::kNoAccess,
+                   kNone_GrFlushFlags, 0, nullptr, nullptr, nullptr);
     }
 
     {
diff --git a/tests/OnFlushCallbackTest.cpp b/tests/OnFlushCallbackTest.cpp
index 534739e..0dc14ef 100644
--- a/tests/OnFlushCallbackTest.cpp
+++ b/tests/OnFlushCallbackTest.cpp
@@ -580,8 +580,8 @@
         rtc->drawRect(GrNoClip(), std::move(paint), GrAA::kNo, SkMatrix::I(), r);
     }
 
-    rtc->prepareForExternalIO(SkSurface::BackendSurfaceAccess::kNoAccess,
-                              kNone_GrFlushFlags, 0, nullptr, nullptr, nullptr);
+    rtc->flush(SkSurface::BackendSurfaceAccess::kNoAccess, kNone_GrFlushFlags, 0, nullptr, nullptr,
+               nullptr);
 
     SkBitmap readBack;
     readBack.allocN32Pixels(kFinalWidth, kFinalHeight);