Move gpu-specific methods off SkSurface

This should fully decouple SkSurface and the GPU backend, aiding
the ongoing effort to modularize Skia.

  - SkSurface::asImage -> SkSurfaces::AsImage
  - SkSurface::makeImageCopy -> SkSurfaces::AsImageCopy
  - SkSurface::flushAndSubmit -> GrDirectContext::flushAndSubmit
  - SkSurface::flush -> GrDirectContext::flush

There is also a skgpu::ganesh::Flush function which will help migrate
existing calls where the GrDirectContext is not readily available.
It will pull the GrRecordingContext off the surface, cast it to
a direct context, and then call flush (with appropriate null checks).
This could be done with existing public APIs, but adds a fair bit
of boilerplate that a one-liner makes clear.

This also moves the implementation of a Graphite Surface's
onFlush function to skgpu::graphite::Flush, but I didn't see any
places where it would have been explicitly used in unit tests.
No graphite tests seem to be failing, so maybe that flushing
wasn't really being used?

This also removes the old legacy define for surface methods,
as all clients have been upgraded.

Change-Id: Ibc36705cae9f212a4d5664a9923eb98703e4d945
Bug: skia:13983
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/698237
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
78 files changed