Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions shell/platform/fuchsia/flutter/vulkan_surface_pool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "vulkan_surface_pool.h"

#include <lib/fdio/directory.h>
#include <lib/zx/process.h>

#include <algorithm>
#include <string>
Expand All @@ -14,6 +15,20 @@

namespace flutter_runner {

static std::string GetCurrentProcessName() {
char name[ZX_MAX_NAME_LEN];
zx_status_t status =
zx::process::self()->get_property(ZX_PROP_NAME, name, sizeof(name));
return status == ZX_OK ? std::string(name) : std::string();
}

static zx_koid_t GetCurrentProcessId() {
zx_info_handle_basic_t info;
zx_status_t status = zx::process::self()->get_info(
ZX_INFO_HANDLE_BASIC, &info, sizeof(info), nullptr, nullptr);
return status == ZX_OK ? info.koid : ZX_KOID_INVALID;
}

VulkanSurfacePool::VulkanSurfacePool(vulkan::VulkanProvider& vulkan_provider,
sk_sp<GrDirectContext> context,
scenic::Session* scenic_session)
Expand All @@ -23,6 +38,8 @@ VulkanSurfacePool::VulkanSurfacePool(vulkan::VulkanProvider& vulkan_provider,
zx_status_t status = fdio_service_connect(
"/svc/fuchsia.sysmem.Allocator",
sysmem_allocator_.NewRequest().TakeChannel().release());
sysmem_allocator_->SetDebugClientInfo(GetCurrentProcessName(),
GetCurrentProcessId());
FML_DCHECK(status != ZX_OK);
}

Expand Down