}
static CGColorRef
-get_cgcolor(unsigned long idx, struct frame *f)
+get_cgcolor(unsigned long color)
{
- NSColor *nsColor = ns_lookup_indexed_color (idx, f);
+ NSColor *nsColor = [NSColor colorWithUnsignedLong:color];
[nsColor set];
CGColorSpaceRef colorSpace = [[nsColor colorSpace] CGColorSpace];
NSInteger noc = [nsColor numberOfComponents];
return cgColor;
}
-#define CG_SET_FILL_COLOR_WITH_FACE_FOREGROUND(context, face, f) \
+#define CG_SET_FILL_COLOR_WITH_FACE_FOREGROUND(context, face) \
do { \
- CGColorRef refcol_ = get_cgcolor (NS_FACE_FOREGROUND (face), f); \
+ CGColorRef refcol_ = get_cgcolor (NS_FACE_FOREGROUND (face)); \
CGContextSetFillColorWithColor (context, refcol_) ; \
CGColorRelease (refcol_); \
} while (0)
-#define CG_SET_FILL_COLOR_WITH_FACE_BACKGROUND(context, face, f) \
+#define CG_SET_FILL_COLOR_WITH_FACE_BACKGROUND(context, face) \
do { \
- CGColorRef refcol_ = get_cgcolor (NS_FACE_BACKGROUND (face), f); \
+ CGColorRef refcol_ = get_cgcolor (NS_FACE_BACKGROUND (face)); \
CGContextSetFillColorWithColor (context, refcol_); \
CGColorRelease (refcol_); \
} while (0)
-#define CG_SET_STROKE_COLOR_WITH_FACE_FOREGROUND(context, face, f) \
+#define CG_SET_STROKE_COLOR_WITH_FACE_FOREGROUND(context, face) \
do { \
- CGColorRef refcol_ = get_cgcolor (NS_FACE_FOREGROUND (face), f); \
+ CGColorRef refcol_ = get_cgcolor (NS_FACE_FOREGROUND (face)); \
CGContextSetStrokeColorWithColor (context, refcol_); \
CGColorRelease (refcol_); \
} while (0)
CGColorRelease (colorref);
}
else
- CG_SET_FILL_COLOR_WITH_FACE_BACKGROUND (context, face, f);
+ CG_SET_FILL_COLOR_WITH_FACE_BACKGROUND (context, face);
CGContextFillRects (context, &background_rect, 1);
}
CGColorRelease (colorref);
}
else
- CG_SET_FILL_COLOR_WITH_FACE_FOREGROUND (context, face, s->f);
+ CG_SET_FILL_COLOR_WITH_FACE_FOREGROUND (context, face);
if (macfont_info->synthetic_italic_p)
atfm = synthetic_italic_atfm;
else
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
CGContextSetLineWidth (context, synthetic_bold_factor * font_size);
#endif
- CG_SET_STROKE_COLOR_WITH_FACE_FOREGROUND (context, face, f);
+ CG_SET_STROKE_COLOR_WITH_FACE_FOREGROUND (context, face);
}
if (no_antialias_p)
CGContextSetShouldAntialias (context, false);