Remove unused GrFlushFlags.

This also adds back default flush() calls which simply do a flush
without any submit.

Change-Id: Ia8c92bbdecd515d871abfa6364592f502e98656b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298818
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
This commit is contained in:
Greg Daniel 2020-06-30 13:42:46 -04:00 committed by Skia Commit-Bot
parent 511cf4fca7
commit ce9f016ed3
19 changed files with 43 additions and 99 deletions

View File

@ -6,8 +6,12 @@ This file includes a list of high level updates for each milestone release.
Milestone 86 Milestone 86
------------ ------------
* Remove obsolete GrFlushFlags.
https://review.skia.org/298818
* Adds default flush() calls to SkSurface, SkImage, and GrContext. These calls do * Adds default flush() calls to SkSurface, SkImage, and GrContext. These calls do
a basic flush without a submit. If you haven't updated Skia in a couple release a basic flush without a submit. If you haven't updated Skia in a couple releases
and still have flush() calls in your code that you expect to do a flush and and still have flush() calls in your code that you expect to do a flush and
submit, you should update all those to the previously added flushAndSubmit() calls submit, you should update all those to the previously added flushAndSubmit() calls
instead. instead.

View File

@ -41,9 +41,7 @@ private:
void onPerCanvasPostDraw(SkCanvas* canvas) override { void onPerCanvasPostDraw(SkCanvas* canvas) override {
GrContext* context = canvas->getGrContext(); GrContext* context = canvas->getGrContext();
GrFlushInfo info; context->flush();
info.fFlags = kSyncCpu_GrFlushFlag;
context->flush(info);
context->submit(true); context->submit(true);
for (int i = 0; i < fBackendTextures.count(); ++i) { for (int i = 0; i < fBackendTextures.count(); ++i) {

View File

@ -1863,9 +1863,7 @@ Result GPUDDLSink::ddlDraw(const Src& src,
// TODO: switch over to using the promiseImage callbacks // TODO: switch over to using the promiseImage callbacks
// to free the backendTextures. This is complicated a // to free the backendTextures. This is complicated a
// bit by which thread possesses the direct context. // bit by which thread possesses the direct context.
GrFlushInfo flushInfoSyncCpu; gpuThreadCtx->flush();
flushInfoSyncCpu.fFlags = kSyncCpu_GrFlushFlag;
gpuThreadCtx->flush(flushInfoSyncCpu);
gpuThreadCtx->submit(true); gpuThreadCtx->submit(true);
}); });
@ -2334,9 +2332,7 @@ Result ViaDDL::draw(const Src& src, SkBitmap* bitmap, SkWStream* stream, SkStrin
// We need to ensure all the GPU work is finished so the promise image callback // We need to ensure all the GPU work is finished so the promise image callback
// contexts will delete all the backend textures. // contexts will delete all the backend textures.
GrFlushInfo flushInfoSyncCpu; context->flush();
flushInfoSyncCpu.fFlags = kSyncCpu_GrFlushFlag;
context->flush(flushInfoSyncCpu);
context->submit(true); context->submit(true);
} }
return Result::Ok(); return Result::Ok();

View File

