Author: dsilvers
Date: Wed Aug 9 15:58:41 2006
New Revision: 2822
URL:
http://svn.semichrome.net?rev=2822&view=rev
Log:
Ensure that if not tiling, we ref the primary and return it
Modified:
branches/dsilvers/gtk-bitmap-pretile/gtk/gtk_bitmap.c
Modified: branches/dsilvers/gtk-bitmap-pretile/gtk/gtk_bitmap.c
URL:
http://svn.semichrome.net/branches/dsilvers/gtk-bitmap-pretile/gtk/gtk_bi...
==============================================================================
--- branches/dsilvers/gtk-bitmap-pretile/gtk/gtk_bitmap.c (original)
+++ branches/dsilvers/gtk-bitmap-pretile/gtk/gtk_bitmap.c Wed Aug 9 15:58:41 2006
@@ -198,6 +198,12 @@
/* This algorithm won't work if the strides are not multiples */
assert(target_stride == (primary_stride * repeat_x));
+ if (repeat_x == 1 && repeat_y == 1) {
+ g_object_ref(primary);
+ g_object_unref(result);
+ return primary;
+ }
+
for (y = 0; y < repeat_y; ++y) {
char *primary_buffer = (char *)gdk_pixbuf_get_pixels(primary);
for (row = 0; row < height; ++row) {