Migrate SkSurface::flush methods to skgpu::ganesh version
Follow-up part 1 to https://skia-review.googlesource.com/c/skia/+/698237
It was not obvious to me where the correct GrDirectContext would
be for these surfaces, so I used the helper to extract the context
from the surface (if one exists) and use that.
Change-Id: I477d82659767d581cc6a7b7df36bd471796b11e9
diff --git a/libs/hwui/renderthread/VulkanManager.cpp b/libs/hwui/renderthread/VulkanManager.cpp
index 8e0eb08..d222531 100644
--- a/libs/hwui/renderthread/VulkanManager.cpp
+++ b/libs/hwui/renderthread/VulkanManager.cpp
@@ -518,7 +518,7 @@
// The following flush blocks the GPU immediately instead of waiting for
// other drawing ops. It seems dequeue_fence is not respected otherwise.
// TODO: remove the flush after finding why backendSemaphore is not working.
- bufferInfo->skSurface->flushAndSubmit();
+ skgpu::ganesh::FlushAndSubmit(bufferInfo->skSurface);
}
}
}
@@ -586,10 +586,10 @@
} else {
semaphore = VK_NULL_HANDLE;
}
- GrSemaphoresSubmitted submitted =
- surface->flush(SkSurface::BackendSurfaceAccess::kPresent, flushInfo);
GrDirectContext* context = GrAsDirectContext(surface->recordingContext());
ALOGE_IF(!context, "Surface is not backed by gpu");
+ GrSemaphoresSubmitted submitted = context->flush(
+ surface, SkSurfaces::BackendSurfaceAccess::kPresent, flushInfo);
context->submit();
const nsecs_t submissionTime = systemTime();
if (semaphore != VK_NULL_HANDLE) {