Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa592d0e authored by Kevin Lubick's avatar Kevin Lubick
Browse files

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
parent 7b7ae341
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -175,7 +175,7 @@ IRenderPipeline::DrawResult SkiaOpenGLPipeline::draw(


    {
    {
        ATRACE_NAME("flush commands");
        ATRACE_NAME("flush commands");
        surface->flushAndSubmit();
        skgpu::ganesh::FlushAndSubmit(surface);
    }
    }
    layerUpdateQueue->clear();
    layerUpdateQueue->clear();


+3 −3
Original line number Original line Diff line number Diff line
@@ -518,7 +518,7 @@ Frame VulkanManager::dequeueNextBuffer(VulkanSurface* surface) {
                        // The following flush blocks the GPU immediately instead of waiting for
                        // The following flush blocks the GPU immediately instead of waiting for
                        // other drawing ops. It seems dequeue_fence is not respected otherwise.
                        // other drawing ops. It seems dequeue_fence is not respected otherwise.
                        // TODO: remove the flush after finding why backendSemaphore is not working.
                        // TODO: remove the flush after finding why backendSemaphore is not working.
                        bufferInfo->skSurface->flushAndSubmit();
                        skgpu::ganesh::FlushAndSubmit(bufferInfo->skSurface);
                    }
                    }
                }
                }
            }
            }
@@ -586,10 +586,10 @@ nsecs_t VulkanManager::finishFrame(SkSurface* surface) {
    } else {
    } else {
        semaphore = VK_NULL_HANDLE;
        semaphore = VK_NULL_HANDLE;
    }
    }
    GrSemaphoresSubmitted submitted =
            surface->flush(SkSurface::BackendSurfaceAccess::kPresent, flushInfo);
    GrDirectContext* context = GrAsDirectContext(surface->recordingContext());
    GrDirectContext* context = GrAsDirectContext(surface->recordingContext());
    ALOGE_IF(!context, "Surface is not backed by gpu");
    ALOGE_IF(!context, "Surface is not backed by gpu");
    GrSemaphoresSubmitted submitted = context->flush(
            surface, SkSurfaces::BackendSurfaceAccess::kPresent, flushInfo);
    context->submit();
    context->submit();
    const nsecs_t submissionTime = systemTime();
    const nsecs_t submissionTime = systemTime();
    if (semaphore != VK_NULL_HANDLE) {
    if (semaphore != VK_NULL_HANDLE) {