Bug #: 4431
authoreseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Aug 2005 08:58:06 +0000 (08:58 +0000)
committereseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Aug 2005 08:58:06 +0000 (08:58 +0000)
Submitted by: Tobias Lidskog <tobiaslidskog@mac.com>
Reviewed by: eseidel
        * kcanvas/KCanvasContainer.cpp:
        (KCanvasContainer::needsTemporaryBuffer):
        * kcanvas/device/KRenderingPaintServerSolid.cpp:
        (KRenderingPaintServerSolid::opacity):
        * kcanvas/device/KRenderingPaintServerSolid.h:
        * kcanvas/device/KRenderingStyle.cpp:
        (KRenderingStyle::Private::Private):
        (KRenderingStyle::opacity):
        (KRenderingStyle::setOpacity):
        * kcanvas/device/KRenderingStyle.h:
        * kcanvas/device/quartz/KCanvasResourcesQuartz.mm:
        (KCanvasContainerQuartz::draw):
        * kcanvas/device/quartz/KRenderingPaintServerQuartz.mm:
        (KRenderingPaintServerSolidQuartz::draw):
        (KRenderingPaintServerPatternQuartz::draw):
        * kcanvas/device/quartz/QuartzSupport.mm:
        (applyStyleToContext):
        * ksvg2/core/KCanvasRenderingStyle.cpp:
        (KCanvasRenderingStyle::opacity):
        (KCanvasRenderingStyle::setOpacity):
        * ksvg2/core/KCanvasRenderingStyle.h:
        Change all references to Opacity to use floats.
        http://bugzilla.opendarwin.org/show_bug.cgi?id=4431

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

15 files changed:
LayoutTests/svg/W3C-SVG-1.1/animate-elem-22-b-expected.txt
LayoutTests/svg/W3C-SVG-1.1/filters-blend-01-b-expected.txt
LayoutTests/svg/W3C-SVG-1.1/masking-opacity-01-b-expected.txt
LayoutTests/svg/W3C-SVG-1.1/render-groups-01-b-expected.txt
WebCore/ChangeLog-2005-08-23
WebCore/kcanvas/KCanvasContainer.cpp
WebCore/kcanvas/device/KRenderingPaintServerSolid.cpp
WebCore/kcanvas/device/KRenderingPaintServerSolid.h
WebCore/kcanvas/device/KRenderingStyle.cpp
WebCore/kcanvas/device/KRenderingStyle.h
WebCore/kcanvas/device/quartz/KCanvasResourcesQuartz.mm
WebCore/kcanvas/device/quartz/KRenderingPaintServerQuartz.mm
WebCore/kcanvas/device/quartz/QuartzSupport.mm
WebCore/ksvg2/misc/KCanvasRenderingStyle.cpp
WebCore/ksvg2/misc/KCanvasRenderingStyle.h

index f282d6ccdd4e8c1168bfa62e99653e56feddc68d..86e6b0850ea733df185fc791159c86876cbb8a02 100644 (file)
@@ -4,5 +4,5 @@ KCanvasContainer at (0,0) size 479x359
       KCanvasItem {rect} at (199,134) size 51x51 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M200.00,135.00L250.00,135.00L250.00,185.00L200.00,185.00"]
       KCanvasItem {rect} at (141,106) size 167x112 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M141.67,106.67L308.33,106.67L308.33,218.33L141.67,218.33"]
       KCanvasItem {rect} at (24,49) size 401x241 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M25.00,50.00L425.00,50.00L425.00,290.00L25.00,290.00"]
-    KCanvasItem {rect} at (199,134) size 51x51 [opacity=127] [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M200.00,135.00L250.00,135.00L250.00,185.00L200.00,185.00"]
+    KCanvasItem {rect} at (199,134) size 51x51 [opacity=0.500000] [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M200.00,135.00L250.00,135.00L250.00,185.00L200.00,185.00"]
   KCanvasItem {rect} at (0,0) size 479x359 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M1.00,1.00L479.00,1.00L479.00,359.00L1.00,359.00"]
index ffe3199629de91e24c09c9e1d76a2ef3ac6ac747..7a32e15aad2fad9a080c6c91e57130233f3de25d 100644 (file)
@@ -1,13 +1,13 @@
 KCanvasContainer at (0,0) size 158x118
   KCanvasContainer at (29,5) size 121x98 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}]
     KCanvasItem at (40,5) size 100x98 [fill={server=UNIMPLEMENTED}] [data="M40.00,5.00L140.00,5.00L140.00,103.00L40.00,103.00"]
