From 3f79e7e2220b01ed0f72188851bd7b3fdebb88c4 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Mon, 14 May 2018 18:59:51 -0500 Subject: io-ico.c: Don't use gdk-pixbuf-private.h --- gdk-pixbuf/io-ico.c | 52 +++++++++++++++++++++++----------------------------- 1 file changed, 23 insertions(+), 29 deletions(-) (limited to 'gdk-pixbuf') diff --git a/gdk-pixbuf/io-ico.c b/gdk-pixbuf/io-ico.c index df86f7bab..8dca76ae4 100644 --- a/gdk-pixbuf/io-ico.c +++ b/gdk-pixbuf/io-ico.c @@ -44,7 +44,8 @@ Known bugs: #endif #include #include -#include "gdk-pixbuf-private.h" +#include +#include "gdk-pixbuf-io.h" @@ -636,16 +637,15 @@ OneLine32 (struct ico_progressive_state *context) { gint X; guchar *Pixels; + gsize rowstride = gdk_pixbuf_get_rowstride (context->pixbuf); X = 0; if (context->Header.Negative == 0) Pixels = (gdk_pixbuf_get_pixels (context->pixbuf) + - (gsize) context->pixbuf->rowstride * - (context->Header.height - context->Lines - 1)); + rowstride * (context->Header.height - context->Lines - 1)); else Pixels = (gdk_pixbuf_get_pixels (context->pixbuf) + - (gsize) context->pixbuf->rowstride * - context->Lines); + rowstride * context->Lines); while (X < context->Header.width) { /* BGRA */ Pixels[X * 4 + 0] = context->LineBuf[X * 4 + 2]; @@ -660,16 +660,15 @@ static void OneLine24(struct ico_progressive_state *context) { gint X; guchar *Pixels; + gsize rowstride = gdk_pixbuf_get_rowstride (context->pixbuf); X = 0; if (context->Header.Negative == 0) Pixels = (gdk_pixbuf_get_pixels (context->pixbuf) + - (gsize) context->pixbuf->rowstride * - (context->Header.height - context->Lines - 1)); + rowstride * (context->Header.height - context->Lines - 1)); else Pixels = (gdk_pixbuf_get_pixels (context->pixbuf) + - (gsize) context->pixbuf->rowstride * - context->Lines); + rowstride * context->Lines); while (X < context->Header.width) { Pixels[X * 4 + 0] = context->LineBuf[X * 3 + 2]; Pixels[X * 4 + 1] = context->LineBuf[X * 3 + 1]; @@ -686,15 +685,14 @@ OneLine16 (struct ico_progressive_state *context) int i; guchar *pixels; guchar *src; + gsize rowstride = gdk_pixbuf_get_rowstride (context->pixbuf); if (context->Header.Negative == 0) pixels = (gdk_pixbuf_get_pixels (context->pixbuf) + - (gsize) context->pixbuf->rowstride * - (context->Header.height - context->Lines - 1)); + rowstride * (context->Header.height - context->Lines - 1)); else pixels = (gdk_pixbuf_get_pixels (context->pixbuf) + - (gsize) context->pixbuf->rowstride * - context->Lines); + rowstride * context->Lines); src = context->LineBuf; @@ -724,16 +722,15 @@ static void OneLine8(struct ico_progressive_state *context) { gint X; guchar *Pixels; + gsize rowstride = gdk_pixbuf_get_rowstride (context->pixbuf); X = 0; if (context->Header.Negative == 0) Pixels = (gdk_pixbuf_get_pixels (context->pixbuf) + - (gsize) context->pixbuf->rowstride * - (context->Header.height - context->Lines - 1)); + rowstride * (context->Header.height - context->Lines - 1)); else Pixels = (gdk_pixbuf_get_pixels (context->pixbuf) + - (gsize) context->pixbuf->rowstride * - context->Lines); + rowstride * context->Lines); while (X < context->Header.width) { /* The joys of having a BGR byteorder */ Pixels[X * 4 + 0] = @@ -750,16 +747,15 @@ static void OneLine4(struct ico_progressive_state *context) { gint X; guchar *Pixels; + gsize rowstride = gdk_pixbuf_get_rowstride (context->pixbuf); X = 0; if (context->Header.Negative == 0) Pixels = (gdk_pixbuf_get_pixels (context->pixbuf) + - (gsize) context->pixbuf->rowstride * - (context->Header.height - context->Lines - 1)); + rowstride * (context->Header.height - context->Lines - 1)); else Pixels = (gdk_pixbuf_get_pixels (context->pixbuf) + - (gsize) context->pixbuf->rowstride * - context->Lines); + rowstride * context->Lines); while (X < context->Header.width) { guchar Pix; @@ -793,16 +789,15 @@ static void OneLine1(struct ico_progressive_state *context) { gint X; guchar *Pixels; + gsize rowstride = gdk_pixbuf_get_rowstride (context->pixbuf); X = 0; if (context->Header.Negative == 0) Pixels = (gdk_pixbuf_get_pixels (context->pixbuf) + - (gsize) context->pixbuf->rowstride * - (context->Header.height - context->Lines - 1)); + rowstride * (context->Header.height - context->Lines - 1)); else Pixels = (gdk_pixbuf_get_pixels (context->pixbuf) + - (gsize) context->pixbuf->rowstride * - context->Lines); + rowstride * context->Lines); while (X < context->Header.width) { int Bit; @@ -821,6 +816,7 @@ static void OneLineTransp(struct ico_progressive_state *context) { gint X; guchar *Pixels; + gsize rowstride = gdk_pixbuf_get_rowstride (context->pixbuf); /* Ignore the XOR mask for XP style 32-bpp icons with alpha */ if (context->Header.depth == 32) @@ -829,12 +825,10 @@ static void OneLineTransp(struct ico_progressive_state *context) X = 0; if (context->Header.Negative == 0) Pixels = (gdk_pixbuf_get_pixels (context->pixbuf) + - (gsize) context->pixbuf->rowstride * - (2*context->Header.height - context->Lines - 1)); + rowstride * (2*context->Header.height - context->Lines - 1)); else Pixels = (gdk_pixbuf_get_pixels (context->pixbuf) + - (gsize) context->pixbuf->rowstride * - (context->Lines-context->Header.height)); + rowstride * (context->Lines-context->Header.height)); while (X < context->Header.width) { int Bit; -- cgit v1.2.1