quartz: Remove unused _gdk_quartz_colormap_get_cgcolor_from_pixel()

This commit is contained in:
Benjamin Otte 2010-08-29 01:51:54 +02:00
parent a6e936788a
commit ffed076891
2 changed files with 0 additions and 53 deletions

View File

@ -148,52 +148,3 @@ gdk_colormap_get_screen (GdkColormap *cmap)
return gdk_screen_get_default ();
}
CGColorRef
_gdk_quartz_colormap_get_cgcolor_from_pixel (GdkDrawable *drawable,
guint32 pixel)
{
CGFloat components[4] = { 0.0f, };
CGColorRef color;
CGColorSpaceRef colorspace;
const GdkVisual *visual;
GdkColormap *colormap;
colormap = gdk_drawable_get_colormap (drawable);
if (colormap)
visual = gdk_colormap_get_visual (colormap);
else
visual = gdk_visual_get_best_with_depth (gdk_drawable_get_depth (drawable));
switch (visual->type)
{
case GDK_VISUAL_STATIC_GRAY:
case GDK_VISUAL_GRAYSCALE:
components[0] = (pixel & 0xff) / 255.0f;
if (visual->depth == 1)
components[0] = components[0] == 0.0f ? 0.0f : 1.0f;
components[1] = 1.0f;
colorspace = CGColorSpaceCreateWithName (kCGColorSpaceGenericGray);
color = CGColorCreate (colorspace, components);
CGColorSpaceRelease (colorspace);
break;
default:
components[0] = (pixel >> 16 & 0xff) / 255.0;
components[1] = (pixel >> 8 & 0xff) / 255.0;
components[2] = (pixel & 0xff) / 255.0;
if (visual->depth == 32)
components[3] = (pixel >> 24 & 0xff) / 255.0;
else
components[3] = 1.0;
colorspace = CGColorSpaceCreateWithName (kCGColorSpaceGenericRGB);
color = CGColorCreate (colorspace, components);
CGColorSpaceRelease (colorspace);
break;
}
return color;
}

View File

@ -79,10 +79,6 @@ typedef enum {
GDK_QUARTZ_CONTEXT_TEXT = 1 << 2
} GdkQuartzContextValuesMask;
/* Colormap */
CGColorRef _gdk_quartz_colormap_get_cgcolor_from_pixel (GdkDrawable *drawable,
guint32 pixel);
/* Window */
gboolean _gdk_quartz_window_is_ancestor (GdkWindow *ancestor,
GdkWindow *window);