+2005-08-22 Eric Seidel <eseidel@apple.com>
+ Fix by Tobias Lidskog <tobiaslidskog@mac.com>
+
+ Reviewed by eseidel.
+
+ * kcanvas/device/KRenderingPaintServerSolid.cpp:
+ * kcanvas/device/KRenderingPaintServerSolid.h:
+ * kcanvas/device/quartz/KRenderingPaintServerQuartz.mm:
+ (KRenderingPaintServerSolidQuartz::draw):
+ * svg-tests/W3C-SVG-1.1/animate-elem-22-b-expected.png:
+ * svg-tests/W3C-SVG-1.1/masking-opacity-01-b-expected.png:
+ Group opacity was doubly-applied. This patch fixes that.
+ http://bugzilla.opendarwin.org/show_bug.cgi?id=4463
+
2005-08-22 Eric Seidel <eseidel@apple.com>
Fix by Tobias Lidskog <tobiaslidskog@mac.com>
void KRenderingPaintServerSolidQuartz::draw(KRenderingDeviceContext *renderingContext, const KCanvasCommonArgs &args, KCPaintTargetType type) const
{
- //NSLog(@"KRenderingPaintServerSolidQuartz::draw()");
KRenderingDeviceContextQuartz *quartzContext = static_cast<KRenderingDeviceContextQuartz *>(renderingContext);
CGContextRef context = quartzContext->cgContext();
KRenderingStyle *style = args.style();
applyStyleToContext(context, style);
if ( (type & APPLY_TO_FILL) && style->isFilled() ) {
- //NSLog(@"Filling in %p bbox(%@) with color: %@", context, NSStringFromRect(*(NSRect *)&CGContextGetPathBoundingBox(context)), nsColor(color()));
- CGColorRef colorCG = cgColor(color());
- CGColorRef withAlpha = CGColorCreateCopyWithAlpha(colorCG, style->fillPainter()->opacity() * style->opacity() * opacity());
+ CGColorRef colorCG = cgColor(color());
+ CGColorRef withAlpha = CGColorCreateCopyWithAlpha(colorCG, style->fillPainter()->opacity());
CGContextSetFillColorWithColor(context, withAlpha);
CGColorRelease(colorCG);
CGColorRelease(withAlpha);
}
if ( (type & APPLY_TO_STROKE) && style->isStroked() ) {
- //NSLog(@"Stroking in %p bbox(%@) with color: %@", context, NSStringFromRect(*(NSRect *)&CGContextGetPathBoundingBox(context)), nsColor(color()));
CGColorRef colorCG = cgColor(color());
- CGColorRef withAlpha = CGColorCreateCopyWithAlpha(colorCG, style->strokePainter()->opacity() * style->opacity() * opacity());
+ CGColorRef withAlpha = CGColorCreateCopyWithAlpha(colorCG, style->strokePainter()->opacity());
CGContextSetStrokeColorWithColor(context, withAlpha);
CGColorRelease(colorCG);
CGColorRelease(withAlpha);