[gtk/wip/baedert/stb-rect-pack: 34/34] glimage: Only support uploading one region
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/stb-rect-pack: 34/34] glimage: Only support uploading one region
- Date: Mon, 18 Feb 2019 17:22:07 +0000 (UTC)
commit eb506c2c1452e43431c03bf4a97867a7f0642c66
Author: Timm Bäder <mail baedert org>
Date: Thu Feb 14 15:22:40 2019 +0100
glimage: Only support uploading one region
gsk/gl/gskglglyphcache.c | 2 +-
gsk/gl/gskglimage.c | 22 +++++++---------------
gsk/gl/gskglimageprivate.h | 5 ++---
3 files changed, 10 insertions(+), 19 deletions(-)
---
diff --git a/gsk/gl/gskglglyphcache.c b/gsk/gl/gskglglyphcache.c
index 45a470c38e..eb4ee2818c 100644
--- a/gsk/gl/gskglglyphcache.c
+++ b/gsk/gl/gskglglyphcache.c
@@ -255,7 +255,7 @@ upload_dirty_glyph (GskGLGlyphCache *self,
render_glyph (atlas, (DirtyGlyph *)atlas->user_data, ®ion);
- gsk_gl_image_upload_regions (&atlas->image, self->gl_driver, 1, ®ion);
+ gsk_gl_image_upload_region (&atlas->image, self->gl_driver, ®ion);
g_free (region.data);
diff --git a/gsk/gl/gskglimage.c b/gsk/gl/gskglimage.c
index 49dd630bde..a4381ae6de 100644
--- a/gsk/gl/gskglimage.c
+++ b/gsk/gl/gskglimage.c
@@ -43,23 +43,15 @@ gsk_gl_image_write_to_png (const GskGLImage *self,
}
void
-gsk_gl_image_upload_regions (GskGLImage *self,
- GskGLDriver *gl_driver,
- guint n_regions,
- const GskImageRegion *regions)
+gsk_gl_image_upload_region (GskGLImage *self,
+ GskGLDriver *gl_driver,
+ const GskImageRegion *region)
{
- guint i;
-
- for (i = 0; i < n_regions; i ++)
- {
- const GskImageRegion *region = ®ions[i];
-
- gsk_gl_driver_bind_source_texture (gl_driver, self->texture_id);
- glBindTexture (GL_TEXTURE_2D, self->texture_id);
+ gsk_gl_driver_bind_source_texture (gl_driver, self->texture_id);
+ glBindTexture (GL_TEXTURE_2D, self->texture_id);
- glTexSubImage2D (GL_TEXTURE_2D, 0, region->x, region->y, region->width, region->height,
- GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, region->data);
- }
+ glTexSubImage2D (GL_TEXTURE_2D, 0, region->x, region->y, region->width, region->height,
+ GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, region->data);
#ifdef G_ENABLE_DEBUG
/*gsk_gl_driver_bind_source_texture (gl_driver, self->texture_id);*/
diff --git a/gsk/gl/gskglimageprivate.h b/gsk/gl/gskglimageprivate.h
index 547f0cb171..d9da860df3 100644
--- a/gsk/gl/gskglimageprivate.h
+++ b/gsk/gl/gskglimageprivate.h
@@ -30,10 +30,9 @@ void gsk_gl_image_destroy (GskGLImage *self,
void gsk_gl_image_write_to_png (const GskGLImage *self,
GskGLDriver *gl_driver,
const char *filename);
-void gsk_gl_image_upload_regions (GskGLImage *self,
+void gsk_gl_image_upload_region (GskGLImage *self,
GskGLDriver *gl_driver,
- guint n_regions,
- const GskImageRegion *regions);
+ const GskImageRegion *region);
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]