Remove GrSurfaceContext::flush calls ...
... replacing them w/ calls to GrDirectContextPriv::flushSurface.
Since recording contexts can also possess surface- and renderTarget-
Contexts it is misleading for them to have a flush method.
Change-Id: I10f4fad12d4d5efdd999ba212fda9ce5cdd83130
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334068
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrDirectContextPriv.h b/src/gpu/GrDirectContextPriv.h
index 119df84..d96030e 100644
--- a/src/gpu/GrDirectContextPriv.h
+++ b/src/gpu/GrDirectContextPriv.h
@@ -8,6 +8,7 @@
#ifndef GrDirectContextPriv_DEFINED
#define GrDirectContextPriv_DEFINED
+#include "include/core/SkSurface.h"
#include "include/gpu/GrDirectContext.h"
#include "src/core/SkSpan.h"
@@ -81,11 +82,21 @@
* GrContext will detect when it must perform a resolve before reading pixels back from the
* surface or using it as a texture.
*/
- GrSemaphoresSubmitted flushSurfaces(SkSpan<GrSurfaceProxy*>, const GrFlushInfo&);
+ GrSemaphoresSubmitted flushSurfaces(
+ SkSpan<GrSurfaceProxy*>,
+ SkSurface::BackendSurfaceAccess = SkSurface::BackendSurfaceAccess::kNoAccess,
+ const GrFlushInfo& = {},
+ const GrBackendSurfaceMutableState* newState = nullptr);
- /** Version of above that flushes for a single proxy and uses a default GrFlushInfo. Null is
- * allowed. */
- void flushSurface(GrSurfaceProxy*);
+ /** Version of above that flushes for a single proxy. Null is allowed. */
+ GrSemaphoresSubmitted flushSurface(
+ GrSurfaceProxy* proxy,
+ SkSurface::BackendSurfaceAccess access = SkSurface::BackendSurfaceAccess::kNoAccess,
+ const GrFlushInfo& info = {},
+ const GrBackendSurfaceMutableState* newState = nullptr) {
+ size_t size = proxy ? 1 : 0;
+ return this->flushSurfaces({&proxy, size}, access, info, newState);
+ }
/**
* Returns true if createPMToUPMEffect and createUPMToPMEffect will succeed. In other words,