diff options
author | Benjamin Otte <otte@redhat.com> | 2017-11-02 21:39:00 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2017-11-04 00:07:13 +0100 |
commit | ca3c23662cfe515d7de348aa42d07be7d4bb3e83 (patch) | |
tree | 725bde3b54c44588e2a7312fded868fb7a1facd5 /gsk | |
parent | 8ba9ae601283be265e59c6092d61c099f8a17d65 (diff) | |
download | gtk+-ca3c23662cfe515d7de348aa42d07be7d4bb3e83.tar.gz |
GskTexture => GdkTexture
We want this thing to replace GdkPixbuf, so it has to live in GDK.
Diffstat (limited to 'gsk')
-rw-r--r-- | gsk/gsk.h | 1 | ||||
-rw-r--r-- | gsk/gskcairorenderer.c | 8 | ||||
-rw-r--r-- | gsk/gskenums.h | 4 | ||||
-rw-r--r-- | gsk/gskgldriver.c | 18 | ||||
-rw-r--r-- | gsk/gskgldriverprivate.h | 4 | ||||
-rw-r--r-- | gsk/gskglrenderer.c | 12 | ||||
-rw-r--r-- | gsk/gskrenderer.c | 11 | ||||
-rw-r--r-- | gsk/gskrenderer.h | 2 | ||||
-rw-r--r-- | gsk/gskrendererprivate.h | 2 | ||||
-rw-r--r-- | gsk/gskrendernode.c | 1 | ||||
-rw-r--r-- | gsk/gskrendernode.h | 4 | ||||
-rw-r--r-- | gsk/gskrendernodeimpl.c | 88 | ||||
-rw-r--r-- | gsk/gsktexture.c | 559 | ||||
-rw-r--r-- | gsk/gsktexture.h | 63 | ||||
-rw-r--r-- | gsk/gsktextureprivate.h | 49 | ||||
-rw-r--r-- | gsk/gsktypes.h | 2 | ||||
-rw-r--r-- | gsk/gskvulkanimage.c | 6 | ||||
-rw-r--r-- | gsk/gskvulkanimageprivate.h | 3 | ||||
-rw-r--r-- | gsk/gskvulkanrender.c | 2 | ||||
-rw-r--r-- | gsk/gskvulkanrenderer.c | 19 | ||||
-rw-r--r-- | gsk/gskvulkanrendererprivate.h | 2 | ||||
-rw-r--r-- | gsk/gskvulkanrenderpass.c | 8 | ||||
-rw-r--r-- | gsk/gskvulkanrenderprivate.h | 2 | ||||
-rw-r--r-- | gsk/meson.build | 4 |
24 files changed, 98 insertions, 776 deletions
@@ -24,7 +24,6 @@ #include <gsk/gskrenderer.h> #include <gsk/gskrendernode.h> #include <gsk/gskroundedrect.h> -#include <gsk/gsktexture.h> #include <gsk/gsktypes.h> #include <gsk/gskenumtypes.h> diff --git a/gsk/gskcairorenderer.c b/gsk/gskcairorenderer.c index af23d610f6..c4aa4e9ad7 100644 --- a/gsk/gskcairorenderer.c +++ b/gsk/gskcairorenderer.c @@ -5,7 +5,7 @@ #include "gskdebugprivate.h" #include "gskrendererprivate.h" #include "gskrendernodeprivate.h" -#include "gsktextureprivate.h" +#include "gdk/gdktextureprivate.h" #ifdef G_ENABLE_DEBUG typedef struct { @@ -70,12 +70,12 @@ gsk_cairo_renderer_do_render (GskRenderer *renderer, #endif } -static GskTexture * +static GdkTexture * gsk_cairo_renderer_render_texture (GskRenderer *renderer, GskRenderNode *root, const graphene_rect_t *viewport) { - GskTexture *texture; + GdkTexture *texture; cairo_surface_t *surface; cairo_t *cr; @@ -88,7 +88,7 @@ gsk_cairo_renderer_render_texture (GskRenderer *renderer, cairo_destroy (cr); - texture = gsk_texture_new_for_surface (surface); + texture = gdk_texture_new_for_surface (surface); cairo_surface_destroy (surface); return texture; diff --git a/gsk/gskenums.h b/gsk/gskenums.h index ca9d5a8e56..8a242ff2b8 100644 --- a/gsk/gskenums.h +++ b/gsk/gskenums.h @@ -31,7 +31,7 @@ * @GSK_LINEAR_GRADIENT_NODE: A node drawing a linear gradient * @GSK_REPEATING_LINEAR_GRADIENT_NODE: A node drawing a repeating linear gradient * @GSK_BORDER_NODE: A node stroking a border around an area - * @GSK_TEXTURE_NODE: A node drawing a #GskTexture + * @GDK_TEXTURE_NODE: A node drawing a #GdkTexture * @GSK_INSET_SHADOW_NODE: A node drawing an inset shadow * @GSK_OUTSET_SHADOW_NODE: A node drawing an outset shadow * @GSK_TRANSFORM_NODE: A node that renders its child after applying a matrix transform @@ -58,7 +58,7 @@ typedef enum { GSK_LINEAR_GRADIENT_NODE, GSK_REPEATING_LINEAR_GRADIENT_NODE, GSK_BORDER_NODE, - GSK_TEXTURE_NODE, + GDK_TEXTURE_NODE, GSK_INSET_SHADOW_NODE, GSK_OUTSET_SHADOW_NODE, GSK_TRANSFORM_NODE, diff --git a/gsk/gskgldriver.c b/gsk/gskgldriver.c index ead05347fa..41c6f6ca82 100644 --- a/gsk/gskgldriver.c +++ b/gsk/gskgldriver.c @@ -3,7 +3,7 @@ #include "gskgldriverprivate.h" #include "gskdebugprivate.h" -#include "gsktextureprivate.h" +#include "gdk/gdktextureprivate.h" #include <gdk/gdk.h> #include <epoxy/gl.h> @@ -15,7 +15,7 @@ typedef struct { GLuint min_filter; GLuint mag_filter; GArray *fbos; - GskTexture *user; + GdkTexture *user; gboolean in_use : 1; } Texture; @@ -78,7 +78,7 @@ texture_free (gpointer data) Texture *t = data; if (t->user) - gsk_texture_clear_render_data (t->user); + gdk_texture_clear_render_data (t->user); g_clear_pointer (&t->fbos, g_array_unref); glDeleteTextures (1, &t->texture_id); @@ -439,7 +439,7 @@ gsk_gl_driver_release_texture (gpointer data) int gsk_gl_driver_get_texture_for_texture (GskGLDriver *driver, - GskTexture *texture, + GdkTexture *texture, int min_filter, int mag_filter) { @@ -447,9 +447,9 @@ gsk_gl_driver_get_texture_for_texture (GskGLDriver *driver, cairo_surface_t *surface; g_return_val_if_fail (GSK_IS_GL_DRIVER (driver), -1); - g_return_val_if_fail (GSK_IS_TEXTURE (texture), -1); + g_return_val_if_fail (GDK_IS_TEXTURE (texture), -1); - t = gsk_texture_get_render_data (texture, driver); + t = gdk_texture_get_render_data (texture, driver); if (t) { @@ -457,12 +457,12 @@ gsk_gl_driver_get_texture_for_texture (GskGLDriver *driver, return t->texture_id; } - t = create_texture (driver, gsk_texture_get_width (texture), gsk_texture_get_height (texture)); + t = create_texture (driver, gdk_texture_get_width (texture), gdk_texture_get_height (texture)); - if (gsk_texture_set_render_data (texture, driver, t, gsk_gl_driver_release_texture)) + if (gdk_texture_set_render_data (texture, driver, t, gsk_gl_driver_release_texture)) t->user = texture; - surface = gsk_texture_download_surface (texture); + surface = gdk_texture_download_surface (texture); gsk_gl_driver_bind_source_texture (driver, t->texture_id); gsk_gl_driver_init_texture_with_surface (driver, t->texture_id, diff --git a/gsk/gskgldriverprivate.h b/gsk/gskgldriverprivate.h index 64f9be1f81..955a2a8a99 100644 --- a/gsk/gskgldriverprivate.h +++ b/gsk/gskgldriverprivate.h @@ -5,8 +5,6 @@ #include <gdk/gdk.h> #include <graphene.h> -#include <gsk/gsktexture.h> - G_BEGIN_DECLS #define GSK_TYPE_GL_DRIVER (gsk_gl_driver_get_type ()) @@ -26,7 +24,7 @@ void gsk_gl_driver_begin_frame (GskGLDriver *driver void gsk_gl_driver_end_frame (GskGLDriver *driver); int gsk_gl_driver_get_texture_for_texture (GskGLDriver *driver, - GskTexture *texture, + GdkTexture *texture, int min_filter, int mag_filter); int gsk_gl_driver_create_texture (GskGLDriver *driver, diff --git a/gsk/gskglrenderer.c b/gsk/gskglrenderer.c index b899f2fd3b..d30e15524b 100644 --- a/gsk/gskglrenderer.c +++ b/gsk/gskglrenderer.c @@ -10,7 +10,7 @@ #include "gskrendererprivate.h" #include "gskrendernodeprivate.h" #include "gskshaderbuilderprivate.h" -#include "gsktextureprivate.h" +#include "gdk/gdktextureprivate.h" #include "gskprivate.h" @@ -798,9 +798,9 @@ gsk_gl_renderer_add_render_item (GskGLRenderer *self, switch (gsk_render_node_get_node_type (node)) { - case GSK_TEXTURE_NODE: + case GDK_TEXTURE_NODE: { - GskTexture *texture = gsk_texture_node_get_texture (node); + GdkTexture *texture = gdk_texture_node_get_texture (node); int gl_min_filter = GL_NEAREST, gl_mag_filter = GL_NEAREST; get_gl_scaling_filters (node, &gl_min_filter, &gl_mag_filter); @@ -1167,13 +1167,13 @@ gsk_gl_renderer_do_render (GskRenderer *renderer, #endif } -static GskTexture * +static GdkTexture * gsk_gl_renderer_render_texture (GskRenderer *renderer, GskRenderNode *root, const graphene_rect_t *viewport) { GskGLRenderer *self = GSK_GL_RENDERER (renderer); - GskTexture *texture; + GdkTexture *texture; cairo_surface_t *surface; cairo_t *cr; @@ -1203,7 +1203,7 @@ gsk_gl_renderer_render_texture (GskRenderer *renderer, viewport->size.height); cairo_destroy (cr); - texture = gsk_texture_new_for_surface (surface); + texture = gdk_texture_new_for_surface (surface); cairo_surface_destroy (surface); return texture; diff --git a/gsk/gskrenderer.c b/gsk/gskrenderer.c index f998c9de8e..c04bbc33de 100644 --- a/gsk/gskrenderer.c +++ b/gsk/gskrenderer.c @@ -42,7 +42,6 @@ #include "gskglrendererprivate.h" #include "gskprofilerprivate.h" #include "gskrendernodeprivate.h" -#include "gsktexture.h" #include "gskenumtypes.h" @@ -110,7 +109,7 @@ gsk_renderer_real_unrealize (GskRenderer *self) GSK_RENDERER_WARN_NOT_IMPLEMENTED_METHOD (self, unrealize); } -static GskTexture * +static GdkTexture * gsk_renderer_real_render_texture (GskRenderer *self, GskRenderNode *root, const graphene_rect_t *viewport) @@ -555,7 +554,7 @@ gsk_renderer_unrealize (GskRenderer *renderer) * @viewport: (allow-none): the section to draw or %NULL to use @root's bounds * * Renders the scene graph, described by a tree of #GskRenderNode instances, - * to a #GskTexture. + * to a #GdkTexture. * * The @renderer will acquire a reference on the #GskRenderNode tree while * the rendering is in progress, and will make the tree immutable. @@ -563,18 +562,18 @@ gsk_renderer_unrealize (GskRenderer *renderer) * If you want to apply any transformations to @root, you should put it into a * transform node and pass that node instead. * - * Returns: (transfer full): a #GskTexture with the rendered contents of @root. + * Returns: (transfer full): a #GdkTexture with the rendered contents of @root. * * Since: 3.90 */ -GskTexture * +GdkTexture * gsk_renderer_render_texture (GskRenderer *renderer, GskRenderNode *root, const graphene_rect_t *viewport) { GskRendererPrivate *priv = gsk_renderer_get_instance_private (renderer); graphene_rect_t real_viewport; - GskTexture *texture; + GdkTexture *texture; g_return_val_if_fail (GSK_IS_RENDERER (renderer), NULL); g_return_val_if_fail (priv->is_realized, NULL); diff --git a/gsk/gskrenderer.h b/gsk/gskrenderer.h index ab51bc1595..8ae8ff1575 100644 --- a/gsk/gskrenderer.h +++ b/gsk/gskrenderer.h @@ -61,7 +61,7 @@ GDK_AVAILABLE_IN_3_90 void gsk_renderer_unrealize (GskRenderer *renderer); GDK_AVAILABLE_IN_3_90 -GskTexture * gsk_renderer_render_texture (GskRenderer *renderer, +GdkTexture * gsk_renderer_render_texture (GskRenderer *renderer, GskRenderNode *root, const graphene_rect_t *viewport); diff --git a/gsk/gskrendererprivate.h b/gsk/gskrendererprivate.h index d9dbe9eca0..97ac374854 100644 --- a/gsk/gskrendererprivate.h +++ b/gsk/gskrendererprivate.h @@ -42,7 +42,7 @@ struct _GskRendererClass GError **error); void (* unrealize) (GskRenderer *renderer); - GskTexture * (* render_texture) (GskRenderer *renderer, + GdkTexture * (* render_texture) (GskRenderer *renderer, GskRenderNode *root, const graphene_rect_t *viewport); GdkDrawingContext * (* begin_draw_frame) (GskRenderer *renderer, diff --git a/gsk/gskrendernode.c b/gsk/gskrendernode.c index 4e4c31b58c..9cccce763b 100644 --- a/gsk/gskrendernode.c +++ b/gsk/gskrendernode.c @@ -42,7 +42,6 @@ #include "gskdebugprivate.h" #include "gskrendererprivate.h" -#include "gsktexture.h" #include <graphene-gobject.h> diff --git a/gsk/gskrendernode.h b/gsk/gskrendernode.h index c72cbd84bc..12967bd1dd 100644 --- a/gsk/gskrendernode.h +++ b/gsk/gskrendernode.h @@ -101,10 +101,10 @@ GDK_AVAILABLE_IN_3_94 const GdkRGBA * gsk_color_node_peek_color (GskRenderNode *node); GDK_AVAILABLE_IN_3_90 -GskRenderNode * gsk_texture_node_new (GskTexture *texture, +GskRenderNode * gdk_texture_node_new (GdkTexture *texture, const graphene_rect_t *bounds); GDK_AVAILABLE_IN_3_94 -GskTexture * gsk_texture_node_get_texture (GskRenderNode *node); +GdkTexture * gdk_texture_node_get_texture (GskRenderNode *node); GDK_AVAILABLE_IN_3_90 GskRenderNode * gsk_linear_gradient_node_new (const graphene_rect_t *bounds, diff --git a/gsk/gskrendernodeimpl.c b/gsk/gskrendernodeimpl.c index 621489b6dd..164cda907d 100644 --- a/gsk/gskrendernodeimpl.c +++ b/gsk/gskrendernodeimpl.c @@ -24,7 +24,7 @@ #include "gskdebugprivate.h" #include "gskrendererprivate.h" #include "gskroundedrectprivate.h" -#include "gsktextureprivate.h" +#include "gdk/gdktextureprivate.h" static gboolean check_variant_type (GVariant *variant, @@ -655,40 +655,40 @@ gsk_border_node_new (const GskRoundedRect *outline, return &self->render_node; } -/*** GSK_TEXTURE_NODE ***/ +/*** GDK_TEXTURE_NODE ***/ -typedef struct _GskTextureNode GskTextureNode; +typedef struct _GdkTextureNode GdkTextureNode; -struct _GskTextureNode +struct _GdkTextureNode { GskRenderNode render_node; - GskTexture *texture; + GdkTexture *texture; }; static void -gsk_texture_node_finalize (GskRenderNode *node) +gdk_texture_node_finalize (GskRenderNode *node) { - GskTextureNode *self = (GskTextureNode *) node; + GdkTextureNode *self = (GdkTextureNode *) node; g_object_unref (self->texture); } static void -gsk_texture_node_draw (GskRenderNode *node, +gdk_texture_node_draw (GskRenderNode *node, cairo_t *cr) { - GskTextureNode *self = (GskTextureNode *) node; + GdkTextureNode *self = (GdkTextureNode *) node; cairo_surface_t *surface; - surface = gsk_texture_download_surface (self->texture); + surface = gdk_texture_download_surface (self->texture); cairo_save (cr); cairo_translate (cr, node->bounds.origin.x, node->bounds.origin.y); cairo_scale (cr, - node->bounds.size.width / gsk_texture_get_width (self->texture), - node->bounds.size.height / gsk_texture_get_height (self->texture)); + node->bounds.size.width / gdk_texture_get_width (self->texture), + node->bounds.size.height / gdk_texture_get_height (self->texture)); cairo_set_source_surface (cr, surface, 0, 0); cairo_paint (cr); @@ -698,28 +698,28 @@ gsk_texture_node_draw (GskRenderNode *node, cairo_surface_destroy (surface); } -#define GSK_TEXTURE_NODE_VARIANT_TYPE "(dddduuau)" +#define GDK_TEXTURE_NODE_VARIANT_TYPE "(dddduuau)" static GVariant * -gsk_texture_node_serialize (GskRenderNode *node) +gdk_texture_node_serialize (GskRenderNode *node) { - GskTextureNode *self = (GskTextureNode *) node; + GdkTextureNode *self = (GdkTextureNode *) node; cairo_surface_t *surface; GVariant *result; - surface = gsk_texture_download_surface (self->texture); + surface = gdk_texture_download_surface (self->texture); g_assert (cairo_image_surface_get_width (surface) * 4 == cairo_image_surface_get_stride (surface)); result = g_variant_new ("(dddduu@au)", (double) node->bounds.origin.x, (double) node->bounds.origin.y, (double) node->bounds.size.width, (double) node->bounds.size.height, - (guint32) gsk_texture_get_width (self->texture), - (guint32) gsk_texture_get_height (self->texture), + (guint32) gdk_texture_get_width (self->texture), + (guint32) gdk_texture_get_height (self->texture), g_variant_new_fixed_array (G_VARIANT_TYPE ("u"), cairo_image_surface_get_data (surface), - gsk_texture_get_width (self->texture) - * gsk_texture_get_height (self->texture), + gdk_texture_get_width (self->texture) + * gdk_texture_get_height (self->texture), sizeof (guint32))); cairo_surface_destroy (surface); @@ -728,17 +728,17 @@ gsk_texture_node_serialize (GskRenderNode *node) } static GskRenderNode * -gsk_texture_node_deserialize (GVariant *variant, +gdk_texture_node_deserialize (GVariant *variant, GError **error) { GskRenderNode *node; - GskTexture *texture; + GdkTexture *texture; double bounds[4]; guint32 width, height; GVariant *pixel_variant; gsize n_pixels; - if (!check_variant_type (variant, GSK_TEXTURE_NODE_VARIANT_TYPE, error)) + if (!check_variant_type (variant, GDK_TEXTURE_NODE_VARIANT_TYPE, error)) return NULL; g_variant_get (variant, "(dddduu@au)", @@ -746,40 +746,40 @@ gsk_texture_node_deserialize (GVariant *variant, &width, &height, &pixel_variant); /* XXX: Make this work without copying the data */ - texture = gsk_texture_new_for_data (g_variant_get_fixed_array (pixel_variant, &n_pixels, sizeof (guint32)), + texture = gdk_texture_new_for_data (g_variant_get_fixed_array (pixel_variant, &n_pixels, sizeof (guint32)), width, height, width * 4); g_variant_unref (pixel_variant); - node = gsk_texture_node_new (texture, &GRAPHENE_RECT_INIT(bounds[0], bounds[1], bounds[2], bounds[3])); + node = gdk_texture_node_new (texture, &GRAPHENE_RECT_INIT(bounds[0], bounds[1], bounds[2], bounds[3])); g_object_unref (texture); return node; } -static const GskRenderNodeClass GSK_TEXTURE_NODE_CLASS = { - GSK_TEXTURE_NODE, - sizeof (GskTextureNode), - "GskTextureNode", - gsk_texture_node_finalize, - gsk_texture_node_draw, - gsk_texture_node_serialize, - gsk_texture_node_deserialize +static const GskRenderNodeClass GDK_TEXTURE_NODE_CLASS = { + GDK_TEXTURE_NODE, + sizeof (GdkTextureNode), + "GdkTextureNode", + gdk_texture_node_finalize, + gdk_texture_node_draw, + gdk_texture_node_serialize, + gdk_texture_node_deserialize }; -GskTexture * -gsk_texture_node_get_texture (GskRenderNode *node) +GdkTexture * +gdk_texture_node_get_texture (GskRenderNode *node) { - GskTextureNode *self = (GskTextureNode *) node; + GdkTextureNode *self = (GdkTextureNode *) node; - g_return_val_if_fail (GSK_IS_RENDER_NODE_TYPE (node, GSK_TEXTURE_NODE), 0); + g_return_val_if_fail (GSK_IS_RENDER_NODE_TYPE (node, GDK_TEXTURE_NODE), 0); return self->texture; } /** - * gsk_texture_node_new: - * @texture: the #GskTexture + * gdk_texture_node_new: + * @texture: the #GdkTexture * @bounds: the rectangle to render the texture into * * Creates a #GskRenderNode that will render the given @@ -790,15 +790,15 @@ gsk_texture_node_get_texture (GskRenderNode *node) * Since: 3.90 */ GskRenderNode * -gsk_texture_node_new (GskTexture *texture, +gdk_texture_node_new (GdkTexture *texture, const graphene_rect_t *bounds) { - GskTextureNode *self; + GdkTextureNode *self; - g_return_val_if_fail (GSK_IS_TEXTURE (texture), NULL); + g_return_val_if_fail (GDK_IS_TEXTURE (texture), NULL); g_return_val_if_fail (bounds != NULL, NULL); - self = (GskTextureNode *) gsk_render_node_new (&GSK_TEXTURE_NODE_CLASS, 0); + self = (GdkTextureNode *) gsk_render_node_new (&GDK_TEXTURE_NODE_CLASS, 0); self->texture = g_object_ref (texture); graphene_rect_init_from_rect (&self->render_node.bounds, bounds); @@ -4448,7 +4448,7 @@ static const GskRenderNodeClass *klasses[] = { [GSK_LINEAR_GRADIENT_NODE] = &GSK_LINEAR_GRADIENT_NODE_CLASS, [GSK_REPEATING_LINEAR_GRADIENT_NODE] = &GSK_REPEATING_LINEAR_GRADIENT_NODE_CLASS, [GSK_BORDER_NODE] = &GSK_BORDER_NODE_CLASS, - [GSK_TEXTURE_NODE] = &GSK_TEXTURE_NODE_CLASS, + [GDK_TEXTURE_NODE] = &GDK_TEXTURE_NODE_CLASS, [GSK_INSET_SHADOW_NODE] = &GSK_INSET_SHADOW_NODE_CLASS, [GSK_OUTSET_SHADOW_NODE] = &GSK_OUTSET_SHADOW_NODE_CLASS, [GSK_TRANSFORM_NODE] = &GSK_TRANSFORM_NODE_CLASS, diff --git a/gsk/gsktexture.c b/gsk/gsktexture.c deleted file mode 100644 index e7f6670872..0000000000 --- a/gsk/gsktexture.c +++ /dev/null @@ -1,559 +0,0 @@ -/* GSK - The GTK Scene Kit - * - * Copyright 2016 Benjamin Otte - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see <http://www.gnu.org/licenses/>. - */ - -/** - * SECTION:GskTexture - * @Title: GskTexture - * @Short_description: Pixel data uploaded to a #GskRenderer - * - * #GskTexture is the basic element used to refer to pixel data. - * It is primarily mean for pixel data that will not change over - * multiple frames, and will be used for a long time. - * - * You cannot get your pixel data back once you've uploaded it. - * - * #GskTexture is an immutable object: That means you cannot change - * anything about it other than increasing the reference count via - * g_object_ref(). - */ - -#include "config.h" - -#include "gsktextureprivate.h" - -#include "gskdebugprivate.h" -#include "gskrenderer.h" - -#include "gdk/gdkinternals.h" - -/** - * GskTexture: - * - * The `GskTexture` structure contains only private data. - * - * Since: 3.90 - */ - -enum { - PROP_0, - PROP_WIDTH, - PROP_HEIGHT, - - N_PROPS -}; - -static GParamSpec *properties[N_PROPS]; - -G_DEFINE_ABSTRACT_TYPE (GskTexture, gsk_texture, G_TYPE_OBJECT) - -#define GSK_TEXTURE_WARN_NOT_IMPLEMENTED_METHOD(obj,method) \ - g_critical ("Texture of type '%s' does not implement GskTexture::" # method, G_OBJECT_TYPE_NAME (obj)) - -static void -gsk_texture_real_download (GskTexture *self, - guchar *data, - gsize stride) -{ - GSK_TEXTURE_WARN_NOT_IMPLEMENTED_METHOD (self, download); -} - -static cairo_surface_t * -gsk_texture_real_download_surface (GskTexture *texture) -{ - cairo_surface_t *surface; - - surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, - texture->width, texture->height); - gsk_texture_download (texture, - cairo_image_surface_get_data (surface), - cairo_image_surface_get_stride (surface)); - cairo_surface_mark_dirty (surface); - - return surface; -} - -static void -gsk_texture_set_property (GObject *gobject, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - GskTexture *self = GSK_TEXTURE (gobject); - - switch (prop_id) - { - case PROP_WIDTH: - self->width = g_value_get_int (value); - break; - - case PROP_HEIGHT: - self->height = g_value_get_int (value); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); - break; - } -} - -static void -gsk_texture_get_property (GObject *gobject, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - GskTexture *self = GSK_TEXTURE (gobject); - - switch (prop_id) - { - case PROP_WIDTH: - g_value_set_int (value, self->width); - break; - - case PROP_HEIGHT: - g_value_set_int (value, self->height); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); - break; - } -} - -static void -gsk_texture_dispose (GObject *object) -{ - GskTexture *self = GSK_TEXTURE (object); - - gsk_texture_clear_render_data (self); - - G_OBJECT_CLASS (gsk_texture_parent_class)->dispose (object); -} - -static void -gsk_texture_class_init (GskTextureClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - - klass->download = gsk_texture_real_download; - klass->download_surface = gsk_texture_real_download_surface; - - gobject_class->set_property = gsk_texture_set_property; - gobject_class->get_property = gsk_texture_get_property; - gobject_class->dispose = gsk_texture_dispose; - - /** - * GskRenderer:width: - * - * The width of the texture. - * - * Since: 3.90 - */ - properties[PROP_WIDTH] = - g_param_spec_int ("width", - "Width", - "The width of the texture", - 1, - G_MAXINT, - 1, - G_PARAM_READWRITE | - G_PARAM_CONSTRUCT_ONLY | - G_PARAM_STATIC_STRINGS | - G_PARAM_EXPLICIT_NOTIFY); - - /** - * GskRenderer:height: - * - * The height of the texture. - * - * Since: 3.90 - */ - properties[PROP_HEIGHT] = - g_param_spec_int ("height", - "Height", - "The height of the texture", - 1, - G_MAXINT, - 1, - G_PARAM_READWRITE | - G_PARAM_CONSTRUCT_ONLY | - G_PARAM_STATIC_STRINGS | - G_PARAM_EXPLICIT_NOTIFY); - - g_object_class_install_properties (gobject_class, N_PROPS, properties); -} - -static void -gsk_texture_init (GskTexture *self) -{ -} - -/* GskCairoTexture */ - -#define GSK_TYPE_CAIRO_TEXTURE (gsk_cairo_texture_get_type ()) - -G_DECLARE_FINAL_TYPE (GskCairoTexture, gsk_cairo_texture, GSK, CAIRO_TEXTURE, GskTexture) - -struct _GskCairoTexture { - GskTexture parent_instance; - cairo_surface_t *surface; -}; - -struct _GskCairoTextureClass { - GskTextureClass parent_class; -}; - -G_DEFINE_TYPE (GskCairoTexture, gsk_cairo_texture, GSK_TYPE_TEXTURE) - -static void -gsk_cairo_texture_finalize (GObject *object) -{ - GskCairoTexture *self = GSK_CAIRO_TEXTURE (object); - - cairo_surface_destroy (self->surface); - - G_OBJECT_CLASS (gsk_cairo_texture_parent_class)->finalize (object); -} - -static cairo_surface_t * -gsk_cairo_texture_download_surface (GskTexture *texture) -{ - GskCairoTexture *self = GSK_CAIRO_TEXTURE (texture); - - return cairo_surface_reference (self->surface); -} - -static void -gsk_cairo_texture_download (GskTexture *texture, - guchar *data, - gsize stride) -{ - GskCairoTexture *self = GSK_CAIRO_TEXTURE (texture); - cairo_surface_t *surface; - cairo_t *cr; - - surface = cairo_image_surface_create_for_data (data, - CAIRO_FORMAT_ARGB32, - texture->width, texture->height, - stride); - cr = cairo_create (surface); - - cairo_set_source_surface (cr, self->surface, 0, 0); - cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); - cairo_paint (cr); - - cairo_destroy (cr); - cairo_surface_finish (surface); - cairo_surface_destroy (surface); -} - -static void -gsk_cairo_texture_class_init (GskCairoTextureClass *klass) -{ - GskTextureClass *texture_class = GSK_TEXTURE_CLASS (klass); - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - - texture_class->download = gsk_cairo_texture_download; - texture_class->download_surface = gsk_cairo_texture_download_surface; - - gobject_class->finalize = gsk_cairo_texture_finalize; -} - -static void -gsk_cairo_texture_init (GskCairoTexture *self) -{ -} - -/** - * gsk_texture_new_for_data: - * @data: (array): the pixel data - * @width: the number of pixels in each row - * @height: the number of rows - * @stride: the distance from the beginning of one row to the next, in bytes - * - * Creates a new texture object holding the given data. - * The data is assumed to be in CAIRO_FORMAT_ARGB32 format. - * - * Returns: a new #GskTexture - */ -GskTexture * -gsk_texture_new_for_data (const guchar *data, - int width, - int height, - int stride) -{ - GskTexture *texture; - cairo_surface_t *original, *copy; - cairo_t *cr; - - original = cairo_image_surface_create_for_data ((guchar *) data, CAIRO_FORMAT_ARGB32, width, height, stride); - copy = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height); - - cr = cairo_create (copy); - cairo_set_source_surface (cr, original, 0, 0); - cairo_paint (cr); - cairo_destroy (cr); - - texture = gsk_texture_new_for_surface (copy); - - cairo_surface_destroy (copy); - cairo_surface_finish (original); - cairo_surface_destroy (original); - - return texture; -} - -/** - * gsk_texture_new_for_surface: - * @surface: a cairo image surface - * - * Creates a new texture object representing the surface. - * @surface must be an image surface with format CAIRO_FORMAT_ARGB32. - * - * Returns: a new #GskTexture - */ -GskTexture * -gsk_texture_new_for_surface (cairo_surface_t *surface) -{ - GskCairoTexture *texture; - - g_return_val_if_fail (cairo_surface_get_type (surface) == CAIRO_SURFACE_TYPE_IMAGE, NULL); - - texture = g_object_new (GSK_TYPE_CAIRO_TEXTURE, - "width", cairo_image_surface_get_width (surface), - "height", cairo_image_surface_get_height (surface), - NULL); - - texture->surface = cairo_surface_reference (surface); - - return (GskTexture *) texture; -} - -/* GskPixbufTexture */ - -#define GSK_TYPE_PIXBUF_TEXTURE (gsk_pixbuf_texture_get_type ()) - -G_DECLARE_FINAL_TYPE (GskPixbufTexture, gsk_pixbuf_texture, GSK, PIXBUF_TEXTURE, GskTexture) - -struct _GskPixbufTexture { - GskTexture parent_instance; - - GdkPixbuf *pixbuf; -}; - -struct _GskPixbufTextureClass { - GskTextureClass parent_class; -}; - -G_DEFINE_TYPE (GskPixbufTexture, gsk_pixbuf_texture, GSK_TYPE_TEXTURE) - -static void -gsk_pixbuf_texture_finalize (GObject *object) -{ - GskPixbufTexture *self = GSK_PIXBUF_TEXTURE (object); - - g_object_unref (self->pixbuf); - - G_OBJECT_CLASS (gsk_pixbuf_texture_parent_class)->finalize (object); -} - -static void -gsk_pixbuf_texture_download (GskTexture *texture, - guchar *data, - gsize stride) -{ - GskPixbufTexture *self = GSK_PIXBUF_TEXTURE (texture); - cairo_surface_t *surface; - - surface = cairo_image_surface_create_for_data (data, - CAIRO_FORMAT_ARGB32, - texture->width, texture->height, - stride); - gdk_cairo_surface_paint_pixbuf (surface, self->pixbuf); - cairo_surface_finish (surface); - cairo_surface_destroy (surface); -} - -static cairo_surface_t * -gsk_pixbuf_texture_download_surface (GskTexture *texture) -{ - GskPixbufTexture *self = GSK_PIXBUF_TEXTURE (texture); - - return gdk_cairo_surface_create_from_pixbuf (self->pixbuf, 1, NULL); -} - -static void -gsk_pixbuf_texture_class_init (GskPixbufTextureClass *klass) -{ - GskTextureClass *texture_class = GSK_TEXTURE_CLASS (klass); - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - - texture_class->download = gsk_pixbuf_texture_download; - texture_class->download_surface = gsk_pixbuf_texture_download_surface; - - gobject_class->finalize = gsk_pixbuf_texture_finalize; -} - -static void -gsk_pixbuf_texture_init (GskPixbufTexture *self) -{ -} - -/** - * gsk_texture_new_for_pixbuf: - * @pixbuf: a #GdkPixbuf - * - * Creates a new texture object representing the GdkPixbuf. - * - * Returns: a new #GskTexture - */ -GskTexture * -gsk_texture_new_for_pixbuf (GdkPixbuf *pixbuf) -{ - GskPixbufTexture *self; - - g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL); - - self = g_object_new (GSK_TYPE_PIXBUF_TEXTURE, - "width", gdk_pixbuf_get_width (pixbuf), - "height", gdk_pixbuf_get_height (pixbuf), - NULL); - - self->pixbuf = g_object_ref (pixbuf); - - return GSK_TEXTURE (self); -} - -/** - * gsk_texture_get_width: - * @texture: a #GskTexture - * - * Returns the width of @texture. - * - * Returns: the width of the #GskTexture - * - * Since: 3.90 - */ -int -gsk_texture_get_width (GskTexture *texture) -{ - g_return_val_if_fail (GSK_IS_TEXTURE (texture), 0); - - return texture->width; -} - -/** - * gsk_texture_get_height: - * @texture: a #GskTexture - * - * Returns the height of the @texture. - * - * Returns: the height of the #GskTexture - * - * Since: 3.90 - */ -int -gsk_texture_get_height (GskTexture *texture) -{ - g_return_val_if_fail (GSK_IS_TEXTURE (texture), 0); - - return texture->height; -} - -cairo_surface_t * -gsk_texture_download_surface (GskTexture *texture) -{ - return GSK_TEXTURE_GET_CLASS (texture)->download_surface (texture); -} - -/** - * gsk_texture_download: - * @texture: a #GskTexture - * @data: pointer to enough memory to be filled with the - * downloaded data of @texture - * @stride: rowstride in bytes - * - * Downloads the @texture into local memory. This may be - * an expensive operation, as the actual texture data may - * reside on a GPU or on a remote display server. - * - * The data format of the downloaded data is equivalent to - * %CAIRO_FORMAT_ARGB32, so every downloaded pixel requires - * 4 bytes of memory. - * - * Downloading a texture into a Cairo image surface: - * |[<!-- language="C" --> - * surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, - * gsk_texture_get_width (texture), - * gsk_texture_get_height (texture)); - * gsk_texture_download (texture, - * cairo_image_surface_get_data (surface), - * cairo_image_surface_get_stride (surface)); - * cairo_surface_mark_dirty (surface); - * ]| - **/ -void -gsk_texture_download (GskTexture *texture, - guchar *data, - gsize stride) -{ - g_return_if_fail (GSK_IS_TEXTURE (texture)); - g_return_if_fail (data != NULL); - g_return_if_fail (stride >= gsk_texture_get_width (texture) * 4); - - return GSK_TEXTURE_GET_CLASS (texture)->download (texture, data, stride); -} - -gboolean -gsk_texture_set_render_data (GskTexture *self, - gpointer key, - gpointer data, - GDestroyNotify notify) -{ - g_return_val_if_fail (data != NULL, FALSE); - - if (self->render_key != NULL) - return FALSE; - - self->render_key = key; - self->render_data = data; - self->render_notify = notify; - - return TRUE; -} - -void -gsk_texture_clear_render_data (GskTexture *self) -{ - if (self->render_notify) - self->render_notify (self->render_data); - - self->render_key = NULL; - self->render_data = NULL; - self->render_notify = NULL; -} - -gpointer -gsk_texture_get_render_data (GskTexture *self, - gpointer key) -{ - if (self->render_key != key) - return NULL; - - return self->render_data; -} diff --git a/gsk/gsktexture.h b/gsk/gsktexture.h deleted file mode 100644 index a241af3da0..0000000000 --- a/gsk/gsktexture.h +++ /dev/null @@ -1,63 +0,0 @@ -/* GSK - The GTK Scene Kit - * - * Copyright 2016 Benjamin Otte - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see <http://www.gnu.org/licenses/>. - */ - -#ifndef __GSK_TEXTURE_H__ -#define __GSK_TEXTURE_H__ - -#if !defined (__GSK_H_INSIDE__) && !defined (GSK_COMPILATION) -#error "Only <gsk/gsk.h> can be included directly." -#endif - -#include <gsk/gsktypes.h> - -G_BEGIN_DECLS - -#define GSK_TYPE_TEXTURE (gsk_texture_get_type ()) - -#define GSK_TEXTURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GSK_TYPE_TEXTURE, GskTexture)) -#define GSK_IS_TEXTURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GSK_TYPE_TEXTURE)) - -G_DEFINE_AUTOPTR_CLEANUP_FUNC(GskTexture, g_object_unref) - -typedef struct _GskTextureClass GskTextureClass; - - -GDK_AVAILABLE_IN_3_90 -GType gsk_texture_get_type (void) G_GNUC_CONST; - -GDK_AVAILABLE_IN_3_90 -GskTexture * gsk_texture_new_for_data (const guchar *data, - int width, - int height, - int stride); -GDK_AVAILABLE_IN_3_90 -GskTexture * gsk_texture_new_for_pixbuf (GdkPixbuf *pixbuf); - -GDK_AVAILABLE_IN_3_90 -int gsk_texture_get_width (GskTexture *texture); -GDK_AVAILABLE_IN_3_90 -int gsk_texture_get_height (GskTexture *texture); - -GDK_AVAILABLE_IN_3_90 -void gsk_texture_download (GskTexture *texture, - guchar *data, - gsize stride); - -G_END_DECLS - -#endif /* __GSK_TEXTURE_H__ */ diff --git a/gsk/gsktextureprivate.h b/gsk/gsktextureprivate.h deleted file mode 100644 index 9d4cd105c4..0000000000 --- a/gsk/gsktextureprivate.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef __GSK_TEXTURE_PRIVATE_H__ -#define __GSK_TEXTURE_PRIVATE_H__ - -#include "gsktexture.h" - -G_BEGIN_DECLS - -#define GSK_TEXTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GSK_TYPE_TEXTURE, GskTextureClass)) -#define GSK_IS_TEXTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GSK_TYPE_TEXTURE)) -#define GSK_TEXTURE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GSK_TYPE_TEXTURE, GskTextureClass)) - -struct _GskTexture -{ - GObject parent_instance; - - int width; - int height; - - gpointer render_key; - gpointer render_data; - GDestroyNotify render_notify; -}; - -struct _GskTextureClass { - GObjectClass parent_class; - - void (* download) (GskTexture *texture, - guchar *data, - gsize stride); - cairo_surface_t * (* download_surface) (GskTexture *texture); -}; - -gpointer gsk_texture_new (const GskTextureClass *klass, - int width, - int height); -GskTexture * gsk_texture_new_for_surface (cairo_surface_t *surface); -cairo_surface_t * gsk_texture_download_surface (GskTexture *texture); - -gboolean gsk_texture_set_render_data (GskTexture *self, - gpointer key, - gpointer data, - GDestroyNotify notify); -void gsk_texture_clear_render_data (GskTexture *self); -gpointer gsk_texture_get_render_data (GskTexture *self, - gpointer key); - -G_END_DECLS - -#endif /* __GSK_TEXTURE_PRIVATE_H__ */ diff --git a/gsk/gsktypes.h b/gsk/gsktypes.h index 32fab4cf49..a5e5eccd70 100644 --- a/gsk/gsktypes.h +++ b/gsk/gsktypes.h @@ -27,6 +27,6 @@ #include <gsk/gskenums.h> typedef struct _GskRenderer GskRenderer; -typedef struct _GskTexture GskTexture; +typedef struct _GdkTexture GdkTexture; #endif /* __GSK_TYPES_H__ */ diff --git a/gsk/gskvulkanimage.c b/gsk/gskvulkanimage.c index 4ea8a44295..8ebcd9e358 100644 --- a/gsk/gskvulkanimage.c +++ b/gsk/gskvulkanimage.c @@ -627,12 +627,12 @@ gsk_vulkan_image_new_for_texture (GdkVulkanContext *context, return self; } -GskTexture * +GdkTexture * gsk_vulkan_image_download (GskVulkanImage *self, GskVulkanUploader *uploader) { GskVulkanBuffer *buffer; - GskTexture *texture; + GdkTexture *texture; guchar *mem; gsk_vulkan_uploader_add_image_barrier (uploader, @@ -671,7 +671,7 @@ gsk_vulkan_image_download (GskVulkanImage *self, GSK_VK_CHECK (vkQueueWaitIdle, gdk_vulkan_context_get_queue (self->vulkan)); mem = gsk_vulkan_buffer_map (buffer); - texture = gsk_texture_new_for_data (mem, self->width, self->height, self->width * 4); + texture = gdk_texture_new_for_data (mem, self->width, self->height, self->width * 4); gsk_vulkan_buffer_unmap (buffer); gsk_vulkan_buffer_free (buffer); diff --git a/gsk/gskvulkanimageprivate.h b/gsk/gskvulkanimageprivate.h index f6223e9980..20c49aa94e 100644 --- a/gsk/gskvulkanimageprivate.h +++ b/gsk/gskvulkanimageprivate.h @@ -3,7 +3,6 @@ #include <gdk/gdk.h> -#include "gsk/gsktexture.h" #include "gsk/gskvulkancommandpoolprivate.h" G_BEGIN_DECLS @@ -55,7 +54,7 @@ GskVulkanImage * gsk_vulkan_image_new_for_texture (GdkVulk gsize width, gsize height); -GskTexture * gsk_vulkan_image_download (GskVulkanImage *self, +GdkTexture * gsk_vulkan_image_download (GskVulkanImage *self, GskVulkanUploader *uploader); gsize gsk_vulkan_image_get_width (GskVulkanImage *self); diff --git a/gsk/gskvulkanrender.c b/gsk/gskvulkanrender.c index e94185d731..5d8b241c12 100644 --- a/gsk/gskvulkanrender.c +++ b/gsk/gskvulkanrender.c @@ -629,7 +629,7 @@ gsk_vulkan_render_draw (GskVulkanRender *self) } } -GskTexture * +GdkTexture * gsk_vulkan_render_download_target (GskVulkanRender *self) { gsk_vulkan_uploader_reset (self->uploader); diff --git a/gsk/gskvulkanrenderer.c b/gsk/gskvulkanrenderer.c index 7bc9431d58..82c25ecd53 100644 --- a/gsk/gskvulkanrenderer.c +++ b/gsk/gskvulkanrenderer.c @@ -6,19 +6,20 @@ #include "gskprivate.h" #include "gskrendererprivate.h" #include "gskrendernodeprivate.h" -#include "gsktextureprivate.h" #include "gskvulkanbufferprivate.h" #include "gskvulkanimageprivate.h" #include "gskvulkanpipelineprivate.h" #include "gskvulkanrenderprivate.h" #include "gskvulkanglyphcacheprivate.h" +#include "gdk/gdktextureprivate.h" + #include <graphene.h> typedef struct _GskVulkanTextureData GskVulkanTextureData; struct _GskVulkanTextureData { - GskTexture *texture; + GdkTexture *texture; GskVulkanImage *image; GskVulkanRenderer *renderer; }; @@ -144,7 +145,7 @@ gsk_vulkan_renderer_unrealize (GskRenderer *renderer) GskVulkanTextureData *data = l->data; data->renderer = NULL; - gsk_texture_clear_render_data (data->texture); + gdk_texture_clear_render_data (data->texture); } g_clear_pointer (&self->textures, (GDestroyNotify) g_slist_free); @@ -158,7 +159,7 @@ gsk_vulkan_renderer_unrealize (GskRenderer *renderer) g_clear_object (&self->vulkan); } -static GskTexture * +static GdkTexture * gsk_vulkan_renderer_render_texture (GskRenderer *renderer, GskRenderNode *root, const graphene_rect_t *viewport) @@ -166,7 +167,7 @@ gsk_vulkan_renderer_render_texture (GskRenderer *renderer, GskVulkanRenderer *self = GSK_VULKAN_RENDERER (renderer); GskVulkanRender *render; GskVulkanImage *image; - GskTexture *texture; + GdkTexture *texture; #ifdef G_ENABLE_DEBUG GskProfiler *profiler; gint64 cpu_time; @@ -310,18 +311,18 @@ gsk_vulkan_renderer_clear_texture (gpointer p) GskVulkanImage * gsk_vulkan_renderer_ref_texture_image (GskVulkanRenderer *self, - GskTexture *texture, + GdkTexture *texture, GskVulkanUploader *uploader) { GskVulkanTextureData *data; cairo_surface_t *surface; GskVulkanImage *image; - data = gsk_texture_get_render_data (texture, self); + data = gdk_texture_get_render_data (texture, self); if (data) return g_object_ref (data->image); - surface = gsk_texture_download_surface (texture); + surface = gdk_texture_download_surface (texture); image = gsk_vulkan_image_new_from_data (uploader, cairo_image_surface_get_data (surface), cairo_image_surface_get_width (surface), @@ -334,7 +335,7 @@ gsk_vulkan_renderer_ref_texture_image (GskVulkanRenderer *self, data->texture = texture; data->renderer = self; - if (gsk_texture_set_render_data (texture, self, data, gsk_vulkan_renderer_clear_texture)) + if (gdk_texture_set_render_data (texture, self, data, gsk_vulkan_renderer_clear_texture)) { g_object_ref (data->image); self->textures = g_slist_prepend (self->textures, data); diff --git a/gsk/gskvulkanrendererprivate.h b/gsk/gskvulkanrendererprivate.h index d86734c9df..42ffc22c04 100644 --- a/gsk/gskvulkanrendererprivate.h +++ b/gsk/gskvulkanrendererprivate.h @@ -22,7 +22,7 @@ typedef struct _GskVulkanRendererClass GskVulkanRendererClass; GType gsk_vulkan_renderer_get_type (void) G_GNUC_CONST; GskVulkanImage * gsk_vulkan_renderer_ref_texture_image (GskVulkanRenderer *self, - GskTexture *texture, + GdkTexture *texture, GskVulkanUploader *uploader); typedef struct diff --git a/gsk/gskvulkanrenderpass.c b/gsk/gskvulkanrenderpass.c index d902a90961..7086e007fc 100644 --- a/gsk/gskvulkanrenderpass.c +++ b/gsk/gskvulkanrenderpass.c @@ -442,7 +442,7 @@ gsk_vulkan_render_pass_add_node (GskVulkanRenderPass *self, return; } - case GSK_TEXTURE_NODE: + case GDK_TEXTURE_NODE: if (gsk_vulkan_clip_contains_rect (&constants->clip, &node->bounds)) pipeline_type = GSK_VULKAN_PIPELINE_TEXTURE; else if (constants->clip.type == GSK_VULKAN_CLIP_RECT) @@ -678,11 +678,11 @@ gsk_vulkan_render_pass_get_node_as_texture (GskVulkanRenderPass *self, switch ((guint) gsk_render_node_get_node_type (node)) { - case GSK_TEXTURE_NODE: + case GDK_TEXTURE_NODE: if (graphene_rect_equal (bounds, &node->bounds)) { result = gsk_vulkan_renderer_ref_texture_image (GSK_VULKAN_RENDERER (gsk_vulkan_render_get_renderer (render)), - gsk_texture_node_get_texture (node), + gdk_texture_node_get_texture (node), uploader); gsk_vulkan_render_add_cleanup_image (render, result); *tex_rect = GRAPHENE_RECT_INIT(0, 0, 1, 1); @@ -938,7 +938,7 @@ gsk_vulkan_render_pass_upload (GskVulkanRenderPass *self, case GSK_VULKAN_OP_TEXTURE: { op->render.source = gsk_vulkan_renderer_ref_texture_image (GSK_VULKAN_RENDERER (gsk_vulkan_render_get_renderer (render)), - gsk_texture_node_get_texture (op->render.node), + gdk_texture_node_get_texture (op->render.node), uploader); op->render.source_rect = GRAPHENE_RECT_INIT(0, 0, 1, 1); gsk_vulkan_render_add_cleanup_image (render, op->render.source); diff --git a/gsk/gskvulkanrenderprivate.h b/gsk/gskvulkanrenderprivate.h index 1455bb7238..eb0b68863e 100644 --- a/gsk/gskvulkanrenderprivate.h +++ b/gsk/gskvulkanrenderprivate.h @@ -85,7 +85,7 @@ void gsk_vulkan_render_draw (GskVulk void gsk_vulkan_render_submit (GskVulkanRender *self); -GskTexture * gsk_vulkan_render_download_target (GskVulkanRender *self); +GdkTexture * gsk_vulkan_render_download_target (GskVulkanRender *self); VkFramebuffer gsk_vulkan_render_get_framebuffer (GskVulkanRender *self, GskVulkanImage *image); diff --git a/gsk/meson.build b/gsk/meson.build index a86e1566b6..bdf64324c6 100644 --- a/gsk/meson.build +++ b/gsk/meson.build @@ -17,8 +17,7 @@ gsk_public_sources = files([ 'gskrenderer.c', 'gskrendernode.c', 'gskrendernodeimpl.c', - 'gskroundedrect.c', - 'gsktexture.c', + 'gskroundedrect.c' ]) gsk_private_sources = files([ @@ -38,7 +37,6 @@ gsk_public_headers = files([ 'gskrenderer.h', 'gskrendernode.h', 'gskroundedrect.h', - 'gsktexture.h', 'gsktypes.h', ]) |