Bug #: 4463
authoreseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Aug 2005 10:45:15 +0000 (10:45 +0000)
committereseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Aug 2005 10:45:15 +0000 (10:45 +0000)
Submitted 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

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@10280 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/svg/W3C-SVG-1.1/animate-elem-22-b-expected.png
LayoutTests/svg/W3C-SVG-1.1/masking-opacity-01-b-expected.png
WebCore/ChangeLog-2005-08-23
WebCore/kcanvas/device/KRenderingPaintServerSolid.cpp
WebCore/kcanvas/device/KRenderingPaintServerSolid.h
WebCore/kcanvas/device/quartz/KRenderingPaintServerQuartz.mm

index d9e0d568f7ccccf872bdb15c6778537d9cb7b4fa..fb8da471c5b15cc57163beb9f7fcdc1fcf6445f5 100644 (file)
Binary files a/LayoutTests/svg/W3C-SVG-1.1/animate-elem-22-b-expected.png and b/LayoutTests/svg/W3C-SVG-1.1/animate-elem-22-b-expected.png differ
index cbbf41bb760dc12d4ded4f344c2f6a4dc0794d69..aa18e841d39bca86a5402ff1fe50d4158064ff3d 100644 (file)
Binary files a/LayoutTests/svg/W3C-SVG-1.1/masking-opacity-01-b-expected.png and b/LayoutTests/svg/W3C-SVG-1.1/masking-opacity-01-b-expected.png differ
index f5185ee46eb5ea8ab2e87bc9fb6419d5053f01ee..b9d6e4b8eaac4f620a6b85cf347ee680ce6ba7f5 100644 (file)
@@ -1,3 +1,17 @@
+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>
 
index 1b04b895756a2a6a0cbcb47a5d8855b1b4d14529..ccc3af032cf01da1e297045d93065b261c8a4ef9 100644 (file)
@@ -55,9 +55,4 @@ KCPaintServerType KRenderingPaintServerSolid::type() const
        return PS_SOLID;
 }
 
-float KRenderingPaintServerSolid::opacity() const
-{
-       return float(qAlpha(d->color.rgb()) / 255.);
-}
-
 // vim:ts=4:noet
index 71e5a9e4ebbaed73cc8de066a2726e4afcb1300f..20c609b6adad8ab50bd17e9403f0c5d40a4848a2 100644 (file)
@@ -39,9 +39,6 @@ public:
        QColor color() const;
        void setColor(const QColor &color);
 
-       // Helper method
-       float opacity() const;
-
 private:
        class Private;
        Private *d;
index 4e3d7b033b688b62880df1b06e15716169a23153..2019db3958bff929b0ed3681b3b6d1f5b78fa53b 100644 (file)
@@ -41,7 +41,6 @@
 
 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();
@@ -49,9 +48,8 @@ void KRenderingPaintServerSolidQuartz::draw(KRenderingDeviceContext *renderingCo
        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);
@@ -63,9 +61,8 @@ void KRenderingPaintServerSolidQuartz::draw(KRenderingDeviceContext *renderingCo
        }
        
        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);