#include "gpu/command_buffer/service/shared_image/angle_vulkan_image_backing.h"
#include "base/logging.h"
#include "components/viz/common/gpu/vulkan_context_provider.h"
#include "components/viz/common/resources/shared_image_format_utils.h"
#include "gpu/command_buffer/common/shared_image_usage.h"
#include "gpu/command_buffer/service/shared_image/shared_image_format_service_utils.h"
#include "gpu/command_buffer/service/shared_image/shared_image_gl_utils.h"
#include "gpu/command_buffer/service/shared_image/shared_image_representation.h"
#include "gpu/command_buffer/service/shared_image/skia_gl_image_representation.h"
#include "gpu/command_buffer/service/skia_utils.h"
#include "gpu/vulkan/vulkan_device_queue.h"
#include "gpu/vulkan/vulkan_fence_helper.h"
#include "gpu/vulkan/vulkan_image.h"
#include "gpu/vulkan/vulkan_implementation.h"
#include "gpu/vulkan/vulkan_util.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkColorSpace.h"
#include "third_party/skia/include/gpu/MutableTextureState.h"
#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
#include "third_party/skia/include/gpu/ganesh/vk/GrVkBackendSurface.h"
#include "third_party/skia/include/private/chromium/GrPromiseImageTexture.h"
#include "ui/gl/egl_util.h"
#include "ui/gl/gl_context.h"
#include "ui/gl/scoped_egl_image.h"
#include "ui/gl/scoped_restore_texture.h"
#define EGL_TEXTURE_INTERNAL_FORMAT_ANGLE …
#define EGL_VULKAN_IMAGE_ANGLE …
#define EGL_VULKAN_IMAGE_CREATE_INFO_HI_ANGLE …
#define EGL_VULKAN_IMAGE_CREATE_INFO_LO_ANGLE …
namespace gpu {
namespace {
gl::ScopedEGLImage CreateEGLImage(VkImage image,
const VkImageCreateInfo* create_info,
unsigned int internal_format) { … }
}
class AngleVulkanImageBacking::
GLTexturePassthroughAngleVulkanImageRepresentation
: public GLTexturePassthroughImageRepresentation { … };
class AngleVulkanImageBacking::SkiaAngleVulkanImageRepresentation
: public SkiaGaneshImageRepresentation { … };
AngleVulkanImageBacking::AngleVulkanImageBacking(
scoped_refptr<SharedContextState> context_state,
const Mailbox& mailbox,
viz::SharedImageFormat format,
const gfx::Size& size,
const gfx::ColorSpace& color_space,
GrSurfaceOrigin surface_origin,
SkAlphaType alpha_type,
gpu::SharedImageUsageSet usage,
std::string debug_label)
: … { … }
AngleVulkanImageBacking::~AngleVulkanImageBacking() { … }
bool AngleVulkanImageBacking::Initialize(
const base::span<const uint8_t>& data) { … }
bool AngleVulkanImageBacking::InitializeWihGMB(
gfx::GpuMemoryBufferHandle handle) { … }
SharedImageBackingType AngleVulkanImageBacking::GetType() const { … }
bool AngleVulkanImageBacking::UploadFromMemory(
const std::vector<SkPixmap>& pixmaps) { … }
void AngleVulkanImageBacking::Update(std::unique_ptr<gfx::GpuFence> in_fence) { … }
std::unique_ptr<GLTexturePassthroughImageRepresentation>
AngleVulkanImageBacking::ProduceGLTexturePassthrough(
SharedImageManager* manager,
MemoryTypeTracker* tracker) { … }
std::unique_ptr<SkiaGaneshImageRepresentation>
AngleVulkanImageBacking::ProduceSkiaGanesh(
SharedImageManager* manager,
MemoryTypeTracker* tracker,
scoped_refptr<SharedContextState> context_state) { … }
bool AngleVulkanImageBacking::BeginAccessGLTexturePassthrough(GLenum mode) { … }
void AngleVulkanImageBacking::EndAccessGLTexturePassthrough(GLenum mode) { … }
std::vector<sk_sp<GrPromiseImageTexture>>
AngleVulkanImageBacking::GetPromiseTextures() { … }
void AngleVulkanImageBacking::AcquireTextureANGLE() { … }
void AngleVulkanImageBacking::ReleaseTextureANGLE() { … }
void AngleVulkanImageBacking::PrepareBackendTexture() { … }
void AngleVulkanImageBacking::SyncImageLayoutFromBackendTexture() { … }
bool AngleVulkanImageBacking::BeginAccessSkia(bool readonly) { … }
void AngleVulkanImageBacking::EndAccessSkia() { … }
bool AngleVulkanImageBacking::InitializePassthroughTexture() { … }
AngleVulkanImageBacking::TextureHolderGL::TextureHolderGL() = default;
AngleVulkanImageBacking::TextureHolderGL::TextureHolderGL(
TextureHolderGL&& other) = default;
AngleVulkanImageBacking::TextureHolderGL&
AngleVulkanImageBacking::TextureHolderGL::operator=(TextureHolderGL&& other) =
default;
AngleVulkanImageBacking::TextureHolderGL::~TextureHolderGL() = default;
}