From cccd5fef0a67dca2864f137b35e66ae4113e2e60 Mon Sep 17 00:00:00 2001 From: Kevin Lubick Date: Wed, 12 Jul 2023 19:54:27 +0000 Subject: [PATCH] Flush GrDirectContext directly In http://review.skia.org/716476, Skia removed SkCanvas::flush() so this replaces that call with a direct call to flushAndSubmit() on the (known-to-be-non-null) GrDirectContext (the previous behavior). Change-Id: I6df29c328b2fcf5032d27bf65d87e50c2f04c3e0 --- libs/hwui/pipeline/skia/GLFunctorDrawable.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/hwui/pipeline/skia/GLFunctorDrawable.cpp b/libs/hwui/pipeline/skia/GLFunctorDrawable.cpp index d7ac501b9c912..dbd9ef3c9e4cf 100644 --- a/libs/hwui/pipeline/skia/GLFunctorDrawable.cpp +++ b/libs/hwui/pipeline/skia/GLFunctorDrawable.cpp @@ -79,7 +79,7 @@ void GLFunctorDrawable::onDraw(SkCanvas* canvas) { } // flush will create a GrRenderTarget if not already present. - canvas->flush(); + directContext->flushAndSubmit(); GLuint fboID = 0; SkISize fboSize; @@ -167,7 +167,7 @@ void GLFunctorDrawable::onDraw(SkCanvas* canvas) { // GL ops get inserted here if previous flush is missing, which could dirty the stencil bool stencilWritten = SkAndroidFrameworkUtils::clipWithStencil(tmpCanvas); - tmpCanvas->flush(); // need this flush for the single op that draws into the stencil + directContext->flushAndSubmit(); // need this flush for the single op that draws into the stencil // ensure that the framebuffer that the webview will render into is bound before after we // draw into the stencil