Reduce the number of flush entry points

Change-Id: I02397851f73b7ef78e0ddfa682a8c812dec31eb8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206395
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This commit is contained in:
Robert Phillips 2019-04-08 11:10:39 -04:00 committed by Skia Commit-Bot
parent 09d022cbb8
commit 602df41025
4 changed files with 2 additions and 33 deletions

View File

@ -198,26 +198,6 @@ void GrContextPriv::flush(GrSurfaceProxy* proxy) {
SkSurface::kNone_FlushFlags, 0, nullptr);
}
void GrContextPriv::flushSurfaceWrites(GrSurfaceProxy* proxy) {
ASSERT_SINGLE_OWNER_PRIV
RETURN_IF_ABANDONED_PRIV
SkASSERT(proxy);
ASSERT_OWNED_PROXY_PRIV(proxy);
if (proxy->priv().hasPendingWrite()) {
this->flush(proxy);
}
}
void GrContextPriv::flushSurfaceIO(GrSurfaceProxy* proxy) {
ASSERT_SINGLE_OWNER_PRIV
RETURN_IF_ABANDONED_PRIV
SkASSERT(proxy);
ASSERT_OWNED_PROXY_PRIV(proxy);
if (proxy->priv().hasPendingIO()) {
this->flush(proxy);
}
}
void GrContextPriv::prepareSurfaceForExternalIO(GrSurfaceProxy* proxy) {
ASSERT_SINGLE_OWNER_PRIV
RETURN_IF_ABANDONED_PRIV

View File

@ -176,18 +176,6 @@ public:
*/
void flush(GrSurfaceProxy*);
/**
* After this returns any pending writes to the surface will have been issued to the
* backend 3D API.
*/
void flushSurfaceWrites(GrSurfaceProxy*);
/**
* After this returns any pending reads or writes to the surface will have been issued to the
* backend 3D API.
*/
void flushSurfaceIO(GrSurfaceProxy*);
/**
* Finalizes all pending reads and writes to the surface and also performs an MSAA resolve
* if necessary.

View File

@ -206,6 +206,7 @@ GrSemaphoresSubmitted GrDrawingManager::flush(GrSurfaceProxy* proxy,
if (fFlushing || this->wasAbandoned()) {
return GrSemaphoresSubmitted::kNo;
}
SkDEBUGCODE(this->validate());
auto direct = fContext->priv().asDirectContext();

View File

@ -375,7 +375,7 @@ bool SkImage_GpuBase::RenderYUVAToRGBA(GrContext* ctx, GrRenderTargetContext* re
renderTargetContext->drawRect(GrNoClip(), std::move(paint), GrAA::kNo, SkMatrix::I(), rect);
// DDL TODO: in the promise image version we must not flush here
ctx->priv().flushSurfaceWrites(renderTargetContext->asSurfaceProxy());
ctx->priv().flush(renderTargetContext->asSurfaceProxy());
return true;
}