Switch all usage of device color spaces to generic color spaces. Since
the former color spaces are no longer device-dependent as of Mac OS X
10.4, these yielded a very costly color space conversion when drawing
pixmaps to the screen. We now avoid this by using the generic color
space.
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=624025
If the data that backs a bitmap context changes, then the CGImage that
is backed by this data might not always update due to caching effects.
By creating the CGImage on-demand, we ascertain ourselves that the
CGImage is up to date.
Either g_type_register_static_simple (used by G_DEFINE_TYPE_EXTENDED)
and G_IMPLEMENT_INTERFACE use automatic variables for GTypeInfo and
GInterfaceInfo structs, while tutorials and source code often use
static variables. This commit consistently adopts the former method.
https://bugzilla.gnome.org/show_bug.cgi?id=600158
The history before this was kind of twisted as several different
approaches were tested, so that was all squashed into this initial
commit to hide the uninteresting changes and files that were later
removed.
2008-07-20 Sven Herzberg <sven@imendio.com>
reviewed by: Richard Hult
Fixes#543868: GdkPixmap is upside down on quartz
* gdk/quartz/gdkdrawable-quartz.c (gdk_quartz_draw_drawable): flip the
coordinate space from GTK+ orientation to CoreGraphics orientation
before calling CoreGraphics code
* gdk/quartz/gdkgc-quartz.c (gdk_quartz_draw_tiled_pattern): drop the
coordinate space flipping (we always get it right, now)
* gdk/quartz/gdkpixmap-quartz.c
(gdk_pixmap_impl_quartz_get_context): flip the coordinate space when
creating the CGContextRef
svn path=/trunk/; revision=20870
2008-07-20 Sven Herzberg <sven@imendio.com>
reviewed by: Richard Hult
Extracted the CGContextRef creation into a virtual function of
GdkDrawableImplQuartz; implement get_context() for GdkPixmap and
GdkWindow
* gdk/quartz/gdkdrawable-quartz.c
(gdk_quartz_drawable_get_context): dropped the different
implementations; forward to the virtual function now
* gdk/quartz/gdkdrawable-quartz.h: added the virtual function
* gdk/quartz/gdkpixmap-quartz.c
(gdk_pixmap_impl_quartz_get_context),
(gdk_pixmap_impl_quartz_class_init): implemented get_context()
* gdk/quartz/gdkwindow-quartz.c
(gdk_window_impl_quartz_get_context),
(gdk_window_impl_quartz_class_init): implemented get_context()
svn path=/trunk/; revision=20869
2007-03-10 Richard Hult <richard@imendio.com>
* gdk/quartz/gdkdrawable-quartz.c:
(gdk_quartz_drawable_get_context): Update for the new quartz cairo
surface API (#410442). Don't lock focus unless called outside of an
expose event.
(gdk_quartz_drawable_release_context): Only flush the CG context and
unlock focus if called outside of expose.
(gdk_quartz_ref_cairo_surface): Reuse the surface during its lifetime.
(_gdk_quartz_drawable_finish): New function, used to free the cached
cairo surface.
* gdk/quartz/gdkwindow-quartz.c:
(gdk_window_impl_quartz_begin_paint_region): A few small style changes.
(gdk_window_quartz_process_all_updates): Move the autorelease pool
allocation and freeing outside the loop.
(_gdk_windowing_window_destroy): Finish the drawable.
(move_resize_window_internal): Small cleanup and remove comment.
(_gdk_window_impl_quartz_get_type): No need to make the type info
static.
* gdk/quartz/gdkpixmap-quartz.c: Finish the drawable.
svn path=/trunk/; revision=17463
2006-07-10 Richard Hult <richard@imendio.com>
* gdk/quartz/gdkpixmap-quartz.c: (gdk_bitmap_create_from_data):
Account for alignment when reading xbm data. (#346721, patch
by Dave Vasilevsky)