mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 13:41:07 +00:00
30dddf2412
Instead of having renderer API to wait for any number of frames, just have gsk_gpu_frame_wait() to wait for a single frame. This unifies behavior on Vulkan and GL, because unlike Vulkan, GL does not allow waiting for multiple fences. To make up for it, we replace waiting for multiple frames with finding the frame with the earliest timestamp and waiting for that one. Also implement wait() for GL.
49 lines
2.2 KiB
C
49 lines
2.2 KiB
C
#pragma once
|
|
|
|
#include "gskgpurenderer.h"
|
|
|
|
#include "gskgputypesprivate.h"
|
|
#include "gskrendererprivate.h"
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
#define GSK_GPU_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GSK_TYPE_GPU_RENDERER, GskGpuRendererClass))
|
|
#define GSK_IS_GPU_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GSK_TYPE_GPU_RENDERER))
|
|
#define GSK_GPU_RENDERER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GSK_TYPE_GPU_RENDERER, GskGpuRendererClass))
|
|
|
|
typedef struct _GskGpuRendererClass GskGpuRendererClass;
|
|
|
|
struct _GskGpuRenderer
|
|
{
|
|
GskRenderer parent_instance;
|
|
};
|
|
|
|
struct _GskGpuRendererClass
|
|
{
|
|
GskRendererClass parent_class;
|
|
|
|
GType frame_type;
|
|
GskGpuOptimizations optimizations; /* subclasses cannot override this */
|
|
|
|
GskGpuDevice * (* get_device) (GdkDisplay *display,
|
|
GError **error);
|
|
GdkDrawContext * (* create_context) (GskGpuRenderer *self,
|
|
GdkDisplay *display,
|
|
GdkSurface *surface,
|
|
GskGpuOptimizations *supported,
|
|
GError **error);
|
|
|
|
void (* make_current) (GskGpuRenderer *self);
|
|
GskGpuImage * (* get_backbuffer) (GskGpuRenderer *self);
|
|
|
|
double (* get_scale) (GskGpuRenderer *self);
|
|
GdkDmabufFormats * (* get_dmabuf_formats) (GskGpuRenderer *self);
|
|
};
|
|
|
|
GdkDrawContext * gsk_gpu_renderer_get_context (GskGpuRenderer *self);
|
|
GskGpuDevice * gsk_gpu_renderer_get_device (GskGpuRenderer *self);
|
|
double gsk_gpu_renderer_get_scale (GskGpuRenderer *self);
|
|
|
|
G_END_DECLS
|
|
|