gtk/gsk/vulkan/gskvulkanrendererprivate.h
Benjamin Otte ba502a5009 vulkan: Split texture caching code
Instead of having one function that gets the image for the texture and
uploads it if it doesn't exist yet, make it 2 functions:

One to get the texture if it exists.
One to assign an uploaded image to the texture.

This way, we can potentially do the upload ourselves.
2023-07-16 12:12:36 +02:00

58 lines
2.4 KiB
C

#pragma once
#include "gskvulkanrenderer.h"
#include "gskvulkanimageprivate.h"
G_BEGIN_DECLS
GskVulkanImage * gsk_vulkan_renderer_get_texture_image (GskVulkanRenderer *self,
GdkTexture *texture);
void gsk_vulkan_renderer_add_texture_image (GskVulkanRenderer *self,
GdkTexture *texture,
GskVulkanImage *image);
GskVulkanImage * gsk_vulkan_renderer_ref_texture_image (GskVulkanRenderer *self,
GdkTexture *texture,
GskVulkanUploader *uploader);
typedef struct
{
guint texture_index;
float tx;
float ty;
float tw;
float th;
int draw_x;
int draw_y;
int draw_width;
int draw_height;
int atlas_x;
int atlas_y;
guint64 timestamp;
} GskVulkanCachedGlyph;
guint gsk_vulkan_renderer_cache_glyph (GskVulkanRenderer *renderer,
PangoFont *font,
PangoGlyph glyph,
int x,
int y,
float scale);
GskVulkanImage * gsk_vulkan_renderer_ref_glyph_image (GskVulkanRenderer *self,
GskVulkanUploader *uploader,
guint index);
GskVulkanCachedGlyph * gsk_vulkan_renderer_get_cached_glyph (GskVulkanRenderer *self,
PangoFont *font,
PangoGlyph glyph,
int x,
int y,
float scale);
G_END_DECLS