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

Commit 76efc4a3 authored by Noelle Scobie's avatar Noelle Scobie
Browse files

Merge duplicate APIs in VulkanInterface

Now that the Ganesh and Graphite share the same VulkanBackendContext
type, the two `getGaneshBackendContext` and `getGraphiteBackendContext`
functions on RenderEngine's VulanInterface can be merged.

I've tweaked the name to `createSkiaVulkanBackendContext` for clarity.

Bug: b/309785258
Test: compiles (refactor)
Flag: EXEMPT trivial refactor
Change-Id: I84aa3f4f2e06cf660dfc13be68795843596d0809
parent 528f45c5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ static void unref_semaphore(void* semaphore) {

std::unique_ptr<SkiaGpuContext> GaneshVkRenderEngine::createContext(
        VulkanInterface& vulkanInterface) {
    return SkiaGpuContext::MakeVulkan_Ganesh(vulkanInterface.getGaneshBackendContext(),
    return SkiaGpuContext::MakeVulkan_Ganesh(vulkanInterface.createSkiaVulkanBackendContext(),
                                             mSkSLCacheMonitor);
}

+1 −1
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ static void unref_semaphore(void* semaphore, skgpu::CallbackResult result) {

std::unique_ptr<SkiaGpuContext> GraphiteVkRenderEngine::createContext(
        VulkanInterface& vulkanInterface) {
    return SkiaGpuContext::MakeVulkan_Graphite(vulkanInterface.getGraphiteBackendContext());
    return SkiaGpuContext::MakeVulkan_Graphite(vulkanInterface.createSkiaVulkanBackendContext());
}

void GraphiteVkRenderEngine::waitFence(SkiaGpuContext*, base::borrowed_fd fenceFd) {
+1 −5
Original line number Diff line number Diff line
@@ -32,11 +32,7 @@ namespace android {
namespace renderengine {
namespace skia {

VulkanBackendContext VulkanInterface::getGaneshBackendContext() {
    return this->getGraphiteBackendContext();
};

VulkanBackendContext VulkanInterface::getGraphiteBackendContext() {
VulkanBackendContext VulkanInterface::createSkiaVulkanBackendContext() {
    VulkanBackendContext backendContext;
    backendContext.fInstance = mInstance;
    backendContext.fPhysicalDevice = mPhysicalDevice;
+1 −3
Original line number Diff line number Diff line
@@ -44,9 +44,7 @@ public:
    bool takeOwnership();
    void teardown();

    // TODO(b/309785258) Combine these into one now that they are the same implementation.
    VulkanBackendContext getGaneshBackendContext();
    VulkanBackendContext getGraphiteBackendContext();
    VulkanBackendContext createSkiaVulkanBackendContext();
    VkSemaphore createExportableSemaphore();
    VkSemaphore importSemaphoreFromSyncFd(int syncFd);
    int exportSemaphoreSyncFd(VkSemaphore semaphore);