@ -112,9 +112,7 @@ static sk_sp<SkImage> do_read_and_scale_yuv(Src* src,
}; };
*cleanup = {[context, backendTextures] { *cleanup = {[context, backendTextures] {
GrFlushInfo flushInfo; context->flush();
flushInfo.fFlags = kSyncCpu_GrFlushFlag;
context->flush(flushInfo);
context->submit(true); context->submit(true);
context->deleteBackendTexture(backendTextures[0]); context->deleteBackendTexture(backendTextures[0]);
context->deleteBackendTexture(backendTextures[1]); context->deleteBackendTexture(backendTextures[1]);

View File

@ -238,9 +238,7 @@ protected:
// Some backends (e.g., Vulkan) require all work be completed for backend textures // Some backends (e.g., Vulkan) require all work be completed for backend textures
// before they are deleted. Since we don't know when we'll next have access to a // before they are deleted. Since we don't know when we'll next have access to a
// direct context, flush all the work now. // direct context, flush all the work now.
GrFlushInfo flushInfoSyncCpu; context->flush();
flushInfoSyncCpu.fFlags = kSyncCpu_GrFlushFlag;
context->flush(flushInfoSyncCpu);
context->submit(true); context->submit(true);
return DrawResult::kOk; return DrawResult::kOk;

View File

@ -1365,9 +1365,7 @@ protected:
// Some backends (e.g., Vulkan) require all work be completed for backend textures // Some backends (e.g., Vulkan) require all work be completed for backend textures
// before they are deleted. Since we don't know when we'll next have access to a // before they are deleted. Since we don't know when we'll next have access to a
// direct context, flush all the work now. // direct context, flush all the work now.
GrFlushInfo flushInfoSyncCpu; context->flush();
flushInfoSyncCpu.fFlags = kSyncCpu_GrFlushFlag;
context->flush(flushInfoSyncCpu);
context->submit(true); context->submit(true);
} }
@ -1594,9 +1592,7 @@ protected:
// Some backends (e.g., Vulkan) require all work be completed for backend textures before // Some backends (e.g., Vulkan) require all work be completed for backend textures before
// they are deleted. Since we don't know when we'll next have access to a direct context, // they are deleted. Since we don't know when we'll next have access to a direct context,
// flush all the work now. // flush all the work now.
GrFlushInfo flushInfoSyncCpu; context->flush();
flushInfoSyncCpu.fFlags = kSyncCpu_GrFlushFlag;
context->flush(flushInfoSyncCpu);
context->submit(true); context->submit(true);
return true; return true;

View File

@ -225,12 +225,6 @@ enum GrGLBackendState {
*/ */
static const uint32_t kAll_GrBackendState = 0xffffffff; static const uint32_t kAll_GrBackendState = 0xffffffff;
enum GrFlushFlags {
kNone_GrFlushFlags = 0,
// Deprecated: Use syncCpu call on submit instead.
kSyncCpu_GrFlushFlag = 0x1,
};
typedef void* GrGpuFinishedContext; typedef void* GrGpuFinishedContext;
typedef void (*GrGpuFinishedProc)(GrGpuFinishedContext finishedContext); typedef void (*GrGpuFinishedProc)(GrGpuFinishedContext finishedContext);
@ -273,7 +267,6 @@ typedef void (*GrGpuSubmittedProc)(GrGpuSubmittedContext submittedContext, bool
* backend APIs the same in terms of how the submitted procs are treated. * backend APIs the same in terms of how the submitted procs are treated.
*/ */
struct GrFlushInfo { struct GrFlushInfo {
GrFlushFlags fFlags = kNone_GrFlushFlags;
int fNumSemaphores = 0; int fNumSemaphores = 0;
GrBackendSemaphore* fSignalSemaphores = nullptr; GrBackendSemaphore* fSignalSemaphores = nullptr;
GrGpuFinishedProc fFinishedProc = nullptr; GrGpuFinishedProc fFinishedProc = nullptr;

View File

@ -200,8 +200,8 @@ bool GrDrawingManager::flush(
SkDEBUGCODE(this->validate()); SkDEBUGCODE(this->validate());
if (kNone_GrFlushFlags == info.fFlags && !info.fNumSemaphores && !info.fFinishedProc && if (!info.fNumSemaphores && !info.fFinishedProc &&
access == SkSurface::BackendSurfaceAccess::kNoAccess && !newState) { access == SkSurface::BackendSurfaceAccess::kNoAccess && !newState) {
bool canSkip = numProxies > 0; bool canSkip = numProxies > 0;
for (int i = 0; i < numProxies && canSkip; ++i) { for (int i = 0; i < numProxies && canSkip; ++i) {
canSkip = !fDAG.isUsed(proxies[i]) && !this->isDDLTarget(proxies[i]); canSkip = !fDAG.isUsed(proxies[i]) && !this->isDDLTarget(proxies[i]);

View File

@ -753,10 +753,8 @@ sk_sp<SkImage> SkImage::MakeFromAHardwareBufferWithData(GrContext* context,
std::move(cs)); std::move(cs));
surfaceContext.writePixels(srcInfo, pixmap.addr(0, 0), pixmap.rowBytes(), {0, 0}); surfaceContext.writePixels(srcInfo, pixmap.addr(0, 0), pixmap.rowBytes(), {0, 0});
GrFlushInfo info;
info.fFlags = kSyncCpu_GrFlushFlag;
GrSurfaceProxy* p[1] = {surfaceContext.asSurfaceProxy()}; GrSurfaceProxy* p[1] = {surfaceContext.asSurfaceProxy()};
drawingManager->flush(p, 1, SkSurface::BackendSurfaceAccess::kNoAccess, info, nullptr); drawingManager->flush(p, 1, SkSurface::BackendSurfaceAccess::kNoAccess, {}, nullptr);
return image; return image;
} }

View File

@ -1089,9 +1089,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(DDLSkSurfaceFlush, reporter, ctxInfo) {
GrBackendApi::kMetal == context->backend()) { GrBackendApi::kMetal == context->backend()) {
// In order to receive the done callback with Vulkan we need to perform the equivalent // In order to receive the done callback with Vulkan we need to perform the equivalent
// of a glFinish // of a glFinish
GrFlushInfo flushInfoSyncCpu; s->flush();
flushInfoSyncCpu.fFlags = kSyncCpu_GrFlushFlag;
s->flush(SkSurface::BackendSurfaceAccess::kPresent, flushInfoSyncCpu);
context->submit(true); context->submit(true);
} }

View File

@ -126,9 +126,7 @@ DEF_GPUTEST_FOR_ALL_GL_CONTEXTS(GLTextureParameters, reporter, ctxInfo) {
REPORTER_ASSERT(reporter, GrBackendTexture::TestingOnly_Equals(invalidTexture, invalidTexture)); REPORTER_ASSERT(reporter, GrBackendTexture::TestingOnly_Equals(invalidTexture, invalidTexture));
wrappedImage.reset(); wrappedImage.reset();
GrFlushInfo flushInfo; context->flush();
flushInfo.fFlags = kSyncCpu_GrFlushFlag;
context->flush(flushInfo);
context->submit(true); context->submit(true);
context->deleteBackendTexture(backendTex); context->deleteBackendTexture(backendTex);
} }

View File

@ -47,9 +47,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(FlushFinishedProcTest, reporter, ctxInfo) {
canvas->clear(SK_ColorGREEN); canvas->clear(SK_ColorGREEN);
auto image = surface->makeImageSnapshot(); auto image = surface->makeImageSnapshot();
GrFlushInfo flushInfoSyncCpu; ctx->flush();
flushInfoSyncCpu.fFlags = kSyncCpu_GrFlushFlag;
ctx->flush(flushInfoSyncCpu);
ctx->submit(true); ctx->submit(true);
int count = 0; int count = 0;
@ -58,7 +56,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(FlushFinishedProcTest, reporter, ctxInfo) {
flushInfoFinishedProc.fFinishedProc = testing_finished_proc; flushInfoFinishedProc.fFinishedProc = testing_finished_proc;
flushInfoFinishedProc.fFinishedContext = (void*)&count; flushInfoFinishedProc.fFinishedContext = (void*)&count;
// There is no work on the surface so flushing may immediately call the finished proc. // There is no work on the surface so flushing may immediately call the finished proc.
surface->flush(SkSurface::BackendSurfaceAccess::kNoAccess, flushInfoFinishedProc); surface->flush(flushInfoFinishedProc);
ctx->submit(); ctx->submit();
REPORTER_ASSERT(reporter, count == 0 || count == 1); REPORTER_ASSERT(reporter, count == 0 || count == 1);
// Busy waiting should detect that the work is done. // Busy waiting should detect that the work is done.
@ -66,7 +64,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(FlushFinishedProcTest, reporter, ctxInfo) {
canvas->clear(SK_ColorRED); canvas->clear(SK_ColorRED);
surface->flush(SkSurface::BackendSurfaceAccess::kNoAccess, flushInfoFinishedProc); surface->flush(flushInfoFinishedProc);
ctx->submit(); ctx->submit();
bool expectAsyncCallback = bool expectAsyncCallback =
@ -82,7 +80,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(FlushFinishedProcTest, reporter, ctxInfo) {
} else { } else {
REPORTER_ASSERT(reporter, count == 2); REPORTER_ASSERT(reporter, count == 2);
} }
ctx->flush(flushInfoSyncCpu); ctx->flush();
ctx->submit(true); ctx->submit(true);
REPORTER_ASSERT(reporter, count == 2); REPORTER_ASSERT(reporter, count == 2);
@ -97,7 +95,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(FlushFinishedProcTest, reporter, ctxInfo) {
} else { } else {
REPORTER_ASSERT(reporter, count == 3); REPORTER_ASSERT(reporter, count == 3);
} }
ctx->flush(flushInfoSyncCpu); ctx->flush();
ctx->submit(true); ctx->submit(true);
REPORTER_ASSERT(reporter, count == 3); REPORTER_ASSERT(reporter, count == 3);
@ -112,7 +110,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(FlushFinishedProcTest, reporter, ctxInfo) {
} else { } else {
REPORTER_ASSERT(reporter, count == 4); REPORTER_ASSERT(reporter, count == 4);
} }
ctx->flush(flushInfoSyncCpu); ctx->flush();
ctx->submit(true); ctx->submit(true);
REPORTER_ASSERT(reporter, count == 4); REPORTER_ASSERT(reporter, count == 4);
@ -125,7 +123,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(FlushFinishedProcTest, reporter, ctxInfo) {
count = 0; count = 0;
int count2 = 0; int count2 = 0;
canvas->clear(SK_ColorGREEN); canvas->clear(SK_ColorGREEN);
surface->flush(SkSurface::BackendSurfaceAccess::kNoAccess, flushInfoFinishedProc); surface->flush(flushInfoFinishedProc);
ctx->submit(); ctx->submit();
// There is no work to be flushed here so this will return immediately, but make sure the // There is no work to be flushed here so this will return immediately, but make sure the
// finished call from this proc isn't called till the previous surface flush also is finished. // finished call from this proc isn't called till the previous surface flush also is finished.
@ -134,7 +132,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(FlushFinishedProcTest, reporter, ctxInfo) {
ctx->submit(); ctx->submit();
REPORTER_ASSERT(reporter, count <= 1 && count2 <= count); REPORTER_ASSERT(reporter, count <= 1 && count2 <= count);
ctx->flush(flushInfoSyncCpu); ctx->flush();
ctx->submit(true); ctx->submit(true);
REPORTER_ASSERT(reporter, count == 1); REPORTER_ASSERT(reporter, count == 1);

View File

@ -1393,15 +1393,13 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(ImageFlush, reporter, ctxInfo) {
REPORTER_ASSERT(reporter, numSubmits() == 3); REPORTER_ASSERT(reporter, numSubmits() == 3);
// Syncing forces the flush to happen even if the images aren't used. // Syncing forces the flush to happen even if the images aren't used.
GrFlushInfo syncInfo; i0->flush(c);
syncInfo.fFlags = kSyncCpu_GrFlushFlag;
i0->flush(c, syncInfo);
c->submit(true); c->submit(true);
REPORTER_ASSERT(reporter, numSubmits() == 1); REPORTER_ASSERT(reporter, numSubmits() == 1);
i1->flush(c, syncInfo); i1->flush(c);
c->submit(true); c->submit(true);
REPORTER_ASSERT(reporter, numSubmits() == 1); REPORTER_ASSERT(reporter, numSubmits() == 1);
i2->flush(c, syncInfo); i2->flush(c);
c->submit(true); c->submit(true);
REPORTER_ASSERT(reporter, numSubmits() == 1); REPORTER_ASSERT(reporter, numSubmits() == 1);

View File

@ -975,9 +975,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceWrappedWithRelease_Gpu, reporter, ctxI
} }
surface->getCanvas()->clear(SK_ColorRED); surface->getCanvas()->clear(SK_ColorRED);
GrFlushInfo info; surface->flush();
info.fFlags = kSyncCpu_GrFlushFlag;
surface->flush(SkSurface::BackendSurfaceAccess::kNoAccess, info);
ctx->submit(true); ctx->submit(true);
// Now exercise the release proc // Now exercise the release proc

View File

@ -142,9 +142,7 @@ bool CreateBackendTexture(GrContext* context,
} }
void DeleteBackendTexture(GrContext* context, const GrBackendTexture& backendTex) { void DeleteBackendTexture(GrContext* context, const GrBackendTexture& backendTex) {
GrFlushInfo flushInfo; context->flush();
flushInfo.fFlags = kSyncCpu_GrFlushFlag;
context->flush(flushInfo);
context->submit(true); context->submit(true);
context->deleteBackendTexture(backendTex); context->deleteBackendTexture(backendTex);
} }

View File

@ -357,9 +357,7 @@ bool EGLTestHelper::importAndWaitOnSemaphore(skiatest::Reporter* reporter, int f
} }
void EGLTestHelper::doClientSync() { void EGLTestHelper::doClientSync() {
GrFlushInfo flushInfo; this->grContext()->flush();
flushInfo.fFlags = kSyncCpu_GrFlushFlag;
this->grContext()->flush(flushInfo);
this->grContext()->submit(true); this->grContext()->submit(true);
} }
#endif // SK_GL #endif // SK_GL

View File

@ -179,9 +179,7 @@ DEF_GPUTEST(VkProtectedContext_DrawRectangle, reporter, options) {
paint.setColor(SK_ColorBLACK); paint.setColor(SK_ColorBLACK);
canvas->drawRect(SkRect::MakeWH(4, 4), paint); canvas->drawRect(SkRect::MakeWH(4, 4), paint);
GrFlushInfo flushInfo; surface->flush();
flushInfo.fFlags = kSyncCpu_GrFlushFlag;
surface->flush(SkSurface::BackendSurfaceAccess::kNoAccess, flushInfo);
surface->getContext()->submit(true); surface->getContext()->submit(true);
protectedTestHelper->grContext()->deleteBackendTexture( protectedTestHelper->grContext()->deleteBackendTexture(
surface->getBackendTexture(SkSurface::kFlushRead_BackendHandleAccess)); surface->getBackendTexture(SkSurface::kFlushRead_BackendHandleAccess));
@ -203,9 +201,7 @@ DEF_GPUTEST(VkProtectedContext_DrawRectangleWithAntiAlias, reporter, options) {
paint.setAntiAlias(true); paint.setAntiAlias(true);
canvas->drawRect(SkRect::MakeWH(4, 4), paint); canvas->drawRect(SkRect::MakeWH(4, 4), paint);
GrFlushInfo flushInfo; surface->flush();
flushInfo.fFlags = kSyncCpu_GrFlushFlag;
surface->flush(SkSurface::BackendSurfaceAccess::kNoAccess, flushInfo);
surface->getContext()->submit(true); surface->getContext()->submit(true);
protectedTestHelper->grContext()->deleteBackendTexture( protectedTestHelper->grContext()->deleteBackendTexture(
surface->getBackendTexture(SkSurface::kFlushRead_BackendHandleAccess)); surface->getBackendTexture(SkSurface::kFlushRead_BackendHandleAccess));
@ -227,9 +223,7 @@ DEF_GPUTEST(VkProtectedContext_DrawRectangleWithBlendMode, reporter, options) {
paint.setBlendMode(SkBlendMode::kColorDodge); paint.setBlendMode(SkBlendMode::kColorDodge);
canvas->drawRect(SkRect::MakeWH(4, 4), paint); canvas->drawRect(SkRect::MakeWH(4, 4), paint);
GrFlushInfo flushInfo; surface->flush();
flushInfo.fFlags = kSyncCpu_GrFlushFlag;
surface->flush(SkSurface::BackendSurfaceAccess::kNoAccess, flushInfo);
surface->getContext()->submit(true); surface->getContext()->submit(true);
protectedTestHelper->grContext()->deleteBackendTexture( protectedTestHelper->grContext()->deleteBackendTexture(
surface->getBackendTexture(SkSurface::kFlushRead_BackendHandleAccess)); surface->getBackendTexture(SkSurface::kFlushRead_BackendHandleAccess));
@ -253,9 +247,7 @@ DEF_GPUTEST(VkProtectedContext_DrawRectangleWithFilter, reporter, options) {
SkBlurStyle::kOuter_SkBlurStyle, 1.1f)); SkBlurStyle::kOuter_SkBlurStyle, 1.1f));
canvas->drawRect(SkRect::MakeWH(4, 4), paint); canvas->drawRect(SkRect::MakeWH(4, 4), paint);
GrFlushInfo flushInfo; surface->flush();
flushInfo.fFlags = kSyncCpu_GrFlushFlag;
surface->flush(SkSurface::BackendSurfaceAccess::kNoAccess, flushInfo);
surface->getContext()->submit(true); surface->getContext()->submit(true);
protectedTestHelper->grContext()->deleteBackendTexture( protectedTestHelper->grContext()->deleteBackendTexture(
surface->getBackendTexture(SkSurface::kFlushRead_BackendHandleAccess)); surface->getBackendTexture(SkSurface::kFlushRead_BackendHandleAccess));
@ -279,9 +271,7 @@ DEF_GPUTEST(VkProtectedContext_DrawThinPath, reporter, options) {
paint.setStrokeWidth(.4f); paint.setStrokeWidth(.4f);
canvas->drawPath(SkPath().moveTo(4, 4).lineTo(6, 6), paint); canvas->drawPath(SkPath().moveTo(4, 4).lineTo(6, 6), paint);
GrFlushInfo flushInfo; surface->flush();
flushInfo.fFlags = kSyncCpu_GrFlushFlag;
surface->flush(SkSurface::BackendSurfaceAccess::kNoAccess, flushInfo);
surface->getContext()->submit(true); surface->getContext()->submit(true);
protectedTestHelper->grContext()->deleteBackendTexture( protectedTestHelper->grContext()->deleteBackendTexture(
surface->getBackendTexture(SkSurface::kFlushRead_BackendHandleAccess)); surface->getBackendTexture(SkSurface::kFlushRead_BackendHandleAccess));
@ -304,9 +294,7 @@ DEF_GPUTEST(VkProtectedContext_SaveLayer, reporter, options) {
canvas->drawRect(SkRect::MakeWH(4, 4), paint); canvas->drawRect(SkRect::MakeWH(4, 4), paint);
canvas->restore(); canvas->restore();
GrFlushInfo flushInfo; surface->flush();
flushInfo.fFlags = kSyncCpu_GrFlushFlag;
surface->flush(SkSurface::BackendSurfaceAccess::kNoAccess, flushInfo);
surface->getContext()->submit(true); surface->getContext()->submit(true);
protectedTestHelper->grContext()->deleteBackendTexture( protectedTestHelper->grContext()->deleteBackendTexture(
surface->getBackendTexture(SkSurface::kFlushRead_BackendHandleAccess)); surface->getBackendTexture(SkSurface::kFlushRead_BackendHandleAccess));
@ -334,13 +322,11 @@ DEF_GPUTEST(VkProtectedContext_DrawProtectedImageOnProtectedSurface, reporter, o
canvas->drawImage(image, 0, 0); canvas->drawImage(image, 0, 0);
GrFlushInfo flushInfo; surface1->flush();
flushInfo.fFlags = kSyncCpu_GrFlushFlag;
surface1->flush(SkSurface::BackendSurfaceAccess::kNoAccess, flushInfo);
surface1->getContext()->submit(true); surface1->getContext()->submit(true);
protectedTestHelper->grContext()->deleteBackendTexture( protectedTestHelper->grContext()->deleteBackendTexture(
surface1->getBackendTexture(SkSurface::kFlushRead_BackendHandleAccess)); surface1->getBackendTexture(SkSurface::kFlushRead_BackendHandleAccess));
surface2->flush(SkSurface::BackendSurfaceAccess::kNoAccess, flushInfo); surface2->flush();
surface2->getContext()->submit(true); surface2->getContext()->submit(true);
protectedTestHelper->grContext()->deleteBackendTexture( protectedTestHelper->grContext()->deleteBackendTexture(
surface2->getBackendTexture(SkSurface::kFlushRead_BackendHandleAccess)); surface2->getBackendTexture(SkSurface::kFlushRead_BackendHandleAccess));

View File

@ -91,13 +91,10 @@ void YUVABackendReleaseContext::Unwind(GrContext* context, YUVABackendReleaseCon
// Some backends (e.g., Vulkan) require that all work associated w/ texture // Some backends (e.g., Vulkan) require that all work associated w/ texture
// creation be completed before deleting the textures. // creation be completed before deleting the textures.
if (fullFlush) { if (fullFlush) {
// If the release context client performed some operations other than backend texture // If the release context client performed some operations other than backend texture
// creation then we may require a full flush to ensure that all the work is completed. // creation then we may require a full flush to ensure that all the work is completed.
GrFlushInfo flushInfoSyncCpu; context->flush();
flushInfoSyncCpu.fFlags = kSyncCpu_GrFlushFlag;
context->flush(flushInfoSyncCpu);
context->submit(true); context->submit(true);
} else { } else {
context->submit(); context->submit();

View File

@ -324,9 +324,7 @@ static void run_ddl_benchmark(sk_gpu_test::TestContext* testContext, GrContext *
// Make sure the gpu has finished all its work before we exit this function and delete the // Make sure the gpu has finished all its work before we exit this function and delete the
// fence. // fence.
GrFlushInfo flushInfo; context->flush();
flushInfo.fFlags = kSyncCpu_GrFlushFlag;
context->flush(flushInfo);
context->submit(true); context->submit(true);
promiseImageHelper.deleteAllFromGPU(nullptr, context); promiseImageHelper.deleteAllFromGPU(nullptr, context);
@ -364,9 +362,7 @@ static void run_benchmark(GrContext* context, SkSurface* surface, SkpProducer* s
// Make sure the gpu has finished all its work before we exit this function and delete the // Make sure the gpu has finished all its work before we exit this function and delete the
// fence. // fence.
GrFlushInfo flushInfo; surface->flush();
flushInfo.fFlags = kSyncCpu_GrFlushFlag;
surface->flush(SkSurface::BackendSurfaceAccess::kNoAccess, flushInfo);
context->submit(true); context->submit(true);
} }
@ -434,9 +430,7 @@ static void run_gpu_time_benchmark(sk_gpu_test::GpuTimer* gpuTimer, GrContext* c
// Make sure the gpu has finished all its work before we exit this function and delete the // Make sure the gpu has finished all its work before we exit this function and delete the
// fence. // fence.
GrFlushInfo flushInfo; surface->flush();
flushInfo.fFlags = kSyncCpu_GrFlushFlag;
surface->flush(SkSurface::BackendSurfaceAccess::kNoAccess, flushInfo);
context->submit(true); context->submit(true);
} }