[gtk/wip/chergert/glproto: 144/493] ideate around offscreen
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/glproto: 144/493] ideate around offscreen
- Date: Fri, 19 Feb 2021 02:25:08 +0000 (UTC)
commit c296679aa68d074f15daa578b61dd5af1cf69666
Author: Christian Hergert <chergert redhat com>
Date: Fri Jan 8 11:04:25 2021 -0800
ideate around offscreen
gsk/next/gskgldriver.c | 1 -
gsk/next/gskgldriverprivate.h | 3 ++-
gsk/next/gskglrenderjob.c | 19 ++++++++++---------
3 files changed, 12 insertions(+), 11 deletions(-)
---
diff --git a/gsk/next/gskgldriver.c b/gsk/next/gskgldriver.c
index bf3111bd3c..8dae020a72 100644
--- a/gsk/next/gskgldriver.c
+++ b/gsk/next/gskgldriver.c
@@ -575,7 +575,6 @@ gsk_next_driver_load_texture (GskNextDriver *self,
if (size_can_be_atlased (width, height))
{
GskGLTextureAtlas *atlas;
- float x, y;
if (gsk_gl_texture_library_lookup (GSK_GL_TEXTURE_LIBRARY (self->icons),
texture, &atlas, area))
diff --git a/gsk/next/gskgldriverprivate.h b/gsk/next/gskgldriverprivate.h
index 793a217ad0..bf11e441c8 100644
--- a/gsk/next/gskgldriverprivate.h
+++ b/gsk/next/gskgldriverprivate.h
@@ -113,7 +113,8 @@ void gsk_next_driver_cache_texture (GskNextDriver *se
guint gsk_next_driver_load_texture (GskNextDriver *self,
GdkTexture *texture,
int min_filter,
- int mag_filter);
+ int mag_filter,
+ graphene_rect_t *area);
GskGLTexture *gsk_next_driver_create_texture (GskNextDriver *self,
float width,
float height,
diff --git a/gsk/next/gskglrenderjob.c b/gsk/next/gskglrenderjob.c
index a990148929..84993b1a4e 100644
--- a/gsk/next/gskglrenderjob.c
+++ b/gsk/next/gskglrenderjob.c
@@ -97,10 +97,7 @@ typedef struct _GskGLRenderModelview
typedef struct _GskGLRenderOffscreen
{
const graphene_rect_t *bounds;
- float x;
- float y;
- float x2;
- float y2;
+ graphene_rect_t area;
guint texture_id;
guint force_offscreen : 1;
guint reset_clip : 1;
@@ -1844,10 +1841,10 @@ gsk_gl_render_job_visit_node_with_offscreen (GskGLRenderJob *job,
{
/* Just to be safe. */
offscreen->texture_id = 0;
- offscreen->x = 0;
- offscreen->x2 = 1;
- offscreen->y = 0;
- offscreen->y2 = 1;
+ offscreen->area.origin.x = 0;
+ offscreen->area.size.width = 1;
+ offscreen->area.origin.y = 0;
+ offscreen->area.origin.width = 1;
return FALSE;
}
@@ -1857,7 +1854,11 @@ gsk_gl_render_job_visit_node_with_offscreen (GskGLRenderJob *job,
GdkTexture *texture = gsk_texture_node_get_texture (node);
offscreen->texture_id =
- gsk_next_driver_load_texture (job->driver, texture, GL_LINEAR, GL_LINEAR);
+ gsk_next_driver_load_texture (job->driver,
+ texture,
+ GL_LINEAR,
+ GL_LINEAR,
+ &offscreen.area);
}
return FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]