+2006-09-13 Mark Rowe <opendarwin.org@bdash.net.nz>
+
+ Reviewed by Eric.
+
+ http://bugzilla.opendarwin.org/show_bug.cgi?id=10836
+ Bug 10836: REGRESSION: Mac implementation of Font::drawGlyphs leaks a CGColorRef
+
+ * platform/mac/FontMac.mm:
+ (WebCore::Font::drawComplexText): Release CGColorRef after use.
+ (WebCore::Font::drawGlyphs): Ditto.
+
2006-09-14 Anders Carlsson <acarlsson@apple.com>
Try fixing the Win32 build.
// ATSUI can't draw beyond -32768 to +32767 so we translate the CTM and tell ATSUI to draw at (0, 0).
CGContextRef context = graphicsContext->platformContext();
- CGContextSetFillColorWithColor(context, cgColor(graphicsContext->pen().color()));
+ CGColorRef penColor = cgColor(graphicsContext->pen().color());
+ CGContextSetFillColorWithColor(context, penColor); // WebCore expects text to respect the pen color, CG expects text to use fill
+ CGColorRelease(penColor);
CGContextTranslateCTM(context, point.x(), point.y());
status = ATSUDrawText(params.m_layout, adjustedRun.from(), runLength, 0, 0);
if (status == noErr && params.m_hasSyntheticBold) {
wkSetCGFontRenderingMode(cgContext, drawFont);
CGContextSetFontSize(cgContext, 1.0f);
- CGContextSetFillColorWithColor(cgContext, cgColor(context->pen().color())); // WebCore expects text to respect the pen color, CG expects text to use fill
+ CGColorRef penColor = cgColor(context->pen().color());
+ CGContextSetFillColorWithColor(cgContext, penColor); // WebCore expects text to respect the pen color, CG expects text to use fill
+ CGColorRelease(penColor);
CGContextSetTextPosition(cgContext, point.x(), point.y());
CGContextShowGlyphsWithAdvances(cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);