-    KCanvasItem {rect} at (29,9) size 121x11 [opacity=127] [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [filter=UNIMPLEMENTED] [data="M30.00,10.00L150.00,10.00L150.00,20.00L30.00,20.00"]
-    KCanvasItem {rect} at (29,22) size 121x11 [opacity=127] [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [filter=UNIMPLEMENTED] [data="M30.00,23.00L150.00,23.00L150.00,33.00L30.00,33.00"]
+    KCanvasItem {rect} at (29,9) size 121x11 [opacity=0.500000] [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [filter=UNIMPLEMENTED] [data="M30.00,10.00L150.00,10.00L150.00,20.00L30.00,20.00"]
+    KCanvasItem {rect} at (29,22) size 121x11 [opacity=0.500000] [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [filter=UNIMPLEMENTED] [data="M30.00,23.00L150.00,23.00L150.00,33.00L30.00,33.00"]
     KCanvasContainer at (29,35) size 121x24 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [filter=UNIMPLEMENTED]
-      KCanvasItem {rect} at (29,35) size 121x11 [opacity=127] [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M30.00,36.00L150.00,36.00L150.00,46.00L30.00,46.00"]
-      KCanvasItem {rect} at (29,48) size 121x11 [opacity=127] [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M30.00,49.00L150.00,49.00L150.00,59.00L30.00,59.00"]
-    KCanvasItem {rect} at (29,61) size 121x11 [opacity=127] [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [filter=UNIMPLEMENTED] [data="M30.00,62.00L150.00,62.00L150.00,72.00L30.00,72.00"]
-    KCanvasItem {rect} at (29,74) size 121x11 [opacity=127] [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [filter=UNIMPLEMENTED] [data="M30.00,75.00L150.00,75.00L150.00,85.00L30.00,85.00"]
-    KCanvasItem {rect} at (29,87) size 121x11 [opacity=127] [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [filter=UNIMPLEMENTED] [data="M30.00,88.00L150.00,88.00L150.00,98.00L30.00,98.00"]
+      KCanvasItem {rect} at (29,35) size 121x11 [opacity=0.500000] [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M30.00,36.00L150.00,36.00L150.00,46.00L30.00,46.00"]
+      KCanvasItem {rect} at (29,48) size 121x11 [opacity=0.500000] [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M30.00,49.00L150.00,49.00L150.00,59.00L30.00,59.00"]
+    KCanvasItem {rect} at (29,61) size 121x11 [opacity=0.500000] [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [filter=UNIMPLEMENTED] [data="M30.00,62.00L150.00,62.00L150.00,72.00L30.00,72.00"]
+    KCanvasItem {rect} at (29,74) size 121x11 [opacity=0.500000] [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [filter=UNIMPLEMENTED] [data="M30.00,75.00L150.00,75.00L150.00,85.00L30.00,85.00"]
+    KCanvasItem {rect} at (29,87) size 121x11 [opacity=0.500000] [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [filter=UNIMPLEMENTED] [data="M30.00,88.00L150.00,88.00L150.00,98.00L30.00,98.00"]
     KCanvasContainer at (0,0) size 0x0 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}]
   KCanvasItem {rect} at (0,0) size 158x118 [stroke={server=UNIMPLEMENTED, stroke width=0.500000}] [fill={server=UNIMPLEMENTED}] [data="M1.00,1.00L159.00,1.00L159.00,119.00L1.00,119.00"]
index b2f3a102761a391cd8838f0074f188d2d7d16e65..de02c395985b383beee084abc6b2158a53efe621 100644 (file)
@@ -4,13 +4,13 @@ KCanvasContainer at (0,0) size 479x359
     KCanvasContainer at (59,49) size 91x51 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}]
       KCanvasItem {rect} at (59,49) size 81x41 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M60.00,50.00L140.00,50.00L140.00,90.00L60.00,90.00"]
       KCanvasItem {rect} at (69,59) size 81x41 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M70.00,60.00L150.00,60.00L150.00,100.00L70.00,100.00"]
-    KCanvasContainer at (59,109) size 91x51 [opacity=127] [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}]
-      KCanvasItem {rect} at (59,109) size 81x41 [opacity=255] [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M60.00,110.00L140.00,110.00L140.00,150.00L60.00,150.00"]
-      KCanvasItem {rect} at (69,119) size 81x41 [opacity=255] [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M70.00,120.00L150.00,120.00L150.00,160.00L70.00,160.00"]
+    KCanvasContainer at (59,109) size 91x51 [opacity=0.500000] [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}]
+      KCanvasItem {rect} at (59,109) size 81x41 [opacity=1.000000] [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M60.00,110.00L140.00,110.00L140.00,150.00L60.00,150.00"]
+      KCanvasItem {rect} at (69,119) size 81x41 [opacity=1.000000] [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M70.00,120.00L150.00,120.00L150.00,160.00L70.00,160.00"]
     KCanvasContainer at (59,169) size 91x51 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}]
-      KCanvasItem {rect} at (59,169) size 81x41 [opacity=127] [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M60.00,170.00L140.00,170.00L140.00,210.00L60.00,210.00"]
-      KCanvasItem {rect} at (69,179) size 81x41 [opacity=127] [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M70.00,180.00L150.00,180.00L150.00,220.00L70.00,220.00"]
-    KCanvasContainer at (59,229) size 91x51 [opacity=127] [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}]
+      KCanvasItem {rect} at (59,169) size 81x41 [opacity=0.500000] [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M60.00,170.00L140.00,170.00L140.00,210.00L60.00,210.00"]
+      KCanvasItem {rect} at (69,179) size 81x41 [opacity=0.500000] [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M70.00,180.00L150.00,180.00L150.00,220.00L70.00,220.00"]
+    KCanvasContainer at (59,229) size 91x51 [opacity=0.500000] [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}]
       KCanvasItem {rect} at (59,229) size 81x41 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M60.00,230.00L140.00,230.00L140.00,270.00L60.00,270.00"]
       KCanvasItem {rect} at (69,239) size 81x41 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M70.00,240.00L150.00,240.00L150.00,280.00L70.00,280.00"]
   KCanvasItem {rect} at (0,0) size 479x359 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M1.00,1.00L479.00,1.00L479.00,359.00L1.00,359.00"]
index bbc8cfd3013af56a6f69734735f2eebc01a5e7bb..a96ccf3eed75c105291333419e37e5bb084863e2 100644 (file)
@@ -11,7 +11,7 @@ KCanvasContainer at (0,0) size 479x359
       KCanvasItem {line} at (382,18) size 27x297 [stroke={server=UNIMPLEMENTED, stroke width=15.000000}] [fill={server=UNIMPLEMENTED}] [data="M220.00,10.00L220.00,175.00"]
       KCanvasItem {line} at (436,18) size 27x297 [stroke={server=UNIMPLEMENTED, stroke width=15.000000}] [fill={server=UNIMPLEMENTED}] [data="M250.00,10.00L250.00,175.00"]
       KCanvasItem {rect} at (35,17) size 415x280 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M20.00,10.00L250.00,10.00L250.00,165.00L20.00,165.00"]
-      KCanvasContainer at (125,98) size 310x181 [opacity=127] [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}]
-        KCanvasItem {rect} at (125,98) size 235x127 [opacity=255] [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M70.00,55.00L200.00,55.00L200.00,125.00L70.00,125.00"]
-        KCanvasItem at (291,135) size 144x144 [opacity=255] [fill={server=UNIMPLEMENTED}] [data="M162.00,75.00L242.00,75.00L242.00,155.00L162.00,155.00"]
+      KCanvasContainer at (125,98) size 310x181 [opacity=0.500000] [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}]
+        KCanvasItem {rect} at (125,98) size 235x127 [opacity=1.000000] [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M70.00,55.00L200.00,55.00L200.00,125.00L70.00,125.00"]
+        KCanvasItem at (291,135) size 144x144 [opacity=1.000000] [fill={server=UNIMPLEMENTED}] [data="M162.00,75.00L242.00,75.00L242.00,155.00L162.00,155.00"]
   KCanvasItem {rect} at (0,0) size 479x359 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M1.00,1.00L479.00,1.00L479.00,359.00L1.00,359.00"]
index 992477e291092115436c5c61bccbc085d7db2a0b..e7e868218b101f2f77b4842a69d65539a216535f 100644 (file)
@@ -1,3 +1,32 @@
+2005-08-16  Eric Seidel  <eseidel@apple.com>
+        Fix from Tobias Lidskog <tobiaslidskog@mac.com>
+
+        Reviewed by eseidel.
+
+        * kcanvas/KCanvasContainer.cpp:
+        (KCanvasContainer::needsTemporaryBuffer):
+        * kcanvas/device/KRenderingPaintServerSolid.cpp:
+        (KRenderingPaintServerSolid::opacity):
+        * kcanvas/device/KRenderingPaintServerSolid.h:
+        * kcanvas/device/KRenderingStyle.cpp:
+        (KRenderingStyle::Private::Private):
+        (KRenderingStyle::opacity):
+        (KRenderingStyle::setOpacity):
+        * kcanvas/device/KRenderingStyle.h:
+        * kcanvas/device/quartz/KCanvasResourcesQuartz.mm:
+        (KCanvasContainerQuartz::draw):
+        * kcanvas/device/quartz/KRenderingPaintServerQuartz.mm:
+        (KRenderingPaintServerSolidQuartz::draw):
+        (KRenderingPaintServerPatternQuartz::draw):
+        * kcanvas/device/quartz/QuartzSupport.mm:
+        (applyStyleToContext):
+        * ksvg2/core/KCanvasRenderingStyle.cpp:
+        (KCanvasRenderingStyle::opacity):
+        (KCanvasRenderingStyle::setOpacity):
+        * ksvg2/core/KCanvasRenderingStyle.h:
+        Change all references to Opacity to use floats.
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=4431
+
 2005-08-16  Eric Seidel  <eseidel@apple.com>
 
         Reviewed by mjs.
index b6745411220f198c9839a83607c6973788f11d19..86c5925a94a1b621b35ddbff3b38b90e7aafb1c4 100644 (file)
@@ -61,7 +61,7 @@ void KCanvasContainer::setDrawContents(bool drawContents)
 
 bool KCanvasContainer::needsTemporaryBuffer() const
 {
-       bool conditionOne = (style()->opacity() < 255);
+       bool conditionOne = (style()->opacity() < 1.0f);
        bool conditionTwo = (style()->clipPaths().count() > 0);
 
        return conditionOne || conditionTwo;
index e99aec0bdb788148d2d742cba3483f55e96c106f..1b04b895756a2a6a0cbcb47a5d8855b1b4d14529 100644 (file)
@@ -55,9 +55,9 @@ KCPaintServerType KRenderingPaintServerSolid::type() const
        return PS_SOLID;
 }
 
-double KRenderingPaintServerSolid::opacity() const
+float KRenderingPaintServerSolid::opacity() const
 {
-       return double(qAlpha(d->color.rgb()) / 255.);
+       return float(qAlpha(d->color.rgb()) / 255.);
 }
 
 // vim:ts=4:noet
index b3a3967cdb475bcf271a341e07649fbd819a5ea7..71e5a9e4ebbaed73cc8de066a2726e4afcb1300f 100644 (file)
@@ -40,7 +40,7 @@ public:
        void setColor(const QColor &color);
 
        // Helper method
-       double opacity() const;
+       float opacity() const;
 
 private:
        class Private;
index 0bb3172ce80f1289ee2dc1653378651c437bc8a8..d97b5161f4e717dcca44ee3ad1fdd85014de70d8 100644 (file)
@@ -44,7 +44,7 @@ public:
        
                imageRendering = IR_OPTIMIZE_QUALITY;
 
-               opacity = 255;
+               opacity = 1.0f;
        }
 
        ~Private()
@@ -74,7 +74,7 @@ public:
        KCanvasMarker *midMarker;
        KCanvasMarker *endMarker;
 
-       int opacity;
+       float opacity;
 };
 
 KRenderingStyle::KRenderingStyle() : d(new Private())
@@ -178,12 +178,12 @@ void KRenderingStyle::setImageRendering(KCImageRendering ir)
 }
 
 // Overall opacity
-int KRenderingStyle::opacity() const
+float KRenderingStyle::opacity() const
 {
        return d->opacity;
 }
 
-void KRenderingStyle::setOpacity(int opacity)
+void KRenderingStyle::setOpacity(float opacity)
 {
        d->opacity = opacity;
 }
index 41d0660a892190b221d64b20e4e6a7b817713a27..b9985e2de33851f16e02d4b3f4138c4ef41c927b 100644 (file)
@@ -96,8 +96,8 @@ public:
        virtual void setImageRendering(KCImageRendering ir);
 
        // Overall opacity
-       virtual int opacity() const;
-       virtual void setOpacity(int opacity);
+       virtual float opacity() const;
+       virtual void setOpacity(float opacity);
 
        // Clipping
        virtual QStringList clipPaths() const;
index 01d13d24b1a9c7b604d1d86fa008778a531856d1..5a5e45aff34872b328a30cd70f0908bb1904d11d 100644 (file)
@@ -80,7 +80,7 @@ void KCanvasContainerQuartz::draw(const QRect &dirtyRect) const
        applyClipPathsForStyle(context, canvas()->registry(), style(), bbox()); // apply any explicit clips
        
        // handle opacity.
-       float opacity = (style()->opacity() / 255.0f);
+       float opacity = style()->opacity();
        if (opacity < 1.0f) {
                CGContextSetAlpha(context, opacity);
                CGContextBeginTransparencyLayer(context,NULL);
index d8ac9a6153dc0afb1449b0e2e51f5a94429ba2f4..4e3d7b033b688b62880df1b06e15716169a23153 100644 (file)
@@ -51,7 +51,7 @@ void KRenderingPaintServerSolidQuartz::draw(KRenderingDeviceContext *renderingCo
        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() * double(style->opacity() / 255.) * opacity());
+               CGColorRef withAlpha = CGColorCreateCopyWithAlpha(colorCG, style->fillPainter()->opacity() * style->opacity() * opacity());
                CGContextSetFillColorWithColor(context, withAlpha);
                CGColorRelease(colorCG);
                CGColorRelease(withAlpha);
@@ -65,7 +65,7 @@ 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() * double(style->opacity() / 255.) * opacity());            
+               CGColorRef withAlpha = CGColorCreateCopyWithAlpha(colorCG, style->strokePainter()->opacity() * style->opacity() * opacity());           
                CGContextSetStrokeColorWithColor(context, withAlpha);
                CGColorRelease(colorCG);
                CGColorRelease(withAlpha);
@@ -100,7 +100,7 @@ void KRenderingPaintServerPatternQuartz::draw(KRenderingDeviceContext *rendering
 
        CGSize cellSize = CGSize(cell->size());
        
-       float alpha = 1; // style->opacity() / 255.0f; //which?
+       float alpha = 1; // style->opacity(); //which?
                
        // Patterns don't seem to resepect the CTM unless we make them...
        CGAffineTransform ctm = CGContextGetCTM(context);
index 6f3483591406b7b6407b91695785bc5529fc6315..f43374bdef9ad5fd304c834aa5d13a5e6d199bab 100644 (file)
@@ -115,7 +115,7 @@ void applyClipPathsForStyle(CGContextRef context, KCanvasRegistry *registry, KRe
 
 void applyStyleToContext(CGContextRef context, KRenderingStyle *style)
 {      
-       CGContextSetAlpha(context, style->opacity() / 255.0f);
+       CGContextSetAlpha(context, style->opacity());
 }
 
 void applyStrokeStyleToContext(CGContextRef context, KRenderingStyle *style)
index f46cf4bfa8e4e0307b8e5fecee4095d540e70ceb..5a299af74b80cc60d19920d497826be2bac52137 100644 (file)
@@ -292,12 +292,12 @@ void KCanvasRenderingStyle::setImageRendering(KCImageRendering)
 }
 
 // Overall opacity
-int KCanvasRenderingStyle::opacity() const
+float KCanvasRenderingStyle::opacity() const
 {
-       return int(m_style->opacity() * 255.);
+       return m_style->opacity();
 }
 
-void KCanvasRenderingStyle::setOpacity(int)
+void KCanvasRenderingStyle::setOpacity(float)
 {
        // no-op
 }
index a91edfd9fd85fe63131dbb765c5f52bf7719b7fa..c7b771f04faafa10fe3f6e833457fe764a7972aa 100644 (file)
@@ -73,8 +73,8 @@ namespace KSVG
                virtual void setImageRendering(KCImageRendering ir);
 
                // Overall opacity
-               virtual int opacity() const;
-               virtual void setOpacity(int);
+               virtual float opacity() const;
+               virtual void setOpacity(float);
 
                // Clipping
                virtual QStringList clipPaths() const;