Reviewed by Eric. Rubber stamped by Oliver.
authorzimmermann <zimmermann@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Nov 2006 21:47:57 +0000 (21:47 +0000)
committerzimmermann <zimmermann@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Nov 2006 21:47:57 +0000 (21:47 +0000)
Fixes: http://bugs.webkit.org/show_bug.cgi?id=10383
This is the final patch after the long "die kcanvas" journey.

All old kcanvas code is gone now, and properly integrated within
WebCore (stuff like GraphicsContext changes etc.). It shares
the platform/ design concept: no subclassing, but instead
implementing parts of the classes/methods per-platform.

This commit removes the last pieces: KRenderingDevice & KRenderingDeviceContext.
This layer was just obsolete, given the powerful GraphicsContext API we have
since quite a while now. All the ugly pushContext/popContext stuff is gone now.

The naming issues Cg vs. CG will be fixed in one shot, when moving the whole
platform/graphics/svg directory down into ksvg2/graphics - as discussed with Darin.

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

91 files changed:
WebCore/CMakeLists.txt
WebCore/ChangeLog
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/kcanvas/device/KRenderingDevice.cpp [deleted file]
WebCore/kcanvas/device/KRenderingDevice.h [deleted file]
WebCore/kcanvas/device/qt/KRenderingDeviceQt.cpp [deleted file]
WebCore/kcanvas/device/qt/KRenderingDeviceQt.h [deleted file]
WebCore/kcanvas/device/quartz/KRenderingDeviceQuartz.cpp [deleted file]
WebCore/kcanvas/device/quartz/KRenderingDeviceQuartz.h [deleted file]
WebCore/ksvg2/misc/KCanvasRenderingStyle.cpp
WebCore/ksvg2/misc/KCanvasRenderingStyle.h
WebCore/ksvg2/svg/SVGAElement.cpp
WebCore/ksvg2/svg/SVGClipPathElement.cpp
WebCore/ksvg2/svg/SVGFEBlendElement.cpp
WebCore/ksvg2/svg/SVGFEColorMatrixElement.cpp
WebCore/ksvg2/svg/SVGFEComponentTransferElement.cpp
WebCore/ksvg2/svg/SVGFECompositeElement.cpp
WebCore/ksvg2/svg/SVGFEDiffuseLightingElement.cpp
WebCore/ksvg2/svg/SVGFEDisplacementMapElement.cpp
WebCore/ksvg2/svg/SVGFEDistantLightElement.cpp
WebCore/ksvg2/svg/SVGFEFloodElement.cpp
WebCore/ksvg2/svg/SVGFEFuncAElement.cpp
WebCore/ksvg2/svg/SVGFEFuncBElement.cpp
WebCore/ksvg2/svg/SVGFEFuncGElement.cpp
WebCore/ksvg2/svg/SVGFEFuncRElement.cpp
WebCore/ksvg2/svg/SVGFEGaussianBlurElement.cpp
WebCore/ksvg2/svg/SVGFEImageElement.cpp
WebCore/ksvg2/svg/SVGFELightElement.cpp
WebCore/ksvg2/svg/SVGFEMergeElement.cpp
WebCore/ksvg2/svg/SVGFEMergeNodeElement.cpp
WebCore/ksvg2/svg/SVGFEOffsetElement.cpp
WebCore/ksvg2/svg/SVGFEPointLightElement.cpp
WebCore/ksvg2/svg/SVGFESpecularLightingElement.cpp
WebCore/ksvg2/svg/SVGFESpotLightElement.cpp
WebCore/ksvg2/svg/SVGFETileElement.cpp
WebCore/ksvg2/svg/SVGFETurbulenceElement.cpp
WebCore/ksvg2/svg/SVGFilterElement.cpp
WebCore/ksvg2/svg/SVGGradientElement.cpp
WebCore/ksvg2/svg/SVGLinearGradientElement.cpp
WebCore/ksvg2/svg/SVGMarkerElement.cpp
WebCore/ksvg2/svg/SVGMaskElement.cpp
WebCore/ksvg2/svg/SVGPatternElement.cpp
WebCore/ksvg2/svg/SVGStyledElement.cpp
WebCore/ksvg2/svg/SVGStyledElement.h
WebCore/platform/graphics/GraphicsContext.h
WebCore/platform/graphics/cg/GraphicsContextCG.cpp
WebCore/platform/graphics/svg/SVGPaintServer.h
WebCore/platform/graphics/svg/SVGPaintServerGradient.cpp
WebCore/platform/graphics/svg/SVGPaintServerGradient.h
WebCore/platform/graphics/svg/SVGPaintServerLinearGradient.h
WebCore/platform/graphics/svg/SVGPaintServerPattern.h
WebCore/platform/graphics/svg/SVGPaintServerRadialGradient.h
WebCore/platform/graphics/svg/SVGPaintServerSolid.h
WebCore/platform/graphics/svg/SVGResource.cpp
WebCore/platform/graphics/svg/SVGResource.h
WebCore/platform/graphics/svg/SVGResourceClipper.h
WebCore/platform/graphics/svg/SVGResourceFilter.h
WebCore/platform/graphics/svg/SVGResourceMasker.h
WebCore/platform/graphics/svg/cg/CgSupport.cpp [moved from WebCore/kcanvas/device/quartz/QuartzSupport.cpp with 98% similarity]
WebCore/platform/graphics/svg/cg/CgSupport.h [moved from WebCore/kcanvas/device/quartz/QuartzSupport.h with 97% similarity]
WebCore/platform/graphics/svg/cg/RenderPathCg.cpp [moved from WebCore/kcanvas/device/quartz/KCanvasItemQuartz.cpp with 97% similarity]
WebCore/platform/graphics/svg/cg/SVGPaintServerCg.cpp
WebCore/platform/graphics/svg/cg/SVGPaintServerGradientCg.cpp
WebCore/platform/graphics/svg/cg/SVGPaintServerPatternCg.cpp
WebCore/platform/graphics/svg/cg/SVGPaintServerSolidCg.cpp
WebCore/platform/graphics/svg/cg/SVGResourceClipperCg.cpp
WebCore/platform/graphics/svg/cg/SVGResourceFilterCg.mm
WebCore/platform/graphics/svg/cg/SVGResourceMaskerCg.mm
WebCore/platform/graphics/svg/filters/cg/SVGFEImageCg.mm
WebCore/platform/graphics/svg/qt/RenderPathQt.cpp [moved from WebCore/kcanvas/device/qt/RenderPathQt.cpp with 100% similarity]
WebCore/platform/graphics/svg/qt/SVGPaintServerLinearGradientQt.cpp
WebCore/platform/graphics/svg/qt/SVGPaintServerPatternQt.cpp
WebCore/platform/graphics/svg/qt/SVGPaintServerQt.cpp
WebCore/platform/graphics/svg/qt/SVGPaintServerRadialGradientQt.cpp
WebCore/platform/graphics/svg/qt/SVGPaintServerSolidQt.cpp
WebCore/platform/graphics/svg/qt/SVGResourceClipperQt.cpp
WebCore/platform/graphics/svg/qt/SVGResourceFilterQt.cpp
WebCore/platform/graphics/svg/qt/SVGResourceMaskerQt.cpp
WebCore/platform/mac/GraphicsContextMac.mm
WebCore/platform/qt/GraphicsContextQt.cpp
WebCore/rendering/RenderForeignObject.cpp
WebCore/rendering/RenderPath.cpp
WebCore/rendering/RenderSVGContainer.cpp
WebCore/rendering/RenderSVGImage.cpp
WebCore/rendering/RenderSVGImage.h
WebCore/rendering/RenderSVGInline.cpp
WebCore/rendering/RenderSVGInlineText.cpp
WebCore/rendering/RenderSVGTSpan.cpp
WebCore/rendering/RenderSVGText.cpp
WebCore/rendering/SVGInlineFlowBox.cpp
WebCore/rendering/SVGRenderTreeAsText.cpp

index ae71bc36b71382024ef686ed3872e38ac8b94237..7092f09ccf8cc0ac6976193339e66f8598619deb 100644 (file)
@@ -19,9 +19,6 @@ include_directories(
    ${CMAKE_CURRENT_SOURCE_DIR}/editing
    ${CMAKE_CURRENT_BINARY_DIR}/html
    ${CMAKE_CURRENT_SOURCE_DIR}/html
-   ${CMAKE_CURRENT_SOURCE_DIR}/kcanvas
-   ${CMAKE_CURRENT_SOURCE_DIR}/kcanvas/device
-   ${CMAKE_CURRENT_SOURCE_DIR}/kcanvas/device/qt 
    ${CMAKE_CURRENT_SOURCE_DIR}/ksvg2 
    ${CMAKE_CURRENT_SOURCE_DIR}/ksvg2/css
    ${CMAKE_CURRENT_SOURCE_DIR}/ksvg2/events 
@@ -534,10 +531,6 @@ set (SVG_SOURCES
     bindings/js/JSSVGPoint.cpp
     bindings/js/JSSVGRect.cpp
 
-    kcanvas/device/KRenderingDevice.cpp
-    kcanvas/device/qt/KRenderingDeviceQt.cpp
-    kcanvas/device/qt/RenderPathQt.cpp
-
     ksvg2/css/SVGCSSParser.cpp
     ksvg2/css/SVGCSSStyleSelector.cpp
     ksvg2/css/SVGRenderStyle.cpp
@@ -1073,6 +1066,7 @@ set(WebCore_SRCS
     platform/graphics/svg/filters/SVGFilterEffect.cpp
     platform/graphics/svg/filters/SVGLightSource.cpp
 
+    platform/graphics/svg/qt/RenderPathQt.cpp
     platform/graphics/svg/qt/SVGPaintServerGradientQt.cpp
     platform/graphics/svg/qt/SVGPaintServerLinearGradientQt.cpp
     platform/graphics/svg/qt/SVGPaintServerPatternQt.cpp
index 991bde76dfca5e00a56b6dc4db1394063c6ebb6d..ed0d62af10eb12226e670ca829dda18f35547c9e 100644 (file)
@@ -1,3 +1,209 @@
+2006-11-30  Nikolas Zimmermann  <zimmermann@kde.org>
+
+        Reviewed by Eric. Rubber stamped by Oliver.
+
+        Fixes: http://bugs.webkit.org/show_bug.cgi?id=10383
+     
+        This is the final patch after the long "die kcanvas" journey.
+
+        All old kcanvas code is gone now, and properly integrated within
+        WebCore (stuff like GraphicsContext changes etc.). It shares
+        the platform/ design concept: no subclassing, but instead
+        implementing parts of the classes/methods per-platform.
+
+        This commit removes the last pieces: KRenderingDevice & KRenderingDeviceContext.
+        This layer was just obsolete, given the powerful GraphicsContext API we have
+        since quite a while now. All the ugly pushContext/popContext stuff is gone now.
+
+        LayoutTests affected: svg/W3C-SVG-1.1/pservers-grad-11-b.svg
+        Radial gradients as fill color for texts, work again!
+        Though "Gradient on text stroke" remains broken. Funny thing:
+        With this patch, if you "select" the text using the mouse, as
+        soon as the selection rectangle is drawn, you see the correct
+        gradient on stroke rendering - at least a hint where it breaks!
+
+        All svg layout tests have subtle text rendering changes - with and without this
+        patch, it seems it was forgotton to update svg pixel test baseline, a while ago.
+
+        * CMakeLists.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * kcanvas/device/KRenderingDevice.cpp: Removed.
+        * kcanvas/device/KRenderingDevice.h: Removed.
+        * kcanvas/device/qt/KRenderingDeviceQt.cpp: Removed.
+        * kcanvas/device/qt/KRenderingDeviceQt.h: Removed.
+        * kcanvas/device/qt/RenderPathQt.cpp: Moved to platform/graphics/qt
+        * kcanvas/device/quartz/KCanvasItemQuartz.cpp: Moved to platform/graphics/svg/cg/RenderPathCg.cpp
+        * kcanvas/device/quartz/KRenderingDeviceQuartz.cpp: Removed.
+        * kcanvas/device/quartz/KRenderingDeviceQuartz.h: Removed.
+        * kcanvas/device/quartz/QuartzSupport.cpp: Moved to platform/graphics/svg/cg/CgSupport.cpp
+        * kcanvas/device/quartz/QuartzSupport.h: Moved to platform/graphics/svg/cg/CgSupport.h
+        * ksvg2/misc/KCanvasRenderingStyle.cpp:
+        (WebCore::sharedSolidPaintServer):
+        * ksvg2/misc/KCanvasRenderingStyle.h:
+        * ksvg2/svg/SVGAElement.cpp:
+        * ksvg2/svg/SVGClipPathElement.cpp:
+        * ksvg2/svg/SVGFEBlendElement.cpp:
+        (WebCore::SVGFEBlendElement::filterEffect):
+        * ksvg2/svg/SVGFEColorMatrixElement.cpp:
+        (WebCore::SVGFEColorMatrixElement::filterEffect):
+        * ksvg2/svg/SVGFEComponentTransferElement.cpp:
+        (WebCore::SVGFEComponentTransferElement::SVGFEComponentTransferElement):
+        (WebCore::SVGFEComponentTransferElement::parseMappedAttribute):
+        (WebCore::SVGFEComponentTransferElement::filterEffect):
+        * ksvg2/svg/SVGFECompositeElement.cpp:
+        (WebCore::SVGFECompositeElement::SVGFECompositeElement):
+        (WebCore::SVGFECompositeElement::filterEffect):
+        * ksvg2/svg/SVGFEDiffuseLightingElement.cpp:
+        (WebCore::SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement):
+        (WebCore::SVGFEDiffuseLightingElement::filterEffect):
+        (WebCore::SVGFEDiffuseLightingElement::updateLights):
+        * ksvg2/svg/SVGFEDisplacementMapElement.cpp:
+        (WebCore::SVGFEDisplacementMapElement::filterEffect):
+        * ksvg2/svg/SVGFEDistantLightElement.cpp:
+        (WebCore::SVGFEDistantLightElement::SVGFEDistantLightElement):
+        (WebCore::SVGFEDistantLightElement::lightSource):
+        * ksvg2/svg/SVGFEFloodElement.cpp:
+        (WebCore::SVGFEFloodElement::SVGFEFloodElement):
+        (WebCore::SVGFEFloodElement::parseMappedAttribute):
+        (WebCore::SVGFEFloodElement::filterEffect):
+        * ksvg2/svg/SVGFEFuncAElement.cpp:
+        * ksvg2/svg/SVGFEFuncBElement.cpp:
+        * ksvg2/svg/SVGFEFuncGElement.cpp:
+        (WebCore::SVGFEFuncGElement::SVGFEFuncGElement):
+        * ksvg2/svg/SVGFEFuncRElement.cpp:
+        * ksvg2/svg/SVGFEGaussianBlurElement.cpp:
+        (WebCore::SVGFEGaussianBlurElement::filterEffect):
+        * ksvg2/svg/SVGFEImageElement.cpp:
+        (WebCore::SVGFEImageElement::SVGFEImageElement):
+        (WebCore::SVGFEImageElement::parseMappedAttribute):
+        (WebCore::SVGFEImageElement::notifyFinished):
+        (WebCore::SVGFEImageElement::filterEffect):
+        * ksvg2/svg/SVGFELightElement.cpp:
+        * ksvg2/svg/SVGFEMergeElement.cpp:
+        (WebCore::SVGFEMergeElement::filterEffect):
+        * ksvg2/svg/SVGFEMergeNodeElement.cpp:
+        * ksvg2/svg/SVGFEOffsetElement.cpp:
+        (WebCore::SVGFEOffsetElement::SVGFEOffsetElement):
+        (WebCore::SVGFEOffsetElement::parseMappedAttribute):
+        (WebCore::SVGFEOffsetElement::filterEffect):
+        * ksvg2/svg/SVGFEPointLightElement.cpp:
+        (WebCore::SVGFEPointLightElement::lightSource):
+        * ksvg2/svg/SVGFESpecularLightingElement.cpp:
+        (WebCore::SVGFESpecularLightingElement::SVGFESpecularLightingElement):
+        (WebCore::SVGFESpecularLightingElement::filterEffect):
+        (WebCore::SVGFESpecularLightingElement::updateLights):
+        * ksvg2/svg/SVGFESpotLightElement.cpp:
+        (WebCore::SVGFESpotLightElement::SVGFESpotLightElement):
+        (WebCore::SVGFESpotLightElement::lightSource):
+        * ksvg2/svg/SVGFETileElement.cpp:
+        (WebCore::SVGFETileElement::SVGFETileElement):
+        (WebCore::SVGFETileElement::parseMappedAttribute):
+        (WebCore::SVGFETileElement::filterEffect):
+        * ksvg2/svg/SVGFETurbulenceElement.cpp:
+        (WebCore::SVGFETurbulenceElement::filterEffect):
+        * ksvg2/svg/SVGFilterElement.cpp:
+        (WebCore::SVGFilterElement::canvasResource):
+        * ksvg2/svg/SVGGradientElement.cpp:
+        (WebCore::SVGGradientElement::canvasResource):
+        * ksvg2/svg/SVGLinearGradientElement.cpp:
+        * ksvg2/svg/SVGMarkerElement.cpp:
+        * ksvg2/svg/SVGMaskElement.cpp:
+        (WebCore::SVGMaskElement::parseMappedAttribute):
+        (WebCore::SVGMaskElement::drawMaskerContent):
+        (WebCore::SVGMaskElement::canvasResource):
+        * ksvg2/svg/SVGPatternElement.cpp:
+        (WebCore::SVGPatternElement::drawPatternContentIntoTile):
+        (WebCore::SVGPatternElement::canvasResource):
+        * ksvg2/svg/SVGStyledElement.cpp:
+        * ksvg2/svg/SVGStyledElement.h:
+        * platform/graphics/GraphicsContext.h:
+        * platform/graphics/svg/SVGPaintServer.h:
+        * platform/graphics/svg/SVGPaintServerGradient.cpp:
+        (WebCore::SVGPaintServerGradient::SVGPaintServerGradient):
+        * platform/graphics/svg/SVGPaintServerGradient.h:
+        * platform/graphics/svg/SVGPaintServerLinearGradient.h:
+        * platform/graphics/svg/SVGPaintServerPattern.h:
+        * platform/graphics/svg/SVGPaintServerRadialGradient.h:
+        * platform/graphics/svg/SVGPaintServerSolid.h:
+        * platform/graphics/svg/SVGResource.cpp:
+        * platform/graphics/svg/SVGResource.h:
+        * platform/graphics/svg/SVGResourceClipper.h:
+        * platform/graphics/svg/SVGResourceFilter.h:
+        * platform/graphics/svg/SVGResourceMasker.h:
+        * platform/graphics/svg/cg/RenderPathCg.cpp: Added.
+        * platform/graphics/svg/cg/SVGPaintServerCg.cpp:
+        (WebCore::SVGPaintServer::draw):
+        (WebCore::SVGPaintServer::teardown):
+        (WebCore::SVGPaintServer::renderPath):
+        * platform/graphics/svg/cg/SVGPaintServerGradientCg.cpp:
+        (WebCore::SVGPaintServerGradient::teardown):
+        (WebCore::SVGPaintServerGradient::renderPath):
+        (WebCore::SVGPaintServerGradient::setup):
+        * platform/graphics/svg/cg/SVGPaintServerPatternCg.cpp:
+        (WebCore::SVGPaintServerPattern::setup):
+        (WebCore::SVGPaintServerPattern::teardown):
+        * platform/graphics/svg/cg/SVGPaintServerSolidCg.cpp:
+        (WebCore::SVGPaintServerSolid::setup):
+        * platform/graphics/svg/cg/SVGResourceClipperCg.cpp:
+        (WebCore::SVGResourceClipper::applyClip):
+        * platform/graphics/svg/cg/SVGResourceFilterCg.mm:
+        (WebCore::SVGResourceFilter::SVGResourceFilter):
+        (WebCore::SVGResourceFilter::createFilterEffect):
+        (WebCore::SVGResourceFilter::prepareFilter):
+        (WebCore::SVGResourceFilter::applyFilter):
+        * platform/graphics/svg/cg/SVGResourceMaskerCg.mm:
+        (WebCore::SVGResourceMasker::applyMask):
+        * platform/graphics/svg/filters/cg/SVGFEImageCg.mm:
+        * platform/graphics/svg/qt/SVGPaintServerLinearGradientQt.cpp:
+        (WebCore::SVGPaintServerLinearGradient::setup):
+        * platform/graphics/svg/qt/SVGPaintServerPatternQt.cpp:
+        (WebCore::SVGPaintServerPattern::setup):
+        * platform/graphics/svg/qt/SVGPaintServerQt.cpp:
+        (WebCore::SVGPaintServer::draw):
+        (WebCore::SVGPaintServer::teardown):
+        (WebCore::SVGPaintServer::renderPath):
+        * platform/graphics/svg/qt/SVGPaintServerRadialGradientQt.cpp:
+        (WebCore::setup):
+        * platform/graphics/svg/qt/SVGPaintServerSolidQt.cpp:
+        (WebCore::SVGPaintServerSolid::setup):
+        * platform/graphics/svg/qt/SVGResourceClipperQt.cpp:
+        (WebCore::SVGResourceClipper::applyClip):
+        * platform/graphics/svg/qt/SVGResourceFilterQt.cpp:
+        (WebCore::SVGResourceFilter::createFilterEffect):
+        (WebCore::SVGResourceFilter::prepareFilter):
+        (WebCore::SVGResourceFilter::applyFilter):
+        * platform/graphics/svg/qt/SVGResourceMaskerQt.cpp:
+        (WebCore::SVGResourceMasker::applyMask):
+        * platform/qt/GraphicsContextQt.cpp:
+        (WebCore::GraphicsContext::beginPath):
+        (WebCore::GraphicsContext::addPath):
+        (WebCore::GraphicsContext::setFillRule):
+        (WebCore::GraphicsContext::currentPath):
+        (WebCore::GraphicsContext::strokeRect):
+        (WebCore::contextForImage):
+        * rendering/RenderForeignObject.cpp:
+        (WebCore::RenderForeignObject::paint):
+        * rendering/RenderPath.cpp:
+        (WebCore::RenderPath::paint):
+        * rendering/RenderSVGContainer.cpp:
+        (WebCore::RenderSVGContainer::paint):
+        * rendering/RenderSVGImage.cpp:
+        (WebCore::RenderSVGImage::paint):
+        * rendering/RenderSVGImage.h:
+        * rendering/RenderSVGInline.cpp:
+        (WebCore::RenderSVGInline::RenderSVGInline):
+        (WebCore::RenderSVGInline::createInlineBox):
+        * rendering/RenderSVGInlineText.cpp:
+        (WebCore::RenderSVGInlineText::RenderSVGInlineText):
+        * rendering/RenderSVGTSpan.cpp:
+        (WebCore::RenderSVGTSpan::RenderSVGTSpan):
+        * rendering/RenderSVGText.cpp:
+        (WebCore::RenderSVGText::paint):
+        * rendering/SVGInlineFlowBox.cpp:
+        (WebCore::paintSVGInlineFlow):
+        * rendering/SVGRenderTreeAsText.cpp:
+        (WebCore::writeStyle):
+
 2006-11-30  Geoffrey Garen  <ggaren@apple.com>
 
         Reviewed by Beth Dakin.
index f39b6fcc2c234ab2db1ba21aba0ac00664c20962..5730ea7141a192c452eb763799746bd88d8aa46b 100644 (file)
                A871DFE30A15376B00B12A68 /* RenderReplaced.h in Headers */ = {isa = PBXBuildFile; fileRef = A871DFDF0A15376B00B12A68 /* RenderReplaced.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A871DFE40A15376B00B12A68 /* RenderWidget.h in Headers */ = {isa = PBXBuildFile; fileRef = A871DFE00A15376B00B12A68 /* RenderWidget.h */; };
                A871DFE50A15376B00B12A68 /* RenderWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A871DFE10A15376B00B12A68 /* RenderWidget.cpp */; };
-               A88AD3860952486D001DD196 /* KRenderingDevice.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0FB54089701F700BA5114 /* KRenderingDevice.cpp */; };
-               A88AD3870952486D001DD196 /* KRenderingDevice.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0FB55089701F700BA5114 /* KRenderingDevice.h */; };
-               A88AD3AD0952486D001DD196 /* KCanvasItemQuartz.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0FB6C089701F800BA5114 /* KCanvasItemQuartz.cpp */; };
-               A88AD3B00952486E001DD196 /* KRenderingDeviceQuartz.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0FB71089701F800BA5114 /* KRenderingDeviceQuartz.h */; };
-               A88AD3B10952486E001DD196 /* KRenderingDeviceQuartz.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0FB72089701F800BA5114 /* KRenderingDeviceQuartz.cpp */; };
-               A88AD3B50952486E001DD196 /* QuartzSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0FB76089701F800BA5114 /* QuartzSupport.h */; };
-               A88AD3B60952486E001DD196 /* QuartzSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0FB77089701F800BA5114 /* QuartzSupport.cpp */; };
                A88AD401095248F0001DD196 /* SVGRenderStyle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0F6FF089701F100BA5114 /* SVGRenderStyle.cpp */; };
                A88AD402095248F0001DD196 /* SVGRenderStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0F700089701F100BA5114 /* SVGRenderStyle.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A88AD403095248F0001DD196 /* SVGRenderStyleDefs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0F701089701F100BA5114 /* SVGRenderStyleDefs.cpp */; };
                B222F6990AB771950022EFAD /* JSSVGAngle.h in Headers */ = {isa = PBXBuildFile; fileRef = B222F6970AB771950022EFAD /* JSSVGAngle.h */; };
                B222F69C0AB771B80022EFAD /* JSSVGElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B222F69A0AB771B80022EFAD /* JSSVGElement.cpp */; };
                B222F69D0AB771B80022EFAD /* JSSVGElement.h in Headers */ = {isa = PBXBuildFile; fileRef = B222F69B0AB771B80022EFAD /* JSSVGElement.h */; };
+               B2310B760B1F46A200D55D87 /* CgSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2310B730B1F46A200D55D87 /* CgSupport.cpp */; };
+               B2310B770B1F46A200D55D87 /* CgSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = B2310B740B1F46A200D55D87 /* CgSupport.h */; };
+               B2310B780B1F46A300D55D87 /* RenderPathCg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2310B750B1F46A200D55D87 /* RenderPathCg.cpp */; };
                B27535560B053814002CE64F /* AffineTransform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B27535270B053814002CE64F /* AffineTransform.cpp */; };
                B27535570B053814002CE64F /* AffineTransform.h in Headers */ = {isa = PBXBuildFile; fileRef = B27535280B053814002CE64F /* AffineTransform.h */; };
                B27535580B053814002CE64F /* AffineTransformCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B275352A0B053814002CE64F /* AffineTransformCG.cpp */; };
                B27535590B053814002CE64F /* FloatPointCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B275352B0B053814002CE64F /* FloatPointCG.cpp */; };
                B275355A0B053814002CE64F /* FloatRectCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B275352C0B053814002CE64F /* FloatRectCG.cpp */; };
                B275355B0B053814002CE64F /* FloatSizeCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B275352D0B053814002CE64F /* FloatSizeCG.cpp */; };
-               B275355C0B053814002CE64F /* GraphicsContextCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B275352E0B053814002CE64F /* GraphicsContextCG.cpp */; };
                B275355D0B053814002CE64F /* GraphicsContextPlatformPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = B275352F0B053814002CE64F /* GraphicsContextPlatformPrivate.h */; };
                B275355E0B053814002CE64F /* ImageCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B27535300B053814002CE64F /* ImageCG.cpp */; };
                B275355F0B053814002CE64F /* ImageSourceCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B27535310B053814002CE64F /* ImageSourceCG.cpp */; };
                B2E27CA00B0F2B0900F17C7B /* FloatPoint3D.h in Headers */ = {isa = PBXBuildFile; fileRef = B2E27C9E0B0F2B0900F17C7B /* FloatPoint3D.h */; };
                B2EBDC9C0AF77E3400AE4A68 /* SVGRenderTreeAsText.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2EBDC9A0AF77E3400AE4A68 /* SVGRenderTreeAsText.cpp */; };
                B2EBDC9D0AF77E3400AE4A68 /* SVGRenderTreeAsText.h in Headers */ = {isa = PBXBuildFile; fileRef = B2EBDC9B0AF77E3400AE4A68 /* SVGRenderTreeAsText.h */; };
+               B2ED97710B1F55CE00257D0F /* GraphicsContextCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2ED97700B1F55CE00257D0F /* GraphicsContextCG.cpp */; };
                B2FA3D360AB75A6F000E5AC4 /* JSSVGAnimateColorElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2FA3C4E0AB75A6E000E5AC4 /* JSSVGAnimateColorElement.cpp */; };
                B2FA3D370AB75A6F000E5AC4 /* JSSVGAnimateColorElement.h in Headers */ = {isa = PBXBuildFile; fileRef = B2FA3C4F0AB75A6E000E5AC4 /* JSSVGAnimateColorElement.h */; };
                B2FA3D380AB75A6F000E5AC4 /* JSSVGAnimatedAngle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2FA3C500AB75A6E000E5AC4 /* JSSVGAnimatedAngle.cpp */; };
                A8C0F8EA089701F400BA5114 /* SVGViewElement.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = SVGViewElement.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8C0F8EB089701F400BA5114 /* SVGZoomAndPan.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGZoomAndPan.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8C0F8EC089701F400BA5114 /* SVGZoomAndPan.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = SVGZoomAndPan.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               A8C0FB54089701F700BA5114 /* KRenderingDevice.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KRenderingDevice.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               A8C0FB55089701F700BA5114 /* KRenderingDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KRenderingDevice.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               A8C0FB6C089701F800BA5114 /* KCanvasItemQuartz.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KCanvasItemQuartz.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               A8C0FB71089701F800BA5114 /* KRenderingDeviceQuartz.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KRenderingDeviceQuartz.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               A8C0FB72089701F800BA5114 /* KRenderingDeviceQuartz.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KRenderingDeviceQuartz.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               A8C0FB76089701F800BA5114 /* QuartzSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = QuartzSupport.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               A8C0FB77089701F800BA5114 /* QuartzSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = QuartzSupport.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8C3295C093BB7B2000B9CAC /* SVGFELightElement.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = SVGFELightElement.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8C3295D093BB7B2000B9CAC /* SVGFELightElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFELightElement.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8C3295E093BB7B2000B9CAC /* SVGFEDistantLightElement.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = SVGFEDistantLightElement.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                B222F6970AB771950022EFAD /* JSSVGAngle.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSSVGAngle.h; sourceTree = "<group>"; };
                B222F69A0AB771B80022EFAD /* JSSVGElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGElement.cpp; sourceTree = "<group>"; };
                B222F69B0AB771B80022EFAD /* JSSVGElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSSVGElement.h; sourceTree = "<group>"; };
+               B2310B730B1F46A200D55D87 /* CgSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CgSupport.cpp; sourceTree = "<group>"; };
+               B2310B740B1F46A200D55D87 /* CgSupport.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CgSupport.h; sourceTree = "<group>"; };
+               B2310B750B1F46A200D55D87 /* RenderPathCg.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderPathCg.cpp; sourceTree = "<group>"; };
                B27535270B053814002CE64F /* AffineTransform.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AffineTransform.cpp; sourceTree = "<group>"; };
                B27535280B053814002CE64F /* AffineTransform.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AffineTransform.h; sourceTree = "<group>"; };
                B275352A0B053814002CE64F /* AffineTransformCG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AffineTransformCG.cpp; sourceTree = "<group>"; };
                B275352B0B053814002CE64F /* FloatPointCG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FloatPointCG.cpp; sourceTree = "<group>"; };
                B275352C0B053814002CE64F /* FloatRectCG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FloatRectCG.cpp; sourceTree = "<group>"; };
                B275352D0B053814002CE64F /* FloatSizeCG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FloatSizeCG.cpp; sourceTree = "<group>"; };
-               B275352E0B053814002CE64F /* GraphicsContextCG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContextCG.cpp; sourceTree = "<group>"; };
                B275352F0B053814002CE64F /* GraphicsContextPlatformPrivate.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = GraphicsContextPlatformPrivate.h; sourceTree = "<group>"; };
                B27535300B053814002CE64F /* ImageCG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ImageCG.cpp; sourceTree = "<group>"; };
                B27535310B053814002CE64F /* ImageSourceCG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ImageSourceCG.cpp; sourceTree = "<group>"; };
                B2E9548E0AB5FBA30076DE37 /* SVGPreserveAspectRatio.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGPreserveAspectRatio.idl; sourceTree = "<group>"; };
                B2EBDC9A0AF77E3400AE4A68 /* SVGRenderTreeAsText.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGRenderTreeAsText.cpp; sourceTree = "<group>"; };
                B2EBDC9B0AF77E3400AE4A68 /* SVGRenderTreeAsText.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGRenderTreeAsText.h; sourceTree = "<group>"; };
+               B2ED97700B1F55CE00257D0F /* GraphicsContextCG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContextCG.cpp; sourceTree = "<group>"; };
                B2FA3C4E0AB75A6E000E5AC4 /* JSSVGAnimateColorElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGAnimateColorElement.cpp; sourceTree = "<group>"; };
                B2FA3C4F0AB75A6E000E5AC4 /* JSSVGAnimateColorElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSSVGAnimateColorElement.h; sourceTree = "<group>"; };
                B2FA3C500AB75A6E000E5AC4 /* JSSVGAnimatedAngle.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGAnimatedAngle.cpp; sourceTree = "<group>"; };
                                F523D32402DE4478018635CA /* dom */,
                                93309D86099E64910056E581 /* editing */,
                                93EEC1EC09C2877700C515D1 /* html */,
-                               A8C0FB51089701F700BA5114 /* kcanvas */,
                                A8C0F6E9089701F100BA5114 /* ksvg2 */,
                                BCB16BFB0979C38700467741 /* loader */,
                                65BF02180974806300C43196 /* page */,
                        path = svg;
                        sourceTree = "<group>";
                };
-               A8C0FB51089701F700BA5114 /* kcanvas */ = {
-                       isa = PBXGroup;
-                       children = (
-                               A8C0FB53089701F700BA5114 /* device */,
-                       );
-                       path = kcanvas;
-                       sourceTree = "<group>";
-               };
-               A8C0FB53089701F700BA5114 /* device */ = {
-                       isa = PBXGroup;
-                       children = (
-                               A8C0FB54089701F700BA5114 /* KRenderingDevice.cpp */,
-                               A8C0FB55089701F700BA5114 /* KRenderingDevice.h */,
-                               A8C0FB68089701F800BA5114 /* quartz */,
-                       );
-                       path = device;
-                       sourceTree = "<group>";
-               };
-               A8C0FB68089701F800BA5114 /* quartz */ = {
-                       isa = PBXGroup;
-                       children = (
-                               A8C0FB6C089701F800BA5114 /* KCanvasItemQuartz.cpp */,
-                               A8C0FB71089701F800BA5114 /* KRenderingDeviceQuartz.h */,
-                               A8C0FB72089701F800BA5114 /* KRenderingDeviceQuartz.cpp */,
-                               A8C0FB76089701F800BA5114 /* QuartzSupport.h */,
-                               A8C0FB77089701F800BA5114 /* QuartzSupport.cpp */,
-                       );
-                       path = quartz;
-                       sourceTree = "<group>";
-               };
                B27535290B053814002CE64F /* cg */ = {
                        isa = PBXGroup;
                        children = (
                                B275352B0B053814002CE64F /* FloatPointCG.cpp */,
                                B275352C0B053814002CE64F /* FloatRectCG.cpp */,
                                B275352D0B053814002CE64F /* FloatSizeCG.cpp */,
-                               B275352E0B053814002CE64F /* GraphicsContextCG.cpp */,
+                               B2ED97700B1F55CE00257D0F /* GraphicsContextCG.cpp */,
                                B275352F0B053814002CE64F /* GraphicsContextPlatformPrivate.h */,
                                B27535300B053814002CE64F /* ImageCG.cpp */,
                                B27535310B053814002CE64F /* ImageSourceCG.cpp */,
                B2A015970AF6CD53006BCE0E /* cg */ = {
                        isa = PBXGroup;
                        children = (
+                               B2310B730B1F46A200D55D87 /* CgSupport.cpp */,
+                               B2310B740B1F46A200D55D87 /* CgSupport.h */,
+                               B2310B750B1F46A200D55D87 /* RenderPathCg.cpp */,
                                B2D87C830B124E9500B0DE1E /* SVGPaintServerCg.cpp */,
                                B2D87C840B124E9500B0DE1E /* SVGPaintServerGradientCg.cpp */,
                                B2D87C850B124E9500B0DE1E /* SVGPaintServerPatternCg.cpp */,
                                7E6FEED80898582300C44C3F /* WebCoreScriptDebugger.h in Headers */,
                                939885C408B7E3D100E707C4 /* EventNames.h in Headers */,
                                65C97AF308EA908800ACD273 /* config.h in Headers */,
-                               A88AD3870952486D001DD196 /* KRenderingDevice.h in Headers */,
-                               A88AD3B00952486E001DD196 /* KRenderingDeviceQuartz.h in Headers */,
-                               A88AD3B50952486E001DD196 /* QuartzSupport.h in Headers */,
                                A88AD402095248F0001DD196 /* SVGRenderStyle.h in Headers */,
                                A88AD404095248F0001DD196 /* SVGRenderStyleDefs.h in Headers */,
                                A88AD40B095248F0001DD196 /* SVGZoomEvent.h in Headers */,
                                A7352C1A0B1BB89D00A986D0 /* RenderSVGBlock.h in Headers */,
                                4B8AF4AA0B1CE02B00687690 /* ClipboardAccessPolicy.h in Headers */,
                                06027CAD0B1CBFC000884B2D /* ContextMenuItem.h in Headers */,
+                               B2310B770B1F46A200D55D87 /* CgSupport.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                BCEF3434087B563E00BBF833 /* HTMLElementFactory.cpp in Sources */,
                                7E6FEED90898582300C44C3F /* WebCoreScriptDebugger.mm in Sources */,
                                939885C308B7E3D100E707C4 /* EventNames.cpp in Sources */,
-                               A88AD3860952486D001DD196 /* KRenderingDevice.cpp in Sources */,
-                               A88AD3AD0952486D001DD196 /* KCanvasItemQuartz.cpp in Sources */,
-                               A88AD3B10952486E001DD196 /* KRenderingDeviceQuartz.cpp in Sources */,
-                               A88AD3B60952486E001DD196 /* QuartzSupport.cpp in Sources */,
                                A88AD401095248F0001DD196 /* SVGRenderStyle.cpp in Sources */,
                                A88AD403095248F0001DD196 /* SVGRenderStyleDefs.cpp in Sources */,
                                A88AD40A095248F0001DD196 /* SVGZoomEvent.cpp in Sources */,
                                B27535590B053814002CE64F /* FloatPointCG.cpp in Sources */,
                                B275355A0B053814002CE64F /* FloatRectCG.cpp in Sources */,
                                B275355B0B053814002CE64F /* FloatSizeCG.cpp in Sources */,
-                               B275355C0B053814002CE64F /* GraphicsContextCG.cpp in Sources */,
                                B275355E0B053814002CE64F /* ImageCG.cpp in Sources */,
                                B275355F0B053814002CE64F /* ImageSourceCG.cpp in Sources */,
                                B27535600B053814002CE64F /* IntPointCG.cpp in Sources */,
                                1AD8CFCE0B1CED8900696DE0 /* ResourceRequest.cpp in Sources */,
                                06027CB30B1CC03D00884B2D /* ContextMenuItemMac.mm in Sources */,
                                1A8180A50B1D4E4300CE46C4 /* ResourceResponse.cpp in Sources */,
+                               B2310B760B1F46A200D55D87 /* CgSupport.cpp in Sources */,
+                               B2310B780B1F46A300D55D87 /* RenderPathCg.cpp in Sources */,
+                               B2ED97710B1F55CE00257D0F /* GraphicsContextCG.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
diff --git a/WebCore/kcanvas/device/KRenderingDevice.cpp b/WebCore/kcanvas/device/KRenderingDevice.cpp
deleted file mode 100644 (file)
index 445e821..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
-    Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
-                  2004, 2005 Rob Buis <buis@kde.org>
-                  2006       Alexander Kellett <lypanov@kde.org>
-
-    This file is part of the KDE project
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU Library General Public License
-    aint with this library; see the file COPYING.LIB.  If not, write to
-    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-    Boston, MA 02111-1307, USA.
-*/
-
-#include "config.h"
-#ifdef SVG_SUPPORT
-#include "KRenderingDevice.h"
-
-namespace WebCore {
-
-KRenderingDevice::KRenderingDevice()
-{
-}
-
-KRenderingDevice::~KRenderingDevice()
-{
-}
-
-KRenderingDeviceContext* KRenderingDevice::currentContext() const
-{
-    if (m_contextStack.isEmpty())
-        return 0;
-    return m_contextStack.last();
-}
-
-KRenderingDeviceContext* KRenderingDevice::popContext()
-{
-    KRenderingDeviceContext* result = m_contextStack.last();
-    m_contextStack.removeLast();
-    return result;
-}
-
-void KRenderingDevice::pushContext(KRenderingDeviceContext* context)
-{
-    m_contextStack.append(context);
-}
-
-}
-
-// vim:ts=4:noet
-#endif // SVG_SUPPORT
-
diff --git a/WebCore/kcanvas/device/KRenderingDevice.h b/WebCore/kcanvas/device/KRenderingDevice.h
deleted file mode 100644 (file)
index 7fd4fb9..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
-    Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
-                  2004, 2005 Rob Buis <buis@kde.org>
-
-    This file is part of the KDE project
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU Library General Public License
-    aint with this library; see the file COPYING.LIB.  If not, write to
-    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-    Boston, MA 02111-1307, USA.
-*/
-
-#ifndef KRenderingDevice_H
-#define KRenderingDevice_H
-
-#ifdef SVG_SUPPORT
-
-#include "SVGFilterEffect.h"
-#include "SVGPaintServer.h"
-
-namespace WebCore {
-
-class AffineTransform;
-class GraphicsContext;
-class Path;
-
-// aka where to draw
-class KRenderingDeviceContext
-{
-public:
-    KRenderingDeviceContext() { }
-    virtual ~KRenderingDeviceContext() { }
-
-    virtual AffineTransform concatCTM(const AffineTransform&) = 0;
-    virtual AffineTransform ctm() const = 0;
-        
-    virtual void clearPath() = 0;
-    virtual void addPath(const Path&) = 0;
-
-    virtual GraphicsContext* createGraphicsContext() = 0;
-};
-
-class SVGResourceImage;
-class SVGResourceFilterEffect;
-class KRenderingDevice
-{
-public:
-    KRenderingDevice();
-    virtual ~KRenderingDevice();
-
-    // The rendering device will be directly inited
-    // after the canvas target, it may be overwritten.
-    virtual bool isBuffered() const = 0;
-
-    // Global rendering device context
-    KRenderingDeviceContext* currentContext() const;
-
-    virtual KRenderingDeviceContext* popContext();
-    virtual void pushContext(KRenderingDeviceContext*);
-    
-    virtual KRenderingDeviceContext* contextForImage(SVGResourceImage*) const = 0;
-
-    // Creation tools
-    virtual PassRefPtr<SVGResource> createResource(const SVGResourceType&) const = 0;
-    virtual SVGFilterEffect* createFilterEffect(const SVGFilterEffectType&) const = 0;
-    virtual PassRefPtr<SVGPaintServer> createPaintServer(const SVGPaintServerType&) const = 0;
-
-private:
-    Vector<KRenderingDeviceContext*> m_contextStack;
-};
-
-KRenderingDevice* renderingDevice(); /* returns the single global rendering device */
-
-}
-
-#endif // SVG_SUPPORT
-#endif
-
-// vim:ts=4:noet
diff --git a/WebCore/kcanvas/device/qt/KRenderingDeviceQt.cpp b/WebCore/kcanvas/device/qt/KRenderingDeviceQt.cpp
deleted file mode 100644 (file)
index c045cab..0000000
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
-    Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <wildfox@kde.org>
-                  2004, 2005, 2006 Rob Buis <buis@kde.org>
-
-    This file is part of the KDE project
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; see the file COPYING.LIB. If not, write to
-    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-    Boston, MA 02110-1301, USA.
-*/
-
-#include "config.h"
-
-#include "IntRect.h"
-#include "RenderPath.h"
-#include "AffineTransform.h"
-#include "GraphicsContext.h"
-#include "SVGResourceClipper.h"
-#include "SVGResourceMarker.h"
-#include "KRenderingDeviceQt.h"
-#include "SVGPaintServerSolid.h"
-#include "SVGPaintServerLinearGradient.h"
-#include "SVGPaintServerRadialGradient.h"
-#include "SVGPaintServerPattern.h"
-
-namespace WebCore {
-
-KRenderingDeviceContextQt::KRenderingDeviceContextQt(QPainter* painter)
-    : m_painter(painter)
-    , m_path()
-{
-    Q_ASSERT(m_painter != 0);
-}
-
-KRenderingDeviceContextQt::~KRenderingDeviceContextQt()
-{
-}
-
-AffineTransform KRenderingDeviceContextQt::concatCTM(const AffineTransform& worldMatrix)
-{
-    AffineTransform ret = ctm();
-    m_painter->setMatrix(worldMatrix, true);
-    return ret;
-}
-
-AffineTransform KRenderingDeviceContextQt::ctm() const
-{
-    return AffineTransform(m_painter->matrix());
-}
-
-IntRect KRenderingDeviceContextQt::mapFromVisual(const IntRect& rect)
-{
-    return IntRect();
-}
-
-IntRect KRenderingDeviceContextQt::mapToVisual(const IntRect& rect)
-{
-    return IntRect();
-}
-
-void KRenderingDeviceContextQt::clearPath()
-{
-    m_path = QPainterPath();
-}
-
-void KRenderingDeviceContextQt::addPath(const Path& path)
-{
-    m_path.addPath(*(path.platformPath()));
-}
-
-GraphicsContext* KRenderingDeviceContextQt::createGraphicsContext()
-{
-    return new GraphicsContext(m_painter);
-}
-
-QPainter& KRenderingDeviceContextQt::painter()
-{
-    return *m_painter;
-}
-
-QRectF KRenderingDeviceContextQt::pathBBox() const
-{
-    return m_path.boundingRect();
-}
-
-void KRenderingDeviceContextQt::setFillRule(WindRule rule)
-{
-    m_path.setFillRule(rule == RULE_EVENODD ? Qt::OddEvenFill : Qt::WindingFill);
-}
-
-void KRenderingDeviceContextQt::fillPath()
-{
-    m_painter->fillPath(m_path, m_painter->brush());
-}
-
-void KRenderingDeviceContextQt::strokePath()
-{
-    m_painter->strokePath(m_path, m_painter->pen());
-}
-
-// KRenderingDeviceQt
-KRenderingDeviceQt::KRenderingDeviceQt() : KRenderingDevice()
-{
-}
-
-KRenderingDeviceQt::~KRenderingDeviceQt()
-{
-}
-
-KRenderingDeviceContext* KRenderingDeviceQt::popContext()
-{
-    // Any special things needed?
-    return KRenderingDevice::popContext();
-}
-
-void KRenderingDeviceQt::pushContext(KRenderingDeviceContext* context)
-{
-    // Any special things needed?
-    KRenderingDevice::pushContext(context);
-}
-
-// context management.
-KRenderingDeviceContextQt* KRenderingDeviceQt::qtContext() const
-{
-    return static_cast<KRenderingDeviceContextQt*>(currentContext());
-}
-
-KRenderingDeviceContext* KRenderingDeviceQt::contextForImage(SVGResourceImage* image) const
-{
-    qDebug("KRenderingDeviceQt::contextForImage() TODO!");
-    return 0;
-}
-
-// Resource creation
-PassRefPtr<SVGResource> KRenderingDeviceQt::createResource(const SVGResourceType& type) const
-{
-    switch (type)
-    {
-        case ClipperResourceType:
-            return new SVGResourceClipper();
-        case MarkerResourceType:
-            return new SVGResourceMarker(); // Use default implementation...
-        case ImageResourceType:
-            // return new SVGResourceImageQt();
-        case FilterResourceType:
-            // return new KCanvasFilterQt();
-        case MaskerResourceType:
-            // return new KCanvasMaskerQt();
-        default:
-            return 0;
-    }
-}
-
-PassRefPtr<SVGPaintServer> KRenderingDeviceQt::createPaintServer(const SVGPaintServerType& type) const
-{
-    switch (type)
-    {
-        case SolidPaintServer:
-            return new SVGPaintServerSolid();
-        case PatternPaintServer:
-            return new SVGPaintServerPattern();
-        case LinearGradientPaintServer:
-            return new SVGPaintServerLinearGradient();
-        case RadialGradientPaintServer:
-            return new SVGPaintServerRadialGradient();
-        default:
-            return 0;
-    }
-}
-
-SVGFilterEffect* KRenderingDeviceQt::createFilterEffect(const SVGFilterEffectType& type) const
-{
-    qDebug("KRenderingDeviceQt::createFilterEffect() TODO!");
-    return 0;
-}
-
-KRenderingDevice* renderingDevice()
-{
-    static KRenderingDevice *sharedRenderingDevice = new KRenderingDeviceQt();
-    return sharedRenderingDevice;
-}
-
-}
-
-// vim:ts=4:noet
diff --git a/WebCore/kcanvas/device/qt/KRenderingDeviceQt.h b/WebCore/kcanvas/device/qt/KRenderingDeviceQt.h
deleted file mode 100644 (file)
index a5d0a46..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
-    Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <wildfox@kde.org>
-                  2004, 2005, 2006 Rob Buis <buis@kde.org>
-
-    This file is part of the KDE project
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; see the file COPYING.LIB. If not, write to
-    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-    Boston, MA 02110-1301, USA.
-*/
-
-#ifndef KRenderingDeviceQt_H
-#define KRenderingDeviceQt_H
-
-#include <QPainter>
-#include <QPainterPath>
-
-#include "Path.h"
-#include "KRenderingDevice.h"
-
-namespace WebCore {
-
-class KRenderingDeviceContextQt : public KRenderingDeviceContext
-{
-public:
-    KRenderingDeviceContextQt(QPainter*);
-    virtual ~KRenderingDeviceContextQt();
-
-    virtual AffineTransform concatCTM(const AffineTransform&);
-    virtual AffineTransform ctm() const;
-
-    virtual IntRect mapFromVisual(const IntRect&);
-    virtual IntRect mapToVisual(const IntRect&);
-
-    virtual void clearPath();
-    virtual void addPath(const Path&);
-
-    virtual GraphicsContext* createGraphicsContext();
-    
-    // Qt specific stuff
-    QPainter& painter();
-    QRectF pathBBox() const;
-
-    void setFillRule(WindRule);
-
-    void fillPath();
-    void strokePath();
-
-private:
-    QPainter* m_painter;
-    QPainterPath m_path;
-};
-
-class KRenderingDeviceQt : public KRenderingDevice
-{
-public:
-    KRenderingDeviceQt();
-    virtual ~KRenderingDeviceQt();
-
-    virtual bool isBuffered() const { return false; }
-
-    virtual KRenderingDeviceContext* popContext();
-    virtual void pushContext(KRenderingDeviceContext*);
-
-    // context management.
-    KRenderingDeviceContextQt* qtContext() const;
-    virtual KRenderingDeviceContext* contextForImage(SVGResourceImage*) const;
-
-    // Resource creation
-    virtual PassRefPtr<SVGResource> createResource(const SVGResourceType&) const;
-    virtual PassRefPtr<SVGPaintServer> createPaintServer(const SVGPaintServerType&) const;
-    virtual SVGFilterEffect* createFilterEffect(const SVGFilterEffectType&) const;
-};
-
-}
-
-#endif
-
-// vim:ts=4:noet
diff --git a/WebCore/kcanvas/device/quartz/KRenderingDeviceQuartz.cpp b/WebCore/kcanvas/device/quartz/KRenderingDeviceQuartz.cpp
deleted file mode 100644 (file)
index 78c8ec6..0000000
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * Copyright (C) 2005 Apple Computer, Inc.  All rights reserved.
- *               2006 Rob Buis <buis@kde.org>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#include "config.h"
-
-#ifdef SVG_SUPPORT
-#include "KRenderingDeviceQuartz.h"
-#include "GraphicsContext.h"
-#include "SVGFEBlend.h"
-#include "SVGFEColorMatrix.h"
-#include "SVGFEComponentTransfer.h"
-#include "SVGFEComposite.h"
-#include "SVGFEDiffuseLighting.h"
-#include "SVGFEDisplacementMap.h"
-#include "SVGFEFlood.h"
-#include "SVGFEGaussianBlur.h"
-#include "SVGFEImage.h"
-#include "SVGFEMerge.h"
-#include "SVGFEOffset.h"
-#include "SVGFESpecularLighting.h"
-#include "SVGFETile.h"
-#include "SVGResourceClipper.h"
-#include "SVGResourceFilter.h"
-#include "SVGResourceImage.h"
-#include "SVGResourceMarker.h"
-#include "SVGResourceMasker.h"
-#include "SVGPaintServerSolid.h"
-#include "SVGPaintServerLinearGradient.h"
-#include "SVGPaintServerRadialGradient.h"
-#include "SVGPaintServerPattern.h"
-#include "Logging.h"
-#include "QuartzSupport.h"
-#include "RenderView.h"
-
-namespace WebCore {
-
-KRenderingDeviceContextQuartz::KRenderingDeviceContextQuartz(CGContextRef context)
-    : m_cgContext(CGContextRetain(context))
-{
-    ASSERT(m_cgContext);
-}
-
-KRenderingDeviceContextQuartz::~KRenderingDeviceContextQuartz()
-{
-    CGContextRelease(m_cgContext);
-}
-
-AffineTransform KRenderingDeviceContextQuartz::concatCTM(const AffineTransform& worldMatrix)
-{
-    AffineTransform ret = ctm();
-    CGAffineTransform wMatrix = worldMatrix;
-    CGContextConcatCTM(m_cgContext, wMatrix);
-    return ret;
-}
-
-AffineTransform KRenderingDeviceContextQuartz::ctm() const
-{
-    return CGContextGetCTM(m_cgContext);
-}
-
-void KRenderingDeviceContextQuartz::clearPath()
-{
-    CGContextBeginPath(m_cgContext);
-}
-
-void KRenderingDeviceContextQuartz::addPath(const Path& path)
-{
-    CGContextAddPath(m_cgContext, path.platformPath());
-}
-
-GraphicsContext* KRenderingDeviceContextQuartz::createGraphicsContext()
-{
-    return new GraphicsContext(m_cgContext);
-}
-
-static bool __useFilters = true;
-
-bool KRenderingDeviceQuartz::filtersEnabled()
-{
-    return __useFilters;
-}
-
-void KRenderingDeviceQuartz::setFiltersEnabled(bool enabled)
-{
-    __useFilters = enabled;
-}
-
-static bool __useHardwareRendering = true;
-
-bool KRenderingDeviceQuartz::hardwareRenderingEnabled()
-{
-    return __useHardwareRendering;
-}
-
-void KRenderingDeviceQuartz::setHardwareRenderingEnabled(bool enabled)
-{
-    __useHardwareRendering = enabled;
-}
-
-#pragma mark -
-#pragma mark Context Management
-
-KRenderingDeviceContextQuartz* KRenderingDeviceQuartz::quartzContext() const
-{
-    return static_cast<KRenderingDeviceContextQuartz*>(currentContext());
-}
-
-CGContextRef KRenderingDeviceQuartz::currentCGContext() const
-{
-    ASSERT(quartzContext());
-    return quartzContext()->cgContext();
-}
-
-KRenderingDeviceContext* KRenderingDeviceQuartz::contextForImage(SVGResourceImage *image) const
-{
-    CGLayerRef cgLayer = image->cgLayer();
-    if (!cgLayer) {
-        // FIXME: we might not get back a layer if this is a loaded image
-        // maybe this logic should go into SVGResourceImage?
-        cgLayer = CGLayerCreateWithContext(currentCGContext(), CGSize(image->size() + IntSize(1,1)), NULL);  // FIXME + 1 is a hack
-        // FIXME: we should composite the original image onto the layer...
-        image->setCGLayer(cgLayer);
-        CGLayerRelease(cgLayer);
-    }
-    return new KRenderingDeviceContextQuartz(CGLayerGetContext(cgLayer));
-}
-
-#pragma mark -
-#pragma mark Resource Creation
-
-PassRefPtr<SVGPaintServer> KRenderingDeviceQuartz::createPaintServer(const SVGPaintServerType& type) const
-{
-    SVGPaintServer* newServer = NULL;
-    switch(type) {
-    case SolidPaintServer:
-        newServer = new SVGPaintServerSolid();
-        break;
-    case PatternPaintServer:
-        newServer = new SVGPaintServerPattern();
-        break;
-    case LinearGradientPaintServer:
-        newServer = new SVGPaintServerLinearGradient();
-        break;
-    case RadialGradientPaintServer:
-        newServer = new SVGPaintServerRadialGradient();
-        break;
-    }
-    return newServer;
-}
-
-PassRefPtr<SVGResource> KRenderingDeviceQuartz::createResource(const SVGResourceType& type) const
-{
-    switch (type) {
-    case ClipperResourceType:
-        return new SVGResourceClipper();
-    case MarkerResourceType:
-        return new SVGResourceMarker();
-    case ImageResourceType:
-        return new SVGResourceImage();
-    case FilterResourceType:
-        return new SVGResourceFilter();
-    case MaskerResourceType:
-        return new SVGResourceMasker();
-    }
-    LOG_ERROR("Failed to create resource of type: %i", type);
-    return 0;
-}
-
-SVGFilterEffect* KRenderingDeviceQuartz::createFilterEffect(const SVGFilterEffectType& type) const
-{
-    switch(type)
-    {
-    /* Light sources are contained by the diffuse/specular light blocks 
-    case FE_DISTANT_LIGHT: 
-    case FE_POINT_LIGHT: 
-    case FE_SPOT_LIGHT: 
-    */
-    case FE_BLEND: return new SVGFEBlend();
-    case FE_COLOR_MATRIX: return new SVGFEColorMatrix();
-    case FE_COMPONENT_TRANSFER: return new SVGFEComponentTransfer();
-    case FE_COMPOSITE: return new SVGFEComposite();
-//  case FE_CONVOLVE_MATRIX: 
-    case FE_DIFFUSE_LIGHTING: return new SVGFEDiffuseLighting();
-    case FE_DISPLACEMENT_MAP: return new SVGFEDisplacementMap();
-    case FE_FLOOD: return new SVGFEFlood();
-    case FE_GAUSSIAN_BLUR: return new SVGFEGaussianBlur();
-    case FE_IMAGE: return new SVGFEImage();
-    case FE_MERGE: return new SVGFEMerge();
-//  case FE_MORPHOLOGY: 
-    case FE_OFFSET: return new SVGFEOffset();
-    case FE_SPECULAR_LIGHTING: return new SVGFESpecularLighting();
-    case FE_TILE: return new SVGFETile();
-//  case FE_TURBULENCE: 
-    default:
-        return 0;
-    }
-}
-
-KRenderingDevice* renderingDevice()
-{
-    static KRenderingDevice* sharedRenderingDevice = new KRenderingDeviceQuartz();
-    return sharedRenderingDevice;
-}
-
-}
-
-#endif // SVG_SUPPORT
diff --git a/WebCore/kcanvas/device/quartz/KRenderingDeviceQuartz.h b/WebCore/kcanvas/device/quartz/KRenderingDeviceQuartz.h
deleted file mode 100644 (file)
index 3a123ba..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2005 Apple Computer, Inc.  All rights reserved.
- *               2006 Rob Buis <buis@kde.org>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-
-#ifndef KRenderingDeviceQuartz_H
-#define KRenderingDeviceQuartz_H
-#ifdef SVG_SUPPORT
-
-#include "KRenderingDevice.h"
-
-typedef struct CGRect CGRect;
-typedef struct CGContext *CGContextRef;
-
-namespace WebCore {
-
-class KRenderingDeviceContextQuartz : public KRenderingDeviceContext {
-public:
-    KRenderingDeviceContextQuartz(CGContextRef);
-    virtual ~KRenderingDeviceContextQuartz();
-    
-    virtual AffineTransform concatCTM(const AffineTransform&);
-    virtual AffineTransform ctm() const;
-    
-    virtual void clearPath();
-    virtual void addPath(const Path&);
-
-    virtual GraphicsContext* createGraphicsContext();
-    
-    CGContextRef cgContext() const { return m_cgContext; };
-    
-private:
-    CGContextRef m_cgContext;
-};
-
-class KRenderingDeviceQuartz : public KRenderingDevice {
-public:
-    KRenderingDeviceQuartz() { }
-    virtual ~KRenderingDeviceQuartz() { }
-
-    virtual bool isBuffered() const { return false; }
-
-    // context management.
-    KRenderingDeviceContextQuartz* quartzContext() const;
-    CGContextRef currentCGContext() const;
-    virtual KRenderingDeviceContext* contextForImage(SVGResourceImage*) const;
-
-    // Resource creation
-    virtual PassRefPtr<SVGResource> createResource(const SVGResourceType&) const;
-    virtual PassRefPtr<SVGPaintServer> createPaintServer(const SVGPaintServerType&) const;
-    virtual SVGFilterEffect *createFilterEffect(const SVGFilterEffectType&) const;
-    
-    // filters (mostly debugging)
-    static bool filtersEnabled();
-    static void setFiltersEnabled(bool);
-    static bool hardwareRenderingEnabled();
-    static void setHardwareRenderingEnabled(bool);
-};
-
-} // namespace WebCore
-
-#endif // SVG_SUPPORT
-#endif // KRenderingDeviceQuartz_H
index 595751383dd4d717ac0ff8c96a03f6b9107a9474..c641c251a64e5dc5c05b63683d1847cf7489b639 100644 (file)
@@ -27,7 +27,6 @@
 
 #include "CSSValueList.h"
 #include "Document.h"
-#include "KRenderingDevice.h"
 #include "SVGPaintServerGradient.h"
 #include "SVGPaintServerSolid.h"
 #include "RenderObject.h"
@@ -44,7 +43,7 @@ static SVGPaintServerSolid* sharedSolidPaintServer()
 {
     static SVGPaintServerSolid* _sharedSolidPaintServer = 0;
     if (!_sharedSolidPaintServer)
-        _sharedSolidPaintServer = static_cast<SVGPaintServerSolid*>(renderingDevice()->createPaintServer(SolidPaintServer).releaseRef());
+        _sharedSolidPaintServer = new SVGPaintServerSolid();
     return _sharedSolidPaintServer;
 }
 
index 153bd274974c0d951b4068a242d3b2c84621b316..844a06ab1535d31bb3a06da84388f8a675199634 100644 (file)
@@ -28,7 +28,7 @@
 #include <wtf/Vector.h>
 
 #if PLATFORM(CG)
-#include "QuartzSupport.h"
+#include "CgSupport.h"
 #endif
 
 namespace WebCore {
index 729b3e68bf07b18fdd9da070672926563c67ced8..59ec10e02cd0bf4ba5c1b41e6f3c2872c27fb30a 100644 (file)
@@ -32,8 +32,6 @@
 #include "EventNames.h"
 #include "Frame.h"
 #include "FrameLoader.h"
-#include "KRenderingDevice.h"
-#include "MouseEvent.h"
 #include "MouseEvent.h"
 #include "RenderSVGContainer.h"
 #include "ResourceRequest.h"
index 530232eaaa7a1b1a5c2e004573b110f960d6b302..42ba0088e62cae771facd770ef98bdb4c248b914 100644 (file)
@@ -25,7 +25,6 @@
 #include "SVGClipPathElement.h"
 
 #include "Document.h"
-#include "KRenderingDevice.h"
 #include "RenderView.h"
 #include "SVGHelper.h"
 #include "SVGMatrix.h"
index 3701c3438fdda812354631c7aeb58316adbf60ba..d4121289ba83b80fbb06d9a77d68e7a2a0669532 100644 (file)
@@ -24,8 +24,8 @@
 #ifdef SVG_SUPPORT
 #include "SVGFEBlendElement.h"
 
-#include "KRenderingDevice.h"
 #include "SVGHelper.h"
+#include "SVGResourceFilter.h"
 
 namespace WebCore {
 
@@ -70,7 +70,7 @@ void SVGFEBlendElement::parseMappedAttribute(MappedAttribute* attr)
 SVGFEBlend* SVGFEBlendElement::filterEffect() const
 {
     if (!m_filterEffect)
-        m_filterEffect = static_cast<SVGFEBlend*>(renderingDevice()->createFilterEffect(FE_BLEND));
+        m_filterEffect = static_cast<SVGFEBlend*>(SVGResourceFilter::createFilterEffect(FE_BLEND));
     if (!m_filterEffect)
         return 0;
     m_filterEffect->setBlendMode((SVGBlendModeType) mode());
index 3ab8166d534f20e299fd571cf95342aa58e41a95..8fb066144bea0bf60c78e7cf5d0d496b8fc87cfc 100644 (file)
 */
 
 #include "config.h"
+
 #ifdef SVG_SUPPORT
 #include "SVGFEColorMatrixElement.h"
 
-#include "KRenderingDevice.h"
 #include "SVGHelper.h"
 #include "SVGNames.h"
 #include "SVGNumberList.h"
+#include "SVGResourceFilter.h"
 
 namespace WebCore {
 
@@ -72,7 +73,7 @@ void SVGFEColorMatrixElement::parseMappedAttribute(MappedAttribute* attr)
 SVGFEColorMatrix* SVGFEColorMatrixElement::filterEffect() const
 {
     if (!m_filterEffect)
-        m_filterEffect = static_cast<SVGFEColorMatrix*>(renderingDevice()->createFilterEffect(FE_COLOR_MATRIX));
+        m_filterEffect = static_cast<SVGFEColorMatrix*>(SVGResourceFilter::createFilterEffect(FE_COLOR_MATRIX));
     if (!m_filterEffect)
         return 0;
         
@@ -93,6 +94,6 @@ SVGFEColorMatrix* SVGFEColorMatrixElement::filterEffect() const
 
 }
 
-// vim:ts=4:noet
 #endif // SVG_SUPPORT
 
+// vim:ts=4:noet
index a2543c582ba075dfc201f1e8b95364b34f0aca36..86f30cfd4a82d420446a18549a0c69cab6dc6857 100644 (file)
 */
 
 #include "config.h"
-#ifdef SVG_SUPPORT
-#include "Attr.h"
 
-#include "KRenderingDevice.h"
+#ifdef SVG_SUPPORT
+#include "SVGFEComponentTransferElement.h"
 
+#include "Attr.h"
 #include "SVGNames.h"
 #include "SVGHelper.h"
 #include "SVGRenderStyle.h"
-#include "SVGFEComponentTransferElement.h"
 #include "SVGFEFuncRElement.h"
 #include "SVGFEFuncGElement.h"
 #include "SVGFEFuncBElement.h"
 #include "SVGFEFuncAElement.h"
+#include "SVGResourceFilter.h"
 
 namespace WebCore {
 
-SVGFEComponentTransferElement::SVGFEComponentTransferElement(const QualifiedName& tagName, Document *doc)
+SVGFEComponentTransferElement::SVGFEComponentTransferElement(const QualifiedName& tagName, Documentdoc)
     : SVGFilterPrimitiveStandardAttributes(tagName, doc)
     , m_filterEffect(0)
 {
@@ -50,7 +50,7 @@ SVGFEComponentTransferElement::~SVGFEComponentTransferElement()
 
 ANIMATED_PROPERTY_DEFINITIONS(SVGFEComponentTransferElement, String, String, string, In1, in1, SVGNames::inAttr.localName(), m_in1)
 
-void SVGFEComponentTransferElement::parseMappedAttribute(MappedAttribute *attr)
+void SVGFEComponentTransferElement::parseMappedAttribute(MappedAttributeattr)
 {
     const String& value = attr->value();
     if (attr->name() == SVGNames::inAttr)
@@ -59,10 +59,10 @@ void SVGFEComponentTransferElement::parseMappedAttribute(MappedAttribute *attr)
         SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr);
 }
 
-SVGFEComponentTransfer *SVGFEComponentTransferElement::filterEffect() const
+SVGFEComponentTransferSVGFEComponentTransferElement::filterEffect() const
 {
     if (!m_filterEffect)
-        m_filterEffect = static_cast<SVGFEComponentTransfer *>(renderingDevice()->createFilterEffect(FE_COMPONENT_TRANSFER));
+        m_filterEffect = static_cast<SVGFEComponentTransfer*>(SVGResourceFilter::createFilterEffect(FE_COMPONENT_TRANSFER));
     if (!m_filterEffect)
         return 0;
     
@@ -71,13 +71,13 @@ SVGFEComponentTransfer *SVGFEComponentTransferElement::filterEffect() const
     
     for (Node *n = firstChild(); n != 0; n = n->nextSibling()) {
         if (n->hasTagName(SVGNames::feFuncRTag))
-            m_filterEffect->setRedFunction(static_cast<SVGFEFuncRElement *>(n)->transferFunction());
+            m_filterEffect->setRedFunction(static_cast<SVGFEFuncRElement*>(n)->transferFunction());
         else if (n->hasTagName(SVGNames::feFuncGTag))
-            m_filterEffect->setGreenFunction(static_cast<SVGFEFuncGElement *>(n)->transferFunction());
+            m_filterEffect->setGreenFunction(static_cast<SVGFEFuncGElement*>(n)->transferFunction());
         else if (n->hasTagName(SVGNames::feFuncBTag))
-            m_filterEffect->setBlueFunction(static_cast<SVGFEFuncBElement *>(n)->transferFunction());
+            m_filterEffect->setBlueFunction(static_cast<SVGFEFuncBElement*>(n)->transferFunction());
         else if (n->hasTagName(SVGNames::feFuncATag))
-            m_filterEffect->setAlphaFunction(static_cast<SVGFEFuncAElement *>(n)->transferFunction());
+            m_filterEffect->setAlphaFunction(static_cast<SVGFEFuncAElement*>(n)->transferFunction());
     }
 
     return m_filterEffect;
@@ -85,6 +85,6 @@ SVGFEComponentTransfer *SVGFEComponentTransferElement::filterEffect() const
 
 }
 
-// vim:ts=4:noet
 #endif // SVG_SUPPORT
 
+// vim:ts=4:noet
index 422e6a5dfb3cd31bbaa1f9b815aa5804be923825..04119032d7142721359a7f2fc39f988ce989e6b6 100644 (file)
 */
 
 #include "config.h"
+
 #ifdef SVG_SUPPORT
 #include "SVGFECompositeElement.h"
 
-#include "KRenderingDevice.h"
 #include "SVGHelper.h"
 #include "SVGNames.h"
+#include "SVGResourceFilter.h"
 
 namespace WebCore {
 
-SVGFECompositeElement::SVGFECompositeElement(const QualifiedName& tagName, Document *doc)
+SVGFECompositeElement::SVGFECompositeElement(const QualifiedName& tagName, Documentdoc)
     : SVGFilterPrimitiveStandardAttributes(tagName, doc)
     , m__operator(0)
     , m_k1(0.0)
@@ -88,10 +89,10 @@ void SVGFECompositeElement::parseMappedAttribute(MappedAttribute *attr)
         SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr);
 }
 
-SVGFEComposite *SVGFECompositeElement::filterEffect() const
+SVGFECompositeSVGFECompositeElement::filterEffect() const
 {
     if (!m_filterEffect)
-        m_filterEffect = static_cast<SVGFEComposite *>(renderingDevice()->createFilterEffect(FE_COMPOSITE));
+        m_filterEffect = static_cast<SVGFEComposite*>(SVGResourceFilter::createFilterEffect(FE_COMPOSITE));
     if (!m_filterEffect)
         return 0;
     m_filterEffect->setOperation((SVGCompositeOperationType) _operator());
@@ -107,6 +108,6 @@ SVGFEComposite *SVGFECompositeElement::filterEffect() const
 
 }
 
-// vim:ts=4:noet
 #endif // SVG_SUPPORT
 
+// vim:ts=4:noet
index 1cb968bc87cda5403ef60a4e6668698f95d6925a..99699cd878a34a9425f93d51a2aeff86e5810fdc 100644 (file)
 #include "config.h"
 
 #ifdef SVG_SUPPORT
-
 #include "SVGFEDiffuseLightingElement.h"
 
 #include "Attr.h"
-#include "KRenderingDevice.h"
 #include "SVGColor.h"
 #include "SVGFELightElement.h"
 #include "SVGHelper.h"
 #include "SVGNames.h"
 #include "SVGRenderStyle.h"
 #include "SVGFEDiffuseLighting.h"
+#include "SVGResourceFilter.h"
 
 namespace WebCore {
 
-SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement(const QualifiedName& tagName, Document *doc)
+SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement(const QualifiedName& tagName, Documentdoc)
     : SVGFilterPrimitiveStandardAttributes(tagName, doc)
     , m_diffuseConstant(0.0)
     , m_surfaceScale(0.0)
@@ -79,16 +78,19 @@ void SVGFEDiffuseLightingElement::parseMappedAttribute(MappedAttribute *attr)
         SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr);
 }
 
-SVGFilterEffect *SVGFEDiffuseLightingElement::filterEffect() const
+SVGFilterEffectSVGFEDiffuseLightingElement::filterEffect() const
 {
     if (!m_filterEffect) 
-        m_filterEffect = static_cast<SVGFEDiffuseLighting *>(renderingDevice()->createFilterEffect(FE_DIFFUSE_LIGHTING));
+        m_filterEffect = static_cast<SVGFEDiffuseLighting*>(SVGResourceFilter::createFilterEffect(FE_DIFFUSE_LIGHTING));
+    if (!m_filterEffect)
+        return 0;
+
     m_filterEffect->setIn(in1());
     setStandardAttributes(m_filterEffect);
-    m_filterEffect->setDiffuseConstant((diffuseConstant()));
-    m_filterEffect->setSurfaceScale((surfaceScale()));
-    m_filterEffect->setKernelUnitLengthX((kernelUnitLengthX()));
-    m_filterEffect->setKernelUnitLengthY((kernelUnitLengthY()));
+    m_filterEffect->setDiffuseConstant(diffuseConstant());
+    m_filterEffect->setSurfaceScale(surfaceScale());
+    m_filterEffect->setKernelUnitLengthX(kernelUnitLengthX());
+    m_filterEffect->setKernelUnitLengthY(kernelUnitLengthY());
     m_filterEffect->setLightingColor(lightingColor()->color());
     updateLights();
     return m_filterEffect;
@@ -99,14 +101,17 @@ void SVGFEDiffuseLightingElement::updateLights() const
     if (!m_filterEffect)
         return;
     
-    SVGLightSource *light = 0;
-    for (Node *n = firstChild(); n; n = n->nextSibling()) {
-        if (n->hasTagName(SVGNames::feDistantLightTag)||n->hasTagName(SVGNames::fePointLightTag)||n->hasTagName(SVGNames::feSpotLightTag)) {
-            SVGFELightElement *lightNode = static_cast<SVGFELightElement *>(n); 
+    SVGLightSource* light = 0;
+    for (Node* n = firstChild(); n; n = n->nextSibling()) {
+        if (n->hasTagName(SVGNames::feDistantLightTag) ||
+            n->hasTagName(SVGNames::fePointLightTag) ||
+            n->hasTagName(SVGNames::feSpotLightTag)) {
+            SVGFELightElement* lightNode = static_cast<SVGFELightElement*>(n); 
             light = lightNode->lightSource();
             break;
         }
     }
+
     m_filterEffect->setLightSource(light);
 }
 
@@ -114,3 +119,4 @@ void SVGFEDiffuseLightingElement::updateLights() const
 
 #endif // SVG_SUPPORT
 
+// vim:ts=4:noet
index 79027cf9b93ab21071d1b812cb728a5fdb4dcc95..fa76b693271e93a87a1fbd3d4349f87df8f9b10a 100644 (file)
 
 
 #include "config.h"
+
 #ifdef SVG_SUPPORT
 #include "SVGFEDisplacementMapElement.h"
 
-#include "KRenderingDevice.h"
 #include "SVGHelper.h"
+#include "SVGResourceFilter.h"
 
 namespace WebCore {
 
@@ -81,11 +82,11 @@ void SVGFEDisplacementMapElement::parseMappedAttribute(MappedAttribute* attr)
 SVGFEDisplacementMap* SVGFEDisplacementMapElement::filterEffect() const
 {
     if (!m_filterEffect)
-        m_filterEffect = static_cast<SVGFEDisplacementMap *>(renderingDevice()->createFilterEffect(FE_DISPLACEMENT_MAP));
+        m_filterEffect = static_cast<SVGFEDisplacementMap*>(SVGResourceFilter::createFilterEffect(FE_DISPLACEMENT_MAP));
     if (!m_filterEffect)
         return 0;
-    m_filterEffect->setXChannelSelector((SVGChannelSelectorType)(xChannelSelector()));
-    m_filterEffect->setYChannelSelector((SVGChannelSelectorType)(yChannelSelector()));
+    m_filterEffect->setXChannelSelector((SVGChannelSelectorType) xChannelSelector());
+    m_filterEffect->setYChannelSelector((SVGChannelSelectorType) yChannelSelector());
     m_filterEffect->setIn(in1());
     m_filterEffect->setIn2(in2());
     m_filterEffect->setScale(scale());
@@ -94,4 +95,7 @@ SVGFEDisplacementMap* SVGFEDisplacementMapElement::filterEffect() const
 }
 
 }
+
 #endif // SVG_SUPPORT
+
+// vim:ts=4:noet
index d8ae8d4042a7b76a8a2bae9d83af40ceba198d4d..28cefca356dbc695e00654205cd1a6b3cde70095 100644 (file)
  */
 
 #include "config.h"
+
 #ifdef SVG_SUPPORT
 #include "SVGFEDistantLightElement.h"
 #include "SVGDistantLightSource.h"
 
 namespace WebCore {
 
-SVGFEDistantLightElement::SVGFEDistantLightElement(const QualifiedName& tagName, Document *doc) : 
-SVGFELightElement(tagName, doc)
+SVGFEDistantLightElement::SVGFEDistantLightElement(const QualifiedName& tagName, Documentdoc) : 
+    SVGFELightElement(tagName, doc)
 {
 }
 
@@ -33,7 +34,7 @@ SVGFEDistantLightElement::~SVGFEDistantLightElement()
 {
 }
 
-SVGLightSource *SVGFEDistantLightElement::lightSource() const
+SVGLightSourceSVGFEDistantLightElement::lightSource() const
 {
     return new SVGDistantLightSource(azimuth(), elevation());
 }
index c269daddc40f8d842ab665d59016fc956bf237d6..a842f7ddc7e6f0d6f6c6d36abfa5a32507c0881f 100644 (file)
@@ -21,6 +21,7 @@
 */
 
 #include "config.h"
+
 #ifdef SVG_SUPPORT
 #include "SVGFEFloodElement.h"
 
 #include "SVGHelper.h"
 #include "SVGNames.h"
 #include "SVGRenderStyle.h"
-#include "KRenderingDevice.h"
+#include "SVGResourceFilter.h"
 
 namespace WebCore {
 
-SVGFEFloodElement::SVGFEFloodElement(const QualifiedName& tagName, Document *doc)
+SVGFEFloodElement::SVGFEFloodElement(const QualifiedName& tagName, Documentdoc)
     : SVGFilterPrimitiveStandardAttributes(tagName, doc)
     , m_filterEffect(0)
 {
@@ -46,7 +47,7 @@ SVGFEFloodElement::~SVGFEFloodElement()
 
 ANIMATED_PROPERTY_DEFINITIONS(SVGFEFloodElement, String, String, string, In1, in1, SVGNames::inAttr.localName(), m_in1)
 
-void SVGFEFloodElement::parseMappedAttribute(MappedAttribute *attr)
+void SVGFEFloodElement::parseMappedAttribute(MappedAttributeattr)
 {
     const String& value = attr->value();
     if (attr->name() == SVGNames::inAttr)
@@ -55,16 +56,16 @@ void SVGFEFloodElement::parseMappedAttribute(MappedAttribute *attr)
         SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr);
 }
 
-SVGFEFlood *SVGFEFloodElement::filterEffect() const
+SVGFEFloodSVGFEFloodElement::filterEffect() const
 {
     if (!m_filterEffect)
-        m_filterEffect = static_cast<SVGFEFlood *>(renderingDevice()->createFilterEffect(FE_FLOOD));
+        m_filterEffect = static_cast<SVGFEFlood*>(SVGResourceFilter::createFilterEffect(FE_FLOOD));
     if (!m_filterEffect)
         return 0;
     m_filterEffect->setIn(in1());
     setStandardAttributes(m_filterEffect);
-    RenderStyle *filterStyle = const_cast<SVGFEFloodElement *>(this)->styleForRenderer(parentNode()->renderer());
-    const SVGRenderStyle *svgStyle = filterStyle->svgStyle();
+    RenderStylefilterStyle = const_cast<SVGFEFloodElement *>(this)->styleForRenderer(parentNode()->renderer());
+    const SVGRenderStylesvgStyle = filterStyle->svgStyle();
     m_filterEffect->setFloodColor(svgStyle->floodColor());
     m_filterEffect->setFloodOpacity(svgStyle->floodOpacity());
     filterStyle->deref(view()->renderArena());
@@ -74,6 +75,6 @@ SVGFEFlood *SVGFEFloodElement::filterEffect() const
 
 }
 
-// vim:ts=4:noet
 #endif // SVG_SUPPORT
 
+// vim:ts=4:noet
index 89a332fbe7235d0ce430c38c367cdef0b4ce036e..466d370a488612c80ada02c4a2f5110b5beb87a7 100644 (file)
@@ -21,6 +21,7 @@
 */
 
 #include "config.h"
+
 #ifdef SVG_SUPPORT
 #include "SVGFEFuncAElement.h"
 
@@ -37,6 +38,6 @@ SVGFEFuncAElement::~SVGFEFuncAElement()
 
 }
 
-// vim:ts=4:noet
 #endif // SVG_SUPPORT
 
+// vim:ts=4:noet
index 695fd19b9547e5a282eb5e2d8b7bddd83ab27985..60d1dae470f82026d1195bcc760cc2fd04bb47cc 100644 (file)
@@ -21,6 +21,7 @@
 */
 
 #include "config.h"
+
 #ifdef SVG_SUPPORT
 #include "SVGFEFuncBElement.h"
 
@@ -37,6 +38,6 @@ SVGFEFuncBElement::~SVGFEFuncBElement()
 
 }
 
-// vim:ts=4:noet
 #endif // SVG_SUPPORT
 
+// vim:ts=4:noet
index 5146e5e872f9e44d8a6dd2fad0e7657bcbb9facc..0350c839db960039a406587e61559e8d4d7dd807 100644 (file)
 */
 
 #include "config.h"
+
 #ifdef SVG_SUPPORT
 #include "SVGFEFuncGElement.h"
 
 namespace WebCore {
 
 SVGFEFuncGElement::SVGFEFuncGElement(const QualifiedName& tagName, Document* doc) : 
-SVGComponentTransferFunctionElement(tagName, doc)
+    SVGComponentTransferFunctionElement(tagName, doc)
 {
 }
 
@@ -37,6 +38,6 @@ SVGFEFuncGElement::~SVGFEFuncGElement()
 
 }
 
-// vim:ts=4:noet
 #endif // SVG_SUPPORT
 
+// vim:ts=4:noet
index 11f12794c4c973edf62df8b52223a9bd64b7186c..9dc5c7b502afb205f0d3ab88690233b285a53869 100644 (file)
@@ -21,6 +21,7 @@
 */
 
 #include "config.h"
+
 #ifdef SVG_SUPPORT
 #include "SVGFEFuncRElement.h"
 
@@ -37,6 +38,6 @@ SVGFEFuncRElement::~SVGFEFuncRElement()
 
 }
 
-// vim:ts=4:noet
 #endif // SVG_SUPPORT
 
+// vim:ts=4:noet
index 8722c266cc56c2693c8b32565a8e4ecee8a1a083..fd7d4e81b865d8ebd7d7009d21df52cb4a712001 100644 (file)
 */
 
 #include "config.h"
+
 #ifdef SVG_SUPPORT
 #include "SVGFEGaussianBlurElement.h"
 
-#include "KRenderingDevice.h"
 #include "SVGHelper.h"
 #include "SVGNames.h"
+#include "SVGResourceFilter.h"
 
 namespace WebCore {
 
@@ -70,7 +71,7 @@ void SVGFEGaussianBlurElement::parseMappedAttribute(MappedAttribute* attr)
 SVGFEGaussianBlur* SVGFEGaussianBlurElement::filterEffect() const
 {
     if (!m_filterEffect)
-        m_filterEffect = static_cast<SVGFEGaussianBlur*>(renderingDevice()->createFilterEffect(FE_GAUSSIAN_BLUR));
+        m_filterEffect = static_cast<SVGFEGaussianBlur*>(SVGResourceFilter::createFilterEffect(FE_GAUSSIAN_BLUR));
     if (!m_filterEffect)
         return 0;
     m_filterEffect->setIn(in1());
@@ -82,6 +83,6 @@ SVGFEGaussianBlur* SVGFEGaussianBlurElement::filterEffect() const
 
 }
 
-// vim:ts=4:noet
 #endif // SVG_SUPPORT
 
+// vim:ts=4:noet
index 1f6da5e1d9be05e66c734550ecd5393c70498eb2..c2842ac9b78dbd14b5c92a7f3f224a353f850901 100644 (file)
@@ -21,6 +21,7 @@
 */
 
 #include "config.h"
+
 #ifdef SVG_SUPPORT
 #include "SVGFEImageElement.h"
 
 #include "DocLoader.h"
 #include "Document.h"
 #include "SVGResourceImage.h"
-#include "KRenderingDevice.h"
 #include "SVGHelper.h"
 #include "SVGLength.h"
 #include "SVGNames.h"
 #include "SVGPreserveAspectRatio.h"
+#include "SVGResourceFilter.h"
 
 namespace WebCore {
 
-SVGFEImageElement::SVGFEImageElement(const QualifiedName& tagName, Document *doc)
+SVGFEImageElement::SVGFEImageElement(const QualifiedName& tagName, Documentdoc)
     : SVGFilterPrimitiveStandardAttributes(tagName, doc)
     , SVGURIReference()
     , SVGLangSpace()
@@ -57,7 +58,7 @@ SVGFEImageElement::~SVGFEImageElement()
 
 ANIMATED_PROPERTY_DEFINITIONS(SVGFEImageElement, SVGPreserveAspectRatio*, PreserveAspectRatio, preserveAspectRatio, PreserveAspectRatio, preserveAspectRatio, SVGNames::preserveAspectRatioAttr.localName(), m_preserveAspectRatio.get())
 
-void SVGFEImageElement::parseMappedAttribute(MappedAttribute *attr)
+void SVGFEImageElement::parseMappedAttribute(MappedAttributeattr)
 {
     const String& value = attr->value();
     if (attr->name() == SVGNames::preserveAspectRatioAttr)
@@ -80,16 +81,16 @@ void SVGFEImageElement::parseMappedAttribute(MappedAttribute *attr)
     }
 }
 
-void SVGFEImageElement::notifyFinished(CachedResource *finishedObj)
+void SVGFEImageElement::notifyFinished(CachedResourcefinishedObj)
 {
     if (finishedObj == m_cachedImage && filterEffect())
         filterEffect()->setCachedImage(m_cachedImage);
 }
 
-SVGFEImage *SVGFEImageElement::filterEffect() const
+SVGFEImageSVGFEImageElement::filterEffect() const
 {
     if (!m_filterEffect)
-        m_filterEffect = static_cast<SVGFEImage *>(renderingDevice()->createFilterEffect(FE_IMAGE));
+        m_filterEffect = static_cast<SVGFEImage*>(SVGResourceFilter::createFilterEffect(FE_IMAGE));
     if (!m_filterEffect)
         return 0;
     setStandardAttributes(m_filterEffect);
@@ -98,6 +99,6 @@ SVGFEImage *SVGFEImageElement::filterEffect() const
 
 }
 
-// vim:ts=4:noet
 #endif // SVG_SUPPORT
 
+// vim:ts=4:noet
index 4e4dffd2ce32951a0d1d78151a0f3588ce7f7153..38821d8da3ae0a648ae62314b0f7332c97f47b7f 100644 (file)
@@ -20,6 +20,7 @@
 */
 
 #include "config.h"
+
 #ifdef SVG_SUPPORT
 #include "SVGFELightElement.h"
 
@@ -90,3 +91,4 @@ void SVGFELightElement::parseMappedAttribute(MappedAttribute* attr)
 
 #endif // SVG_SUPPORT
 
+// vim:ts=4:noet
index f30ebe671ad491a09aaff5bf1dcf1d91c59cf585..039e0fd1f97b424907e9e6e7c95ed19164a83c4e 100644 (file)
 */
 
 #include "config.h"
+
 #ifdef SVG_SUPPORT
 #include "SVGFEMergeElement.h"
 
-#include "KRenderingDevice.h"
 #include "SVGFEMergeNodeElement.h"
 #include "SVGHelper.h"
+#include "SVGResourceFilter.h"
 
 namespace WebCore {
 
@@ -44,7 +45,7 @@ SVGFEMergeElement::~SVGFEMergeElement()
 SVGFEMerge* SVGFEMergeElement::filterEffect() const
 {
     if (!m_filterEffect)
-        m_filterEffect = static_cast<SVGFEMerge*>(renderingDevice()->createFilterEffect(FE_MERGE));
+        m_filterEffect = static_cast<SVGFEMerge*>(SVGResourceFilter::createFilterEffect(FE_MERGE));
     if (!m_filterEffect)
         return 0;
     setStandardAttributes(m_filterEffect);
@@ -56,12 +57,12 @@ SVGFEMerge* SVGFEMergeElement::filterEffect() const
     }
 
     m_filterEffect->setMergeInputs(mergeInputs);
-
     return m_filterEffect;
 }
 
 }
 
-// vim:ts=4:noet
+
 #endif // SVG_SUPPORT
 
+// vim:ts=4:noet
index 8589c78971d24f0d049b94e2d19df6f608439ad9..b87a276c9a2b905dcf77f636b13d892db2e56d49 100644 (file)
@@ -21,6 +21,7 @@
 */
 
 #include "config.h"
+
 #ifdef SVG_SUPPORT
 #include "SVGFEMergeNodeElement.h"
 
@@ -50,6 +51,6 @@ void SVGFEMergeNodeElement::parseMappedAttribute(MappedAttribute* attr)
 
 }
 
-// vim:ts=4:noet
 #endif // SVG_SUPPORT
 
+// vim:ts=4:noet
index 3637ca305194780993c186d0db0bc91cf2e520d5..c954b47bae6500b1f6c4b93c7e2a2aaf672ea072 100644 (file)
 */
 
 #include "config.h"
-#ifdef SVG_SUPPORT
-#include "Attr.h"
 
-#include "KRenderingDevice.h"
+#ifdef SVG_SUPPORT
+#include "SVGFEOffsetElement.h"
 
+#include "Attr.h"
 #include "SVGHelper.h"
 #include "SVGRenderStyle.h"
-#include "SVGFEOffsetElement.h"
+#include "SVGResourceFilter.h"
 
 namespace WebCore {
 
-SVGFEOffsetElement::SVGFEOffsetElement(const QualifiedName& tagName, Document *doc)
+SVGFEOffsetElement::SVGFEOffsetElement(const QualifiedName& tagName, Documentdoc)
     : SVGFilterPrimitiveStandardAttributes(tagName, doc)
     , m_dx(0.0)
     , m_dy(0.0)
@@ -49,7 +49,7 @@ ANIMATED_PROPERTY_DEFINITIONS(SVGFEOffsetElement, String, String, string, In1, i
 ANIMATED_PROPERTY_DEFINITIONS(SVGFEOffsetElement, double, Number, number, Dx, dx, SVGNames::dxAttr.localName(), m_dx)
 ANIMATED_PROPERTY_DEFINITIONS(SVGFEOffsetElement, double, Number, number, Dy, dy, SVGNames::dyAttr.localName(), m_dy)
 
-void SVGFEOffsetElement::parseMappedAttribute(MappedAttribute *attr)
+void SVGFEOffsetElement::parseMappedAttribute(MappedAttributeattr)
 {
     const String& value = attr->value();
     if (attr->name() == SVGNames::dxAttr)
@@ -62,10 +62,10 @@ void SVGFEOffsetElement::parseMappedAttribute(MappedAttribute *attr)
         SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr);
 }
 
-SVGFEOffset *SVGFEOffsetElement::filterEffect() const
+SVGFEOffsetSVGFEOffsetElement::filterEffect() const
 {
     if (!m_filterEffect)
-        m_filterEffect = static_cast<SVGFEOffset *>(renderingDevice()->createFilterEffect(FE_OFFSET));
+        m_filterEffect = static_cast<SVGFEOffset*>(SVGResourceFilter::createFilterEffect(FE_OFFSET));
     if (!m_filterEffect)
         return 0;
     m_filterEffect->setIn(in1());
@@ -77,6 +77,6 @@ SVGFEOffset *SVGFEOffsetElement::filterEffect() const
 
 }
 
-// vim:ts=4:noet
 #endif // SVG_SUPPORT
 
+// vim:ts=4:noet
index 8c9aada7f2ca988514a1b2816448dfa7b857e879..b90492c1145451d4f1dd6db71510a13496f4c18d 100644 (file)
@@ -18,6 +18,7 @@
  */
 
 #include "config.h"
+
 #ifdef SVG_SUPPORT
 #include "SVGFEPointLightElement.h"
 #include "SVGPointLightSource.h"
@@ -33,12 +34,14 @@ SVGFEPointLightElement::~SVGFEPointLightElement()
 {
 }
 
-SVGLightSource *SVGFEPointLightElement::lightSource() const
+SVGLightSourceSVGFEPointLightElement::lightSource() const
 {
     FloatPoint3D pos(x(), y(), z());
     return new SVGPointLightSource(pos);
 }
 
 }
+
 #endif // SVG_SUPPORT
 
+// vim:ts=4:noet
index 6938c08c8ed5ac0a60581a2510bf8c4dddbfc4a8..47f8b32eb47ae6267f0cf2c8ef5588e791c3f88b 100644 (file)
 */
 
 #include "config.h"
+
 #ifdef SVG_SUPPORT
 #include "SVGFESpecularLightingElement.h"
 
-#include "KRenderingDevice.h"
 #include "SVGColor.h"
 #include "SVGHelper.h"
 #include "SVGNames.h"
 #include "SVGFELightElement.h"
+#include "SVGResourceFilter.h"
 
 namespace WebCore {
 
@@ -36,7 +37,7 @@ SVGFESpecularLightingElement::SVGFESpecularLightingElement(const QualifiedName&
     , m_specularConstant(0.0)
     , m_specularExponent(0.0)
     , m_surfaceScale(0.0)
-    , m_lightingColor(new SVGColor())
+    , m_lightingColor(new SVGColor)
     , m_kernelUnitLengthX(0.0)
     , m_kernelUnitLengthY(0.0)
     , m_filterEffect(0)
@@ -83,7 +84,9 @@ void SVGFESpecularLightingElement::parseMappedAttribute(MappedAttribute* attr)
 SVGFESpecularLighting* SVGFESpecularLightingElement::filterEffect() const
 {
     if (!m_filterEffect) 
-        m_filterEffect = static_cast<SVGFESpecularLighting*>(renderingDevice()->createFilterEffect(FE_SPECULAR_LIGHTING));
+        m_filterEffect = static_cast<SVGFESpecularLighting*>(SVGResourceFilter::createFilterEffect(FE_SPECULAR_LIGHTING));
+    if (!m_filterEffect)
+        return 0;
     m_filterEffect->setIn(in1());
     setStandardAttributes(m_filterEffect);
     m_filterEffect->setSpecularConstant((specularConstant()));
@@ -103,7 +106,9 @@ void SVGFESpecularLightingElement::updateLights() const
 
     SVGLightSource* light = 0;    
     for (Node* n = firstChild(); n; n = n->nextSibling()) {
-        if (n->hasTagName(SVGNames::feDistantLightTag)||n->hasTagName(SVGNames::fePointLightTag)||n->hasTagName(SVGNames::feSpotLightTag)) {
+        if (n->hasTagName(SVGNames::feDistantLightTag) || 
+            n->hasTagName(SVGNames::fePointLightTag) ||
+            n->hasTagName(SVGNames::feSpotLightTag)) {
             SVGFELightElement* lightNode = static_cast<SVGFELightElement*>(n); 
             light = lightNode->lightSource();
             break;
@@ -116,3 +121,4 @@ void SVGFESpecularLightingElement::updateLights() const
 
 #endif // SVG_SUPPORT
 
+// vim:ts=4:noet
index 36dbae0323ec7fef22a439b4345797616aca350d..65f292adb6254fc4aaf271ea46ae09b8decc2815 100644 (file)
  */
 
 #include "config.h"
+
 #ifdef SVG_SUPPORT
 #include "SVGFESpotLightElement.h"
 #include "SVGSpotLightSource.h"
 
 namespace WebCore {
 
-SVGFESpotLightElement::SVGFESpotLightElement(const QualifiedName& tagName, Document *doc) : 
-SVGFELightElement(tagName, doc)
+SVGFESpotLightElement::SVGFESpotLightElement(const QualifiedName& tagName, Document* doc)
+    : SVGFELightElement(tagName, doc)
 {
 }
 
@@ -33,10 +34,11 @@ SVGFESpotLightElement::~SVGFESpotLightElement()
 {
 }
 
-SVGLightSource *SVGFESpotLightElement::lightSource() const
+SVGLightSourceSVGFESpotLightElement::lightSource() const
 {
     FloatPoint3D pos(x(), y(), z());
-    //convert lookAt to a direction
+
+    // convert lookAt to a direction
     FloatPoint3D direction(pointsAtX() - pos.x(), 
                              pointsAtY() - pos.y(), 
                              pointsAtZ() - pos.z());
@@ -45,5 +47,7 @@ SVGLightSource *SVGFESpotLightElement::lightSource() const
 }
 
 }
+
 #endif // SVG_SUPPORT
 
+// vim:ts=4:noet
index f7982008dd33b7d0f9fa307371b900cfe9c4e2fe..add190ac01bc10fe9adc83121dd4d525cd1adbcc 100644 (file)
 #include "config.h"
 
 #ifdef SVG_SUPPORT
-
 #include "SVGFETileElement.h"
 
 #include "Attr.h"
-#include "KRenderingDevice.h"
 #include "SVGHelper.h"
 #include "SVGRenderStyle.h"
+#include "SVGResourceFilter.h"
 
 namespace WebCore {
 
-SVGFETileElement::SVGFETileElement(const QualifiedName& tagName, Document *doc)
+SVGFETileElement::SVGFETileElement(const QualifiedName& tagName, Documentdoc)
     : SVGFilterPrimitiveStandardAttributes(tagName, doc)
     , m_filterEffect(0)
 {
@@ -46,7 +45,7 @@ SVGFETileElement::~SVGFETileElement()
 
 ANIMATED_PROPERTY_DEFINITIONS(SVGFETileElement, String, String, string, In1, in1, SVGNames::inAttr.localName(), m_in1)
 
-void SVGFETileElement::parseMappedAttribute(MappedAttribute *attr)
+void SVGFETileElement::parseMappedAttribute(MappedAttributeattr)
 {
     const String& value = attr->value();
     if (attr->name() == SVGNames::inAttr)
@@ -55,10 +54,10 @@ void SVGFETileElement::parseMappedAttribute(MappedAttribute *attr)
         SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr);
 }
 
-SVGFETile *SVGFETileElement::filterEffect() const
+SVGFETileSVGFETileElement::filterEffect() const
 {
     if (!m_filterEffect)
-        m_filterEffect = static_cast<SVGFETile *>(renderingDevice()->createFilterEffect(FE_TILE));
+        m_filterEffect = static_cast<SVGFETile*>(SVGResourceFilter::createFilterEffect(FE_TILE));
     if (!m_filterEffect)
         return 0;
     m_filterEffect->setIn(in1());
@@ -68,6 +67,6 @@ SVGFETile *SVGFETileElement::filterEffect() const
 
 }
 
-// vim:ts=4:noet
 #endif // SVG_SUPPORT
 
+// vim:ts=4:noet
index 2d7605a34bf18e50199cc15a83796663e8655c33..89bd493f90b7f6a7785d4916704f888404004bcc 100644 (file)
 */
 
 #include "config.h"
+
 #ifdef SVG_SUPPORT
 #include "SVGFETurbulenceElement.h"
-
-#include "KRenderingDevice.h"
+#include "SVGResourceFilter.h"
 
 namespace WebCore {
 
@@ -83,7 +83,7 @@ void SVGFETurbulenceElement::parseMappedAttribute(MappedAttribute* attr)
 SVGFETurbulence* SVGFETurbulenceElement::filterEffect() const
 {
     if (!m_filterEffect)
-        m_filterEffect = static_cast<SVGFETurbulence*>(renderingDevice()->createFilterEffect(FE_TURBULENCE));
+        m_filterEffect = static_cast<SVGFETurbulence*>(SVGResourceFilter::createFilterEffect(FE_TURBULENCE));
     if (!m_filterEffect)
         return 0;
     
@@ -99,6 +99,6 @@ SVGFETurbulence* SVGFETurbulenceElement::filterEffect() const
 
 }
 
-// vim:ts=4:noet
 #endif // SVG_SUPPORT
 
+// vim:ts=4:noet
index 2bdcdbe3fff53f91a9f0ab71f1b58f3ceaa041dd..5ab6736b3dfc6d0b227de8eb3b645fafd8df2791 100644 (file)
 */
 
 #include "config.h"
+
 #ifdef SVG_SUPPORT
 #include "SVGFilterElement.h"
 
 #include "Attr.h"
-#include "KRenderingDevice.h"
 #include "SVGResourceFilter.h"
 #include "SVGFilterPrimitiveStandardAttributes.h"
 #include "SVGHelper.h"
@@ -113,7 +113,7 @@ SVGResource* SVGFilterElement::canvasResource()
         return 0;
 
     if (!m_filter)
-        m_filter = WTF::static_pointer_cast<SVGResourceFilter>(renderingDevice()->createResource(FilterResourceType));
+        m_filter = new SVGResourceFilter();
 
     bool filterBBoxMode = filterUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX;
     m_filter->setFilterBoundingBoxMode(filterBBoxMode);
index f24d65bb8a2b12a439a5b7c88cb8e22813f3fe14..fd8637fdac73d17877a826e90e13f2553cb9cf68 100644 (file)
 */
 
 #include "config.h"
+
 #ifdef SVG_SUPPORT
 #include "SVGGradientElement.h"
 
-#include "KRenderingDevice.h"
+#include "cssstyleselector.h"
 #include "RenderPath.h"
 #include "RenderView.h"
 #include "SVGHelper.h"
@@ -33,7 +34,8 @@
 #include "SVGTransformList.h"
 #include "SVGTransformable.h"
 #include "SVGUnitTypes.h"
-#include "cssstyleselector.h"
+#include "SVGPaintServerLinearGradient.h"
+#include "SVGPaintServerRadialGradient.h"
 
 namespace WebCore {
 
@@ -106,7 +108,11 @@ void SVGGradientElement::notifyAttributeChange() const
 SVGResource* SVGGradientElement::canvasResource()
 {
     if (!m_resource) {
-        m_resource = WTF::static_pointer_cast<SVGPaintServerGradient>(renderingDevice()->createPaintServer(gradientType()));
+        if (gradientType() == LinearGradientPaintServer)
+            m_resource = new SVGPaintServerLinearGradient();
+        else
+            m_resource = new SVGPaintServerRadialGradient();
+
         m_resource->setListener(this);
         buildGradient(m_resource);
     }
index 4b1e60a336ea1bf4be0d501844c69686bad84efb..704dbe7c94e4091524cea73a197b6ea4b0dd1bb8 100644 (file)
 */
 
 #include "config.h"
+
 #ifdef SVG_SUPPORT
 #include "SVGLinearGradientElement.h"
 
-#include "KRenderingDevice.h"
 #include "SVGPaintServerLinearGradient.h"
 #include "SVGHelper.h"
 #include "SVGLength.h"
index d3d2d62b13b13a98ca2c129a36343c9597d65a86..c57401f38eef0cb0e9789d85de8522353ff4e4ab 100644 (file)
 */
 
 #include "config.h"
+
 #ifdef SVG_SUPPORT
 #include "SVGMarkerElement.h"
 
-#include "KRenderingDevice.h"
 #include "PlatformString.h"
 #include "RenderSVGContainer.h"
 #include "SVGAngle.h"
index badf821d59c58723df67b7399d92e81931fe7eaf..1a1278b67dcd68bd6db106c3ab645ef55c525a8f 100644 (file)
 */
 
 #include "config.h"
+
 #ifdef SVG_SUPPORT
 #include "SVGMaskElement.h"
 
 #include "GraphicsContext.h"
 #include "SVGResourceImage.h"
-#include "KRenderingDevice.h"
 #include "RenderSVGContainer.h"
 #include "SVGHelper.h"
 #include "SVGLength.h"
@@ -99,33 +99,24 @@ void SVGMaskElement::parseMappedAttribute(MappedAttribute* attr)
         SVGStyledElement::parseMappedAttribute(attr);
     }
 }
-
 SVGResourceImage* SVGMaskElement::drawMaskerContent()
 {
-    KRenderingDevice* device = renderingDevice();
-    if (!device->currentContext()) // FIXME: hack for now until Image::lockFocus exists
-        return 0;
-    if (!renderer())
-        return 0;
-
+    // FIXME: Masks are broken! This way it can NOT work!
+    // We need a image->createContext() function - as Eric suggested -
+    // to finally fix the problem in one function, and share it with patterns...
+    return 0;
     SVGResourceImage* maskImage = new SVGResourceImage();
 
     IntSize size = IntSize(lroundf(width()->value()), lroundf(height()->value()));
     maskImage->init(size);
 
-    KRenderingDeviceContext* patternContext = device->contextForImage(maskImage);
-    device->pushContext(patternContext);
-
-    OwnPtr<GraphicsContext> context(patternContext->createGraphicsContext());
+    OwnPtr<GraphicsContext> context(contextForImage(maskImage));
 
     RenderSVGContainer* maskContainer = static_cast<RenderSVGContainer*>(renderer());
     RenderObject::PaintInfo info(context.get(), IntRect(), PaintPhaseForeground, 0, 0, 0);
     maskContainer->setDrawsContents(true);
     maskContainer->paint(info, 0, 0);
     maskContainer->setDrawsContents(false);
-    
-    device->popContext();
-    delete patternContext;
 
     return maskImage;
 }
@@ -146,7 +137,7 @@ SVGResource* SVGMaskElement::canvasResource()
     if (m_dirty) {
         RefPtr<SVGResourceImage> mask(drawMaskerContent());
         m_masker->setMask(mask);
-        m_dirty = (mask != 0);
+        m_dirty = (mask == 0);
     }
     return m_masker.get();
 }
index 2cde693c060d0a1586be6736da5aecadd5da09cc..257f6c5430109d26ba1dba11a3f5f0031332f375 100644 (file)
 */
 
 #include "config.h"
+
 #ifdef SVG_SUPPORT
 #include "SVGPatternElement.h"
 
 #include "Document.h"
 #include "GraphicsContext.h"
 #include "SVGResourceImage.h"
-#include "KRenderingDevice.h"
 #include "SVGPaintServerPattern.h"
 #include "RenderSVGContainer.h"
 #include "SVGHelper.h"
@@ -166,8 +166,6 @@ void SVGPatternElement::fillAttributesFromReferencePattern(const SVGPatternEleme
 
 void SVGPatternElement::drawPatternContentIntoTile(const SVGPatternElement* target, const IntSize& newSize, AffineTransform patternTransformMatrix)
 {
-    KRenderingDevice* device = renderingDevice();
-    
     SVGStyledElement* activeElement = static_cast<SVGStyledElement*>(m_paintServer->activeClient()->element());
 
     bool bbox = (patternUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX);
@@ -185,15 +183,13 @@ void SVGPatternElement::drawPatternContentIntoTile(const SVGPatternElement* targ
     m_tile = new SVGResourceImage();
     m_tile->init(newSize);
 
-    KRenderingDeviceContext* patternContext = device->contextForImage(m_tile.get());
-    device->pushContext(patternContext);
+    OwnPtr<GraphicsContext> patternContext(contextForImage(m_tile.get()));
+
     FloatRect rect(x()->value(), y()->value(), width()->value(), height()->value());
     m_paintServer->setBbox(rect);
     m_paintServer->setPatternTransform(patternTransformMatrix);
     m_paintServer->setTile(m_tile.get());
 
-    OwnPtr<GraphicsContext> context(patternContext->createGraphicsContext());
-
     for (Node* n = target->firstChild(); n; n = n->nextSibling()) {
         SVGElement* elem = svg_dynamic_cast(n);
         if (!elem || !elem->isStyled())
@@ -233,8 +229,8 @@ void SVGPatternElement::drawPatternContentIntoTile(const SVGPatternElement* targ
             item->setLocalTransform(newMatrix.matrix());
         }
 #endif
-
-        RenderObject::PaintInfo info(context.get(), IntRect(), PaintPhaseForeground, 0, 0, 0);
+        RenderObject::PaintInfo info(patternContext.get(), IntRect(), PaintPhaseForeground, 0, 0, 0);
         item->paint(info, 0, 0);
 
 #if 0
@@ -247,9 +243,6 @@ void SVGPatternElement::drawPatternContentIntoTile(const SVGPatternElement* targ
 
     if (savedContext)
         const_cast<SVGPatternElement*>(this)->pushAttributeContext(savedContext);
-
-    device->popContext();
-    delete patternContext;
 }
 
 void SVGPatternElement::notifyClientsToRepaint() const
@@ -326,7 +319,7 @@ RenderObject* SVGPatternElement::createRenderer(RenderArena* arena, RenderStyle*
 SVGResource* SVGPatternElement::canvasResource()
 {
     if (!m_paintServer) {
-        m_paintServer = WTF::static_pointer_cast<SVGPaintServerPattern>(renderingDevice()->createPaintServer(SVGPaintServerType(PatternPaintServer)));
+        m_paintServer = new SVGPaintServerPattern();
         m_paintServer->setListener(const_cast<SVGPatternElement*>(this));
     }
     return m_paintServer.get();
index e0c128fec29ee1b608e24c97e577859b5813ecb3..d5db11e28bcba633e85f5162e8ac7b542bc27075 100644 (file)
 */
 
 #include "config.h"
+
 #ifdef SVG_SUPPORT
 #include "SVGStyledElement.h"
 
 #include "Attr.h"
 #include "HTMLNames.h"
 #include "Document.h"
-#include "KRenderingDevice.h"
 #include "PlatformString.h"
 #include "RenderView.h"
 #include "RenderPath.h"
index 00853000c5dc1f8fc7335da92478abff2739f00c..9850c36584b9a7047c08de09b9ca167abfef5f3f 100644 (file)
@@ -34,7 +34,6 @@
 namespace WebCore {
 
     class CSSStyleDeclaration;
-    class KRenderingDevice;
     class RenderPath;
     class RenderView;
 
index 154bf4a3fadc1277075237180fc734950a5b1e99..03b41b719f665c999ef962267876af4af8636122 100644 (file)
@@ -29,6 +29,7 @@
 #include "FloatRect.h"
 #include "Image.h"
 #include "IntRect.h"
+#include "Path.h"
 #include "Pen.h"
 #include "TextDirection.h"
 #include "UChar.h"
@@ -62,13 +63,10 @@ namespace WebCore {
     class GraphicsContextPlatformPrivate;
     class KURL;
     class Path;
+    class SVGResourceImage;
     class TextRun;
     class TextStyle;
 
-#ifdef SVG_SUPPORT
-    class KRenderingDeviceContext;
-#endif
-
     class GraphicsContext : Noncopyable {
     public:
         GraphicsContext(PlatformGraphicsContext*);
@@ -157,6 +155,9 @@ namespace WebCore {
 
         void setCompositeOperation(CompositeOperator);
 
+        void beginPath();
+        void addPath(const Path& path);
+
         void clip(const Path&);
 
         void scale(const FloatSize&);
@@ -168,16 +169,17 @@ namespace WebCore {
 
         void concatCTM(const AffineTransform&);
 
-#ifdef SVG_SUPPORT
-        KRenderingDeviceContext* createRenderingDeviceContext();
-#endif
-
 #if PLATFORM(WIN)
         GraphicsContext(HDC); // FIXME: To be removed.
         HDC getWindowsContext(bool supportAlphaBlend = false, const IntRect* = 0); // The passed in rect is used to create a bitmap for compositing inside transparency layers.
         void releaseWindowsContext(HDC, bool supportAlphaBlend = false, const IntRect* = 0);    // The passed in HDC should be the one handed back by getWindowsContext.
 #endif
 
+#if PLATFORM(QT)
+        void setFillRule(WindRule);
+        PlatformPath* currentPath();
+#endif
+
     private:
         void savePlatformState();
         void restorePlatformState();
@@ -196,6 +198,10 @@ namespace WebCore {
         GraphicsContextPlatformPrivate* m_data;
     };
 
+#ifdef SVG_SUPPORT
+    GraphicsContext* contextForImage(SVGResourceImage*);
+#endif
+
 } // namespace WebCore
 
 #endif // GraphicsContext_h
index 4d8a701456c2c7ad53e3d137fb982d84e4e00efa..87d7491fdf955f901abfdacaa9045d18c33816fc 100644 (file)
 #include "Path.h"
 #include <wtf/MathExtras.h>
 
-#ifdef SVG_SUPPORT
-#include "KRenderingDeviceQuartz.h"
-#endif
-
 #include <GraphicsContextPlatformPrivate.h> // FIXME: Temporary.
 
 using namespace std;
@@ -528,13 +524,6 @@ void GraphicsContext::addInnerRoundedRectClip(const IntRect& rect, int thickness
     CGContextEOClip(context);
 }
 
-#ifdef SVG_SUPPORT
-KRenderingDeviceContext* GraphicsContext::createRenderingDeviceContext()
-{
-    return new KRenderingDeviceContextQuartz(platformContext());
-}
-#endif
-
 void GraphicsContext::beginTransparencyLayer(float opacity)
 {
     if (paintingDisabled())
@@ -650,6 +639,16 @@ void GraphicsContext::setLineJoin(LineJoin join)
             break;
     }
 }
+void GraphicsContext::beginPath()
+{
+    CGContextBeginPath(platformContext());
+}
+
+void GraphicsContext::addPath(const Path& path)
+{
+    CGContextAddPath(platformContext(), path.platformPath());
+}
 
 void GraphicsContext::clip(const Path& path)
 {
index 0f7061bbb91237dfb1ea9289bc86b00c3f95a0d3..4481badb627019dd4962c64857110d6d788d851b 100644 (file)
@@ -54,10 +54,10 @@ namespace WebCore {
         ApplyToStrokeTargetType = 2
     };
 
+    class GraphicsContext;
     class RenderObject;
     class RenderPath;
     class RenderStyle;
-    class KRenderingDeviceContext; // FIXME: This is gone soon!
 
     class SVGPaintServer : public SVGResource {
     public:
@@ -76,11 +76,11 @@ namespace WebCore {
         virtual TextStream& externalRepresentation(TextStream&) const = 0;
 
         // To be implemented in platform specific code.
-        virtual void draw(KRenderingDeviceContext*, const RenderPath*, SVGPaintTargetType) const;
-        virtual void teardown(KRenderingDeviceContext*, const RenderObject*, SVGPaintTargetType) const;
-        virtual void renderPath(KRenderingDeviceContext*, const RenderPath*, SVGPaintTargetType) const;
+        virtual void draw(GraphicsContext*&, const RenderPath*, SVGPaintTargetType) const;
+        virtual void teardown(GraphicsContext*&, const RenderObject*, SVGPaintTargetType) const;
+        virtual void renderPath(GraphicsContext*&, const RenderPath*, SVGPaintTargetType) const;
 
-        virtual bool setup(KRenderingDeviceContext*, const RenderObject*, SVGPaintTargetType) const = 0;
+        virtual bool setup(GraphicsContext*&, const RenderObject*, SVGPaintTargetType) const = 0;
 
     protected:
 #if PLATFORM(CG)
index 24d4ca10721b32075602678bfd54ac32a2c41506..0a06e51af31bf6b27b15568bc8f24c1ab301841e 100644 (file)
@@ -72,6 +72,7 @@ SVGPaintServerGradient::SVGPaintServerGradient()
     , m_stopsCache(0)
     , m_stopsCount(0)
     , m_shadingCache(0)
+    , m_savedContext(0)
 #endif
 {
 }
index f559bc6c96052a5efd969c7a8805e220cc40bfa5..9cb36cda4b5c2254c2af1dc5542c7e5805d71f29 100644 (file)
@@ -77,10 +77,10 @@ namespace WebCore {
         virtual TextStream& externalRepresentation(TextStream&) const;
 
 #if PLATFORM(CG)
-        virtual void teardown(KRenderingDeviceContext*, const RenderObject*, SVGPaintTargetType) const;
-        virtual void renderPath(KRenderingDeviceContext*, const RenderPath*, SVGPaintTargetType) const;
+        virtual void teardown(GraphicsContext*&, const RenderObject*, SVGPaintTargetType) const;
+        virtual void renderPath(GraphicsContext*&, const RenderPath*, SVGPaintTargetType) const;
 
-        virtual bool setup(KRenderingDeviceContext*, const RenderObject*, SVGPaintTargetType) const;
+        virtual bool setup(GraphicsContext*&, const RenderObject*, SVGPaintTargetType) const;
 
         virtual void invalidate();
 
@@ -115,6 +115,8 @@ namespace WebCore {
 
         CGShadingRef m_shadingCache;
         mutable RefPtr<SVGResourceImage> m_maskImage;
+
+        mutable GraphicsContext* m_savedContext;
 #endif
     };
 
index 632037739cba9efa247fa3e0d2549c82829f7d7a..2599e4b369f165fbabf6aa83cbbd2fa7d2809116 100644 (file)
@@ -49,7 +49,7 @@ namespace WebCore {
         virtual TextStream& externalRepresentation(TextStream&) const;
 
 #if PLATFORM(QT)
-        virtual bool setup(KRenderingDeviceContext*, const RenderObject*, SVGPaintTargetType) const;
+        virtual bool setup(GraphicsContext*&, const RenderObject*, SVGPaintTargetType) const;
 #endif
 
     private:
index f5788480fa1be51b25011ead95a985faf6ae258c..3a7b631e8edd8594572731ea63c785ccec5ccac9 100644 (file)
@@ -64,12 +64,12 @@ namespace WebCore {
         virtual TextStream& externalRepresentation(TextStream&) const;
 
 #if PLATFORM(CG)
-        virtual bool setup(KRenderingDeviceContext*, const RenderObject*, SVGPaintTargetType) const;
-        virtual void teardown(KRenderingDeviceContext*, const RenderObject*, SVGPaintTargetType) const; 
+        virtual bool setup(GraphicsContext*&, const RenderObject*, SVGPaintTargetType) const;
+        virtual void teardown(GraphicsContext*&, const RenderObject*, SVGPaintTargetType) const; 
 #endif
 
 #if PLATFORM(QT)
-        virtual bool setup(KRenderingDeviceContext*, const RenderObject*, SVGPaintTargetType) const;
+        virtual bool setup(GraphicsContext*&, const RenderObject*, SVGPaintTargetType) const;
 #endif
 
     private:
index cdc9336099c348e939f24c0825ff5c6943f29f43..4bc327d64ba21c73cb46b2637e19b2e7d3f86125 100644 (file)
@@ -52,7 +52,7 @@ namespace WebCore {
         virtual TextStream& externalRepresentation(TextStream&) const;
 
 #if PLATFORM(QT)
-        virtual bool setup(KRenderingDeviceContext*, const RenderObject*, SVGPaintTargetType) const;
+        virtual bool setup(GraphicsContext*&, const RenderObject*, SVGPaintTargetType) const;
 #endif
 
     private:
index 3358b1e151beb341aeb52e0f438c9daf6d3c31c8..c1b66fbcf122043380d2d8ac7db37ed8f34b13d9 100644 (file)
@@ -46,7 +46,7 @@ namespace WebCore {
         virtual TextStream& externalRepresentation(TextStream&) const;
 
 #if PLATFORM(CG) || PLATFORM(QT)
-        virtual bool setup(KRenderingDeviceContext*, const RenderObject*, SVGPaintTargetType) const;
+        virtual bool setup(GraphicsContext*&, const RenderObject*, SVGPaintTargetType) const;
 #endif
 
     private:
index 14f23e310c69aaae750bf8b59a66aee97bcf4624..25597f0430e487168aff063b949e633e6b8cdd90 100644 (file)
@@ -66,16 +66,6 @@ const RenderPathList& SVGResource::clients() const
     return m_clients;
 }
 
-String SVGResource::idInRegistry() const
-{
-    return m_registryId;
-}
-
-void SVGResource::setIdInRegistry(const String& id)
-{
-    m_registryId = id;
-}
-
 TextStream& SVGResource::externalRepresentation(TextStream& ts) const
 {
     return ts;
index 700250a448e086fdaef27b14c3440b4f0e91a553..abfc33af8a61952c708f8112f6762eed40ddfe86 100644 (file)
@@ -69,9 +69,6 @@ namespace WebCore {
 
         const RenderPathList& clients() const;
 
-        String idInRegistry() const;
-        void setIdInRegistry(const String&);
-
         virtual bool isPaintServer() const { return false; }
         virtual bool isFilter() const { return false; }
         virtual bool isClipper() const { return false; }
@@ -81,7 +78,6 @@ namespace WebCore {
         virtual TextStream& externalRepresentation(TextStream&) const;
 
     private:
-        String m_registryId;
         RenderPathList m_clients;
     };
 
index be9d0721c9c501db781a4507af3994a967ad1a20..c100f161b840d5eaacbc0ab762b5c177c38eb303 100644 (file)
@@ -58,6 +58,8 @@ namespace WebCore {
         Vector<ClipData> m_clipData;
     };  
 
+    class GraphicsContext;
+
     class SVGResourceClipper : public SVGResource {
     public:
         SVGResourceClipper();
@@ -72,7 +74,7 @@ namespace WebCore {
         virtual TextStream& externalRepresentation(TextStream&) const;
 
         // To be implemented by the specific rendering devices
-        void applyClip(const FloatRect& boundingBox) const;
+        void applyClip(GraphicsContext*, const FloatRect& boundingBox) const;
 
     private:
         ClipDataList m_clipData;
index ce8fd940ed3168ccef1416e85410e1f5c8988d1c..4cce21175fb35720b96ef09c37e3bfcd59845176 100644 (file)
@@ -26,6 +26,7 @@
 
 #ifdef SVG_SUPPORT
 #include "SVGResource.h"
+#include "SVGFilterEffect.h"
 
 #include "FloatRect.h"
 
@@ -49,6 +50,7 @@ class NSMutableDictionary;
 
 namespace WebCore {
 
+class GraphicsContext;
 class SVGFilterEffect;
 
 class SVGResourceFilter : public SVGResource {
@@ -57,6 +59,8 @@ public:
     SVGResourceFilter();
     virtual ~SVGResourceFilter();
 
+    static SVGFilterEffect* createFilterEffect(const SVGFilterEffectType&);
+
     virtual bool isFilter() const { return true; }
 
     bool filterBoundingBoxMode() const { return m_filterBBoxMode; }
@@ -76,8 +80,8 @@ public:
     virtual TextStream& externalRepresentation(TextStream&) const;
 
     // To be implemented in platform specific code.
-    void prepareFilter(const FloatRect& bbox);
-    void applyFilter(const FloatRect& bbox);
+    void prepareFilter(GraphicsContext*&, const FloatRect& bbox);
+    void applyFilter(GraphicsContext*&, const FloatRect& bbox);
 
 #if PLATFORM(CI)
     CIImage* imageForName(const String&) const;
@@ -93,6 +97,7 @@ private:
 
     CIContext* m_filterCIContext;
     CGLayerRef m_filterCGLayer;
+    GraphicsContext* m_savedContext;
     NSMutableDictionary* m_imagesByName;
 #endif
 
index 8e18f59b0c1d7b8e18dd1fcc0ac41069d84fb744..0e58d30091cbe06f9b328e58badf9873deb2ce10 100644 (file)
@@ -33,6 +33,7 @@
 namespace WebCore {
 
     class FloatRect;
+    class GraphicsContext;
     class SVGResourceImage;
 
     class SVGResourceMasker : public SVGResource {
@@ -47,7 +48,7 @@ namespace WebCore {
         virtual TextStream& externalRepresentation(TextStream&) const;
 
         // To be implemented by the specific rendering devices
-        void applyMask(const FloatRect& boundingBox) const;
+        void applyMask(GraphicsContext*, const FloatRect& boundingBox) const;
 
     private:
         RefPtr<SVGResourceImage> m_mask;
similarity index 98%
rename from WebCore/kcanvas/device/quartz/QuartzSupport.cpp
rename to WebCore/platform/graphics/svg/cg/CgSupport.cpp
index 0ab837134909b2eeb0645cc690c120f1204cba55..36cfbf4be28b97d5d8a600b9b659e22b448153e4 100644 (file)
 #include "config.h"
 #ifdef SVG_SUPPORT
 #include <ApplicationServices/ApplicationServices.h>
-#include "QuartzSupport.h"
+#include "CgSupport.h"
 
 #include "GraphicsContext.h"
 #include "KCanvasRenderingStyle.h"
 #include "RenderStyle.h"
-#include "wtf/Assertions.h"
+#include <wtf/Assertions.h>
 #include "SVGRenderStyle.h"
 
 namespace WebCore {
similarity index 97%
rename from WebCore/kcanvas/device/quartz/QuartzSupport.h
rename to WebCore/platform/graphics/svg/cg/CgSupport.h
index f5d43ef192099bb534438ff9831a8da83d8c52e4..18046b4384db57621d7fea1da1e65b83259e48ab 100644 (file)
@@ -23,8 +23,8 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#ifndef QuartzSupport_H
-#define QuartzSupport_H
+#ifndef CgSupport_H
+#define CgSupport_H
 
 #ifdef SVG_SUPPORT
 
@@ -76,4 +76,4 @@ static inline CGLineJoin CGLineJoinFromKC(LineJoin join)
 }
 
 #endif // SVG_SUPPORT
-#endif // !QuartzSupport_H
+#endif // !CgSupport_H
similarity index 97%
rename from WebCore/kcanvas/device/quartz/KCanvasItemQuartz.cpp
rename to WebCore/platform/graphics/svg/cg/RenderPathCg.cpp
index 5b32292fa5db2c760cf33b8564f55a8a7fc1194b..dfe21234ebdb71e402d0ffeeaeadfb3b747a417d 100644 (file)
@@ -32,8 +32,7 @@
 
 #include <ApplicationServices/ApplicationServices.h>
 #include "KCanvasRenderingStyle.h"
-#include "KRenderingDeviceQuartz.h"
-#include "QuartzSupport.h"
+#include "CgSupport.h"
 #include "RenderPath.h"
 #include "SVGRenderStyle.h"
 #include "SVGStyledElement.h"
index 8af9e0a0e46460d0045caa5a236f045706eeb1c9..678f93f5f2a676148ef593b1eb030469b7cd889c 100644 (file)
 #ifdef SVG_SUPPORT
 #include "SVGPaintServer.h"
 
-#include "KRenderingDeviceQuartz.h"
+#include "GraphicsContext.h"
 #include "RenderPath.h"
 
 namespace WebCore {
 
-void SVGPaintServer::draw(KRenderingDeviceContext* context, const RenderPath* path, SVGPaintTargetType type) const
+void SVGPaintServer::draw(GraphicsContext*& context, const RenderPath* path, SVGPaintTargetType type) const
 {
     if (!setup(context, path, type))
         return;
@@ -38,17 +38,15 @@ void SVGPaintServer::draw(KRenderingDeviceContext* context, const RenderPath* pa
     teardown(context, path, type);
 }
 
-void SVGPaintServer::teardown(KRenderingDeviceContext*, const RenderObject*, SVGPaintTargetType) const
+void SVGPaintServer::teardown(GraphicsContext*&, const RenderObject*, SVGPaintTargetType) const
 {
     // no-op
 }
 
-void SVGPaintServer::renderPath(KRenderingDeviceContext* context, const RenderPath* path, SVGPaintTargetType type) const
+void SVGPaintServer::renderPath(GraphicsContext*& context, const RenderPath* path, SVGPaintTargetType type) const
 {
     RenderStyle* style = path->style();
-
-    KRenderingDeviceContextQuartz* quartzContext = static_cast<KRenderingDeviceContextQuartz*>(context);
-    CGContextRef contextRef = quartzContext->cgContext();
+    CGContextRef contextRef = context->platformContext();
 
     if ((type & ApplyToFillTargetType) && style->svgStyle()->hasFill())
         fillPath(contextRef, path);
index 15f2281c18950b3acc9b4eb4c84729664604e66f..3ab6b3f08dc79819a839c61656e659a6d7d661e1 100644 (file)
 #ifdef SVG_SUPPORT
 #include "SVGPaintServerGradient.h"
 
-#include "KRenderingDeviceQuartz.h"
+#include "GraphicsContext.h"
 #include "SVGPaintServerLinearGradient.h"
 #include "SVGPaintServerRadialGradient.h"
 #include "RenderPath.h"
-#include "QuartzSupport.h"
+#include "CgSupport.h"
 
 namespace WebCore {
 
@@ -167,11 +167,10 @@ void SVGPaintServerGradient::updateQuartzGradientCache(const SVGPaintServerGradi
     }
 }
 
-void SVGPaintServerGradient::teardown(KRenderingDeviceContext* context, const RenderObject* object, SVGPaintTargetType type) const
+void SVGPaintServerGradient::teardown(GraphicsContext*& context, const RenderObject* object, SVGPaintTargetType type) const
 {
     CGShadingRef shading = m_shadingCache;
-    KRenderingDeviceQuartz* quartzDevice = static_cast<KRenderingDeviceQuartz*>(renderingDevice());
-    CGContextRef contextRef = quartzDevice->currentCGContext();
+    CGContextRef contextRef = context->platformContext();
     RenderStyle* style = object->style();
     ASSERT(contextRef != NULL);
 
@@ -179,15 +178,19 @@ void SVGPaintServerGradient::teardown(KRenderingDeviceContext* context, const Re
         // workaround for filling the entire screen with the shading in the case that no text was intersected with the clip
         if (!isPaintingText() || (object->width() > 0 && object->height() > 0))
             CGContextDrawShading(contextRef, shading);
-        CGContextRestoreGState(contextRef);
+        CGContextRestoreGState(contextRef);        
     }
 
     if ((type & ApplyToStrokeTargetType) && style->svgStyle()->hasStroke()) {
         if (isPaintingText()) {
             int width  = 2048;
             int height = 2048; // FIXME??? SEE ABOVE
-            delete quartzDevice->popContext();
-            contextRef = quartzDevice->currentCGContext();
+
+            delete context;
+            context = m_savedContext;
+            contextRef = context->platformContext();
+            m_savedContext = 0;
+
             void* imageBuffer = fastMalloc(width * height);
             CGColorSpaceRef grayColorSpace = CGColorSpaceCreateDeviceGray();
             CGContextRef grayscaleContext = CGBitmapContextCreate(imageBuffer, width, height, 8, width, grayColorSpace, kCGImageAlphaNone);
@@ -199,16 +202,15 @@ void SVGPaintServerGradient::teardown(KRenderingDeviceContext* context, const Re
             CGImageRelease(grayscaleImage);
         }
         CGContextDrawShading(contextRef, shading);
-        CGContextRestoreGState(contextRef);
+        CGContextRestoreGState(contextRef);        
     }
 
     CGContextRestoreGState(contextRef);
 }
 
-void SVGPaintServerGradient::renderPath(KRenderingDeviceContext* context, const RenderPath* path, SVGPaintTargetType type) const
+void SVGPaintServerGradient::renderPath(GraphicsContext*& context, const RenderPath* path, SVGPaintTargetType type) const
 {
-    KRenderingDeviceQuartz* quartzDevice = static_cast<KRenderingDeviceQuartz*>(renderingDevice());
-    CGContextRef contextRef = quartzDevice->currentCGContext();
+    CGContextRef contextRef = context->platformContext();
     RenderStyle* style = path->style();
     ASSERT(contextRef != NULL);
 
@@ -233,7 +235,7 @@ void SVGPaintServerGradient::renderPath(KRenderingDeviceContext* context, const
     CGContextConcatCTM(contextRef, transform);
 }
 
-bool SVGPaintServerGradient::setup(KRenderingDeviceContext* context, const RenderObject* object, SVGPaintTargetType type) const
+bool SVGPaintServerGradient::setup(GraphicsContext*& context, const RenderObject* object, SVGPaintTargetType type) const
 {
     if (listener()) // this seems like bad design to me, should be in a common baseclass. -- ecs 8/6/05
         listener()->resourceNotification();
@@ -243,8 +245,7 @@ bool SVGPaintServerGradient::setup(KRenderingDeviceContext* context, const Rende
     if (!m_shadingCache)
         const_cast<SVGPaintServerGradient*>(this)->updateQuartzGradientCache(this);
 
-    KRenderingDeviceQuartz* quartzDevice = static_cast<KRenderingDeviceQuartz*>(renderingDevice());
-    CGContextRef contextRef = quartzDevice->currentCGContext();
+    CGContextRef contextRef = context->platformContext();
     RenderStyle* style = object->style();
     ASSERT(contextRef != NULL);
 
@@ -252,13 +253,13 @@ bool SVGPaintServerGradient::setup(KRenderingDeviceContext* context, const Rende
     CGContextSetAlpha(contextRef, style->opacity());
 
     if ((type & ApplyToFillTargetType) && style->svgStyle()->hasFill()) {
-        CGContextSaveGState(contextRef);
+        CGContextSaveGState(contextRef);        
         if (isPaintingText())
             CGContextSetTextDrawingMode(contextRef, kCGTextClip);
     }
 
     if ((type & ApplyToStrokeTargetType) && style->svgStyle()->hasStroke()) {
-        CGContextSaveGState(contextRef);
+        CGContextSaveGState(contextRef);        
         applyStrokeStyleToContext(contextRef, style, object); // FIXME: this seems like the wrong place for this.
         if (isPaintingText()) {
             m_maskImage = new SVGResourceImage();
@@ -266,11 +267,14 @@ bool SVGPaintServerGradient::setup(KRenderingDeviceContext* context, const Rende
             int height = 2048; // FIXME???
             IntSize size = IntSize(width, height);
             m_maskImage->init(size);
-            KRenderingDeviceContext* maskImageContext = quartzDevice->contextForImage(m_maskImage.get());
-            quartzDevice->pushContext(maskImageContext);
-            CGContextRef maskContext = static_cast<KRenderingDeviceContextQuartz*>(maskImageContext)->cgContext();
+
+            GraphicsContext* maskImageContext = contextForImage(m_maskImage.get());
+            CGContextRef maskContext = maskImageContext->platformContext();
             const_cast<RenderObject*>(object)->style()->setColor(Color(255, 255, 255));
             CGContextSetTextDrawingMode(maskContext, kCGTextStroke);
+
+            m_savedContext = context;
+            context = maskImageContext;
         }
     }
 
index 2ec27b1eca243725b52b9c500da84bbce311421e..a0d5cfe2e37cfafc3755576e9902cdde2aa94a67 100644 (file)
 #ifdef SVG_SUPPORT
 #include "SVGPaintServerPattern.h"
 
-#include "KRenderingDeviceQuartz.h"
+#include "GraphicsContext.h"
 #include "RenderObject.h"
 #include "SVGResourceImage.h"
-#include "QuartzSupport.h"
+#include "CgSupport.h"
 
 namespace WebCore {
 
@@ -37,15 +37,14 @@ static void patternCallback(void* info, CGContextRef context)
     CGContextDrawLayerAtPoint(context, CGPointZero, layer);
 }
 
-bool SVGPaintServerPattern::setup(KRenderingDeviceContext* context, const RenderObject* object, SVGPaintTargetType type) const
+bool SVGPaintServerPattern::setup(GraphicsContext*& context, const RenderObject* object, SVGPaintTargetType type) const
 {
     if(listener()) // this seems like bad design to me, should be in a common baseclass. -- ecs 8/6/05
         listener()->resourceNotification();
 
     RenderStyle* style = object->style();
 
-    KRenderingDeviceContextQuartz* quartzContext = static_cast<KRenderingDeviceContextQuartz*>(context);
-    CGContextRef contextRef = quartzContext->cgContext();
+    CGContextRef contextRef = context->platformContext();
 
     RefPtr<SVGResourceImage> cell = tile();
     if (!cell)
@@ -102,10 +101,9 @@ bool SVGPaintServerPattern::setup(KRenderingDeviceContext* context, const Render
     return true;
 }
 
-void SVGPaintServerPattern::teardown(KRenderingDeviceContext* context, const RenderObject* object, SVGPaintTargetType type) const
+void SVGPaintServerPattern::teardown(GraphicsContext*& context, const RenderObject* object, SVGPaintTargetType type) const
 {
-    KRenderingDeviceContextQuartz* quartzContext = static_cast<KRenderingDeviceContextQuartz*>(context);
-    CGContextRef contextRef = quartzContext->cgContext();
+    CGContextRef contextRef = context->platformContext();
     CGPatternRelease(m_pattern);
     CGColorSpaceRelease(m_patternSpace);
     CGContextRestoreGState(contextRef);
index e62a9532f13006a7f8ffa2d89b1692c7d857a481..ba60a9e85fda2c8832e8e2902c112e8969a66677 100644 (file)
 #ifdef SVG_SUPPORT
 #include "SVGPaintServerSolid.h"
 
+#include "GraphicsContext.h"
 #include "RenderObject.h"
-#include "KRenderingDeviceQuartz.h"
-#include "QuartzSupport.h"
+#include "CgSupport.h"
 
 namespace WebCore {
 
-bool SVGPaintServerSolid::setup(KRenderingDeviceContext* context, const RenderObject* object, SVGPaintTargetType type) const
+bool SVGPaintServerSolid::setup(GraphicsContext*& context, const RenderObject* object, SVGPaintTargetType type) const
 {
-    KRenderingDeviceContextQuartz* quartzContext = static_cast<KRenderingDeviceContextQuartz*>(context);
-    CGContextRef contextRef = quartzContext->cgContext();
+    CGContextRef contextRef = context->platformContext();
     RenderStyle* style = object->style();
 
     CGContextSetAlpha(contextRef, style->opacity());
index faed770b7ecbe083ce8b50c3e9ed3baccfe3baf0..ecb0fe5c91fe798819198b7248ce510083ba7e81 100644 (file)
 #include "SVGResourceClipper.h"
 
 #include "GraphicsContext.h"
-#include "KRenderingDeviceQuartz.h"
-#include "QuartzSupport.h"
+#include "CgSupport.h"
 
 namespace WebCore {
 
-void SVGResourceClipper::applyClip(const FloatRect& boundingBox) const
+void SVGResourceClipper::applyClip(GraphicsContext* context, const FloatRect& boundingBox) const
 {
-    KRenderingDeviceContext* context = renderingDevice()->currentContext();
-    CGContextRef cgContext = static_cast<KRenderingDeviceContextQuartz*>(context)->cgContext();
+    CGContextRef cgContext = context->platformContext();
     if (m_clipData.clipData().size() < 1)
         return;
 
     bool heterogenousClipRules = false;
     WindRule clipRule = m_clipData.clipData()[0].windRule;
 
-    context->clearPath();
+    context->beginPath();
 
     CGAffineTransform bboxTransform = CGAffineTransformMakeMapBetweenRects(CGRectMake(0,0,1,1), CGRect(boundingBox));
 
index 05255230bd0298fe70c4e1a64209a4dcc2fda80c..129cd4a19bc31884d2f336df0ecae66378af9da6 100644 (file)
 #ifdef SVG_SUPPORT
 #include "AffineTransform.h"
 #include "FoundationExtras.h"
-#include "KRenderingDeviceQuartz.h"
+#include "GraphicsContext.h"
 #include "SVGResourceFilter.h"
 
+#include "SVGFEBlend.h"
+#include "SVGFEColorMatrix.h"
+#include "SVGFEComponentTransfer.h"
+#include "SVGFEComposite.h"
+#include "SVGFEDiffuseLighting.h"
+#include "SVGFEDisplacementMap.h"
+#include "SVGFEFlood.h"
+#include "SVGFEGaussianBlur.h"
+#include "SVGFEImage.h"
+#include "SVGFEMerge.h"
+#include "SVGFEOffset.h"
+#include "SVGFESpecularLighting.h"
+#include "SVGFETile.h"
+
 #include <QuartzCore/CoreImage.h>
 
 namespace WebCore {
@@ -40,6 +54,7 @@ static const char* const SVGPreviousFilterOutputName = "__previousOutput__";
 SVGResourceFilter::SVGResourceFilter()
     : m_filterCIContext(0)
     , m_filterCGLayer(0)
+    , m_savedContext(0)
 {
     m_imagesByName = HardRetainWithNSRelease([[NSMutableDictionary alloc] init]);
 }
@@ -51,19 +66,42 @@ SVGResourceFilter::~SVGResourceFilter()
     HardRelease(m_imagesByName);
 }
 
-void SVGResourceFilter::prepareFilter(const FloatRect &bbox)
+SVGFilterEffect* SVGResourceFilter::createFilterEffect(const SVGFilterEffectType& type)
 {
-    if (bbox.isEmpty() || !KRenderingDeviceQuartz::filtersEnabled() || m_effects.isEmpty())
-        return;
-
-    CGContextRef cgContext = static_cast<KRenderingDeviceQuartz*>(renderingDevice())->currentCGContext();
+    switch(type)
+    {
+    /* Light sources are contained by the diffuse/specular light blocks 
+    case FE_DISTANT_LIGHT: 
+    case FE_POINT_LIGHT: 
+    case FE_SPOT_LIGHT: 
+    */
+    case FE_BLEND: return new SVGFEBlend();
+    case FE_COLOR_MATRIX: return new SVGFEColorMatrix();
+    case FE_COMPONENT_TRANSFER: return new SVGFEComponentTransfer();
+    case FE_COMPOSITE: return new SVGFEComposite();
+//  case FE_CONVOLVE_MATRIX:
+    case FE_DIFFUSE_LIGHTING: return new SVGFEDiffuseLighting();
+    case FE_DISPLACEMENT_MAP: return new SVGFEDisplacementMap();
+    case FE_FLOOD: return new SVGFEFlood();
+    case FE_GAUSSIAN_BLUR: return new SVGFEGaussianBlur();
+    case FE_IMAGE: return new SVGFEImage();
+    case FE_MERGE: return new SVGFEMerge();
+//  case FE_MORPHOLOGY:
+    case FE_OFFSET: return new SVGFEOffset();
+    case FE_SPECULAR_LIGHTING: return new SVGFESpecularLighting();
+    case FE_TILE: return new SVGFETile();
+//  case FE_TURBULENCE:
+    default:
+        return 0;
+    }
+}
 
-    // get a CIContext, and CGLayer for drawing in.
-    bool useSoftware = ! KRenderingDeviceQuartz::hardwareRenderingEnabled();
-    NSDictionary *contextOptions = nil;
+void SVGResourceFilter::prepareFilter(GraphicsContext*& context, const FloatRect& bbox)
+{
+    if (bbox.isEmpty() || m_effects.isEmpty())
+        return;
 
-    if (useSoftware)
-        contextOptions = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], kCIContextUseSoftwareRenderer, nil];
+    CGContextRef cgContext = context->platformContext();
 
     // Use of CGBegin/EndTransparencyLayer around this call causes over release
     // of cgContext due to it being created on an autorelease pool, and released
@@ -71,31 +109,28 @@ void SVGResourceFilter::prepareFilter(const FloatRect &bbox)
     // <http://bugs.webkit.org/show_bug.cgi?id=8425>
     // <http://bugs.webkit.org/show_bug.cgi?id=6947>
     // <rdar://problem/4647735>
-    NSAutoreleasePool *filterContextPool = [[NSAutoreleasePool alloc] init];
-    m_filterCIContext = HardRetain([CIContext contextWithCGContext:cgContext options:contextOptions]);
+    NSAutoreleasePoolfilterContextPool = [[NSAutoreleasePool alloc] init];
+    m_filterCIContext = HardRetain([CIContext contextWithCGContext:cgContext options:nil]);
     [filterContextPool drain];
 
     m_filterCGLayer = [m_filterCIContext createCGLayerWithSize:CGRect(bbox).size info:NULL];
+    m_savedContext = context;
 
-    KRenderingDeviceContext* filterContext = new KRenderingDeviceContextQuartz(CGLayerGetContext(m_filterCGLayer));
-    renderingDevice()->pushContext(filterContext);
-
-    filterContext->concatCTM(AffineTransform().translate(-1.0f * bbox.x(), -1.0f * bbox.y()));
+    context = new GraphicsContext(CGLayerGetContext(m_filterCGLayer));
+    context->save();
+    context->concatCTM(AffineTransform().translate(-1.0f * bbox.x(), -1.0f * bbox.y()));
 }
 
-void SVGResourceFilter::applyFilter(const FloatRect &bbox)
+void SVGResourceFilter::applyFilter(GraphicsContext*& context, const FloatRect& bbox)
 {
-    if (bbox.isEmpty() || !KRenderingDeviceQuartz::filtersEnabled() || m_effects.isEmpty())
+    if (bbox.isEmpty() || m_effects.isEmpty())
         return;
 
-    // restore the previous context, delete the filter context.
-    delete (renderingDevice()->popContext());
-
     // actually apply the filter effects
-    CIImage *inputImage = [CIImage imageWithCGLayer:m_filterCGLayer];
-    NSArray *filterStack = getCIFilterStack(inputImage);
+    CIImageinputImage = [CIImage imageWithCGLayer:m_filterCGLayer];
+    NSArrayfilterStack = getCIFilterStack(inputImage);
     if ([filterStack count]) {
-        CIImage *outputImage = [[filterStack lastObject] valueForKey:@"outputImage"];
+        CIImageoutputImage = [[filterStack lastObject] valueForKey:@"outputImage"];
         if (outputImage) {
             CGRect filterRect = CGRect(filterBBoxForItemBBox(bbox));
             CGRect translated = filterRect;
@@ -115,6 +150,10 @@ void SVGResourceFilter::applyFilter(const FloatRect &bbox)
 
     HardRelease(m_filterCIContext);
     m_filterCIContext = 0;
+
+    delete context;
+    context = m_savedContext;
+    m_savedContext = 0;
 }
 
 NSArray* SVGResourceFilter::getCIFilterStack(CIImage* inputImage)
index 46680571916412f62b9b3a89eda6e7ae660f9b0d..4d8327509ca8244a4bb47473e07b4707228e506d 100644 (file)
@@ -23,7 +23,6 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-
 #include "config.h"
 
 #ifdef SVG_SUPPORT
@@ -32,8 +31,8 @@
 #import "SVGResourceImage.h"
 #import "SVGRenderStyle.h"
 
-#import "KRenderingDeviceQuartz.h"
-#import "QuartzSupport.h"
+#import "GraphicsContext.h"
+#import "CgSupport.h"
 
 #import <QuartzCore/CoreImage.h>
 #import <QuartzCore/CIFilter.h>
@@ -88,7 +87,7 @@ static CIImage* transformImageIntoGrayscaleMask(CIImage* inputImage)
     return [multipliedGrayscale valueForKey:@"outputImage"];
 }
 
-void SVGResourceMasker::applyMask(const FloatRect& boundingBox) const
+void SVGResourceMasker::applyMask(GraphicsContext* context, const FloatRect& boundingBox) const
 {
     if (!m_mask)
         return;
@@ -106,9 +105,9 @@ void SVGResourceMasker::applyMask(const FloatRect& boundingBox) const
     [ciGrayscaleContext drawImage:grayscaleMask atPoint:CGPointZero fromRect:CGRectMake(0, 0, width, height)];
 
     CGImageRef grayscaleImage = CGBitmapContextCreateImage(grayscaleContext);
-    CGContextRef cgContext = static_cast<KRenderingDeviceQuartz*>(renderingDevice())->currentCGContext();
+    CGContextRef cgContext = context->platformContext();
     CGContextClipToMask(cgContext, CGRectMake(0, 0, width, height), grayscaleImage);
-    
+
     CGImageRelease(grayscaleImage);
     CGContextRelease(grayscaleContext);
     fastFree(imageBuffer);
index da8437f928fc2206b52137a266c85a2324fb0937..0ccd1eb103e27453fd900a6033ce2a272aaba214 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "Image.h"
 #include "SVGFEHelpersCg.h"
-#include "QuartzSupport.h"
+#include "CgSupport.h"
 
 namespace WebCore {
 
index dd9ce3f22bb5ff07295f0187a0f83c0630e4b479..10e4960409b4067302a4de21ccc34193bc1d1c15 100644 (file)
 #ifdef SVG_SUPPORT
 #include "SVGPaintServerLinearGradient.h"
 
-#include "KRenderingDeviceQt.h"
+#include "GraphicsContext.h"
 #include "RenderPath.h"
 
 #include <QLinearGradient>
+#include <QPainter>
+#include <QPainterPath>
 
 namespace WebCore {
 
-bool SVGPaintServerLinearGradient::setup(KRenderingDeviceContext* context, const RenderObject* object, SVGPaintTargetType type) const
+bool SVGPaintServerLinearGradient::setup(GraphicsContext*& context, const RenderObject* object, SVGPaintTargetType type) const
 {
-    KRenderingDeviceContextQt* qtContext = static_cast<KRenderingDeviceContextQt*>(context);
-    Q_ASSERT(qtContext != 0);
+    QPainter* painter(context ? context->platformContext() : 0);
+    Q_ASSERT(painter);
+
+    QPainterPath* path(context ? context->currentPath() : 0);
+    Q_ASSERT(path);
 
     if (listener())
         listener()->resourceNotification();
@@ -43,7 +48,7 @@ bool SVGPaintServerLinearGradient::setup(KRenderingDeviceContext* context, const
 
     double x1, x2, y1, y2;
     if (boundingBoxMode()) {
-        QRectF bbox = qtContext->pathBBox();
+        QRectF bbox = path->boundingRect();
         x1 = double(bbox.left()) + (double(gradientStart().x() / 100.0) * double(bbox.width()));
         y1 = double(bbox.top()) + (double(gradientStart().y() / 100.0) * double(bbox.height()));
         x2 = double(bbox.left()) + (double(gradientEnd().x() / 100.0)  * double(bbox.width()));
@@ -55,8 +60,8 @@ bool SVGPaintServerLinearGradient::setup(KRenderingDeviceContext* context, const
         y2 = gradientEnd().y();
     }
 
-    qtContext->painter().setPen(Qt::NoPen);
-    qtContext->painter().setBrush(Qt::NoBrush);
+    painter->setPen(Qt::NoPen);
+    painter->setBrush(Qt::NoBrush);
 
     QLinearGradient gradient(QPointF(x1, y1), QPointF(x2, y2));
     if (spreadMethod() == SPREADMETHOD_REPEAT)
@@ -75,8 +80,8 @@ bool SVGPaintServerLinearGradient::setup(KRenderingDeviceContext* context, const
 
         QBrush brush(gradient);
 
-        qtContext->painter().setBrush(brush);
-        qtContext->setFillRule(renderStyle->svgStyle()->fillRule());
+        painter->setBrush(brush);
+        context->setFillRule(renderStyle->svgStyle()->fillRule());
     }
 
     if ((type & ApplyToStrokeTargetType) && renderStyle->svgStyle()->hasStroke()) {
@@ -88,7 +93,7 @@ bool SVGPaintServerLinearGradient::setup(KRenderingDeviceContext* context, const
         setPenProperties(object, renderStyle, pen);
         pen.setBrush(brush);
 
-        qtContext->painter().setPen(pen);
+        painter->setPen(pen);
     }
 
     return true;
index ac70ef3876639f69a3818ca6519b003ca41f28b5..4c0b1daccd44dfdf836256213a2ddf68f9e50d8f 100644 (file)
 
 namespace WebCore {
 
-bool SVGPaintServerPattern::setup(KRenderingDeviceContext* context, const RenderObject* object, SVGPaintTargetType type) const
+bool SVGPaintServerPattern::setup(GraphicsContext*& context, const RenderObject* object, SVGPaintTargetType type) const
 {
     // FIXME: Reactivate old pattern code
 
 /*
-    KRenderingDeviceContextQt* qtContext = static_cast<KRenderingDeviceContextQt*>(context);
-    Q_ASSERT(qtContext != 0);
+    QPainter* painter(context ? context->platformContext() : 0);
+    Q_ASSERT(painter);
 
     QPainterPath* _path = static_cast<QPainterPath*>(qtContext->path());
     Q_ASSERT(_path != 0);
@@ -43,8 +43,8 @@ bool SVGPaintServerPattern::setup(KRenderingDeviceContext* context, const Render
 
     RenderStyle* renderStyle = object->style();
 
-    qtContext->painter().setPen(Qt::NoPen);
-    qtContext->painter().setBrush(Qt::NoBrush);
+    painter->setPen(Qt::NoPen);
+    painter->setBrush(Qt::NoBrush);
     QImage* patternimage = new QImage(tile()->bits(), tile()->width(), tile()->height(), QImage::Format_ARGB32_Premultiplied);
     patternimage->setAlphaBuffer(true);
     if (type & APPLY_TO_FILL) {
@@ -53,7 +53,7 @@ bool SVGPaintServerPattern::setup(KRenderingDeviceContext* context, const Render
         KRenderingFillPainter fillPainter = KSVGPainterFactory::fillPainter(renderStyle, object);
         QBrush brush(QPixmap::fromImage(*patternimage));
         _path->setFillRule(fillPainter.fillRule() == RULE_EVENODD ? Qt::OddEvenFill : Qt::WindingFill);
-        qtContext->painter().setBrush(brush);
+        painter->setBrush(brush);
     }
     if (type & APPLY_TO_STROKE) {
         //QColor c = color();
@@ -65,10 +65,10 @@ bool SVGPaintServerPattern::setup(KRenderingDeviceContext* context, const Render
 
         setPenProperties(strokePainter, pen);
         pen.setBrush(brush);
-        qtContext->painter().setPen(pen);
+        painter->setPen(pen);
     }
 
-    qtContext->painter().drawPath(*_path);
+    painter->drawPath(*_path);
 
     delete patternimage;
 */
index 29fff047e0871636acd1e2e54fdc77aac3c70855..92ae0d04de399236be1153de6a1cef3ef9737bb8 100644 (file)
 #ifdef SVG_SUPPORT
 #include "SVGPaintServer.h"
 
+#include "GraphicsContext.h"
 #include "KCanvasRenderingStyle.h"
-#include "KRenderingDeviceQt.h"
 #include "RenderPath.h"
 
-#include <QPen>
+#include <QPainter>
 #include <QVector>
 
 namespace WebCore {
@@ -66,7 +66,7 @@ void SVGPaintServer::setPenProperties(const RenderObject* object, const RenderSt
     }
 }
 
-void SVGPaintServer::draw(KRenderingDeviceContext* context, const RenderPath* path, SVGPaintTargetType type) const
+void SVGPaintServer::draw(GraphicsContext*& context, const RenderPath* path, SVGPaintTargetType type) const
 {
     if (!setup(context, path, type))
         return;
@@ -75,21 +75,26 @@ void SVGPaintServer::draw(KRenderingDeviceContext* context, const RenderPath* pa
     teardown(context, path, type);
 }
 
-void SVGPaintServer::teardown(KRenderingDeviceContext*, const RenderObject*, SVGPaintTargetType) const
+void SVGPaintServer::teardown(GraphicsContext*&, const RenderObject*, SVGPaintTargetType) const
 {
     // no-op
 }
 
-void SVGPaintServer::renderPath(KRenderingDeviceContext* context, const RenderPath* path, SVGPaintTargetType type) const
+void SVGPaintServer::renderPath(GraphicsContext*& context, const RenderPath* path, SVGPaintTargetType type) const
 {
     RenderStyle* renderStyle = path->style();
-    KRenderingDeviceContextQt* qtContext = static_cast<KRenderingDeviceContextQt*>(context);
+
+    QPainter* painter(context ? context->platformContext() : 0);
+    Q_ASSERT(painter);
+
+    QPainterPath* painterPath(context ? context->currentPath() : 0);
+    Q_ASSERT(painterPath);
 
     if ((type & ApplyToFillTargetType) && renderStyle->svgStyle()->hasFill())
-        qtContext->fillPath();
+        painter->fillPath(*painterPath, painter->brush());
 
     if ((type & ApplyToStrokeTargetType) && renderStyle->svgStyle()->hasStroke())
-        qtContext->strokePath();
+        painter->strokePath(*painterPath, painter->pen());
 }
 
 } // namespace WebCore
index 4193adfae98dc7bbb8fd60bafdc0704ab81703e8..5cd38d613623c5f775375f2116fca977849f6f64 100644 (file)
 #ifdef SVG_SUPPORT
 #include "SVGPaintServerRadialGradient.h"
 
-#include "KRenderingDeviceQt.h"
+#include "GraphicsContext.h"
 #include "RenderPath.h"
 
 #include <math.h>
+#include <QPainter>
+#include <QPainterPath>
 #include <QRadialGradient>
 
 namespace WebCore {
 
-bool SVGPaintServerRadialGradient:: setup(KRenderingDeviceContext* context, const RenderObject* object, SVGPaintTargetType type) const
+bool SVGPaintServerRadialGradient:: setup(GraphicsContext*& context, const RenderObject* object, SVGPaintTargetType type) const
 {
-    KRenderingDeviceContextQt* qtContext = static_cast<KRenderingDeviceContextQt*>(context);
-    Q_ASSERT(qtContext != 0);
+    QPainter* painter(context ? context->platformContext() : 0);
+    Q_ASSERT(painter);
+
+    QPainterPath* path(context ? context->currentPath() : 0);
+    Q_ASSERT(path);
 
     if (listener())
         listener()->resourceNotification();
 
     RenderStyle* renderStyle = object->style();
 
-    qtContext->painter().setPen(Qt::NoPen);
-    qtContext->painter().setBrush(Qt::NoBrush);
-    QMatrix mat = qtContext->ctm();
+    painter->setPen(Qt::NoPen);
+    painter->setBrush(Qt::NoBrush);
+    QMatrix mat = painter->matrix();
 
     double cx, fx, cy, fy, r;
     if (boundingBoxMode()) {
-        QRectF bbox = qtContext->pathBBox();
+        QRectF bbox = path->boundingRect(); 
         cx = double(bbox.left()) + (double(gradientCenter().x() / 100.0) * double(bbox.width()));
         cy = double(bbox.top()) + (double(gradientCenter().y() / 100.0) * double(bbox.height()));
         fx = double(bbox.left()) + (double(gradientFocal().x() / 100.0) * double(bbox.width())) - cx;
@@ -100,15 +105,15 @@ bool SVGPaintServerRadialGradient:: setup(KRenderingDeviceContext* context, cons
 
     // AffineTransform gradientTrans = gradientTransform();
     // gradientTrans.map(cx, cy, &cx, &cy);
-    // qtContext->painter().setMatrix(mat);
+    // painter->setMatrix(mat);
 
     if ((type & ApplyToFillTargetType) && renderStyle->svgStyle()->hasFill()) {
         fillColorArray(gradient, gradientStops(), opacity);
 
         QBrush brush(gradient);
 
-        qtContext->painter().setBrush(brush);
-        qtContext->setFillRule(renderStyle->svgStyle()->fillRule());
+        painter->setBrush(brush);
+        context->setFillRule(renderStyle->svgStyle()->fillRule());
     }
 
     if ((type & ApplyToStrokeTargetType) && renderStyle->svgStyle()->hasStroke()) {
@@ -120,7 +125,7 @@ bool SVGPaintServerRadialGradient:: setup(KRenderingDeviceContext* context, cons
         setPenProperties(object, renderStyle, pen);
         pen.setBrush(brush);
 
-        qtContext->painter().setPen(pen);
+        painter->setPen(pen);
     }
 
     return true;
index 46cbf1746f3df33f6a87e2d53cc4c4b7e70126cf..7128741a6496879d2fbe821bf22644ba3fa3546c 100644 (file)
 #ifdef SVG_SUPPORT
 #include "SVGPaintServerSolid.h"
 
-#include "KRenderingDeviceQt.h"
+#include "GraphicsContext.h"
 #include "RenderPath.h"
 
+#include <QPainter>
+
 namespace WebCore {
 
-bool SVGPaintServerSolid::setup(KRenderingDeviceContext* context, const RenderObject* object, SVGPaintTargetType type) const
+bool SVGPaintServerSolid::setup(GraphicsContext*& context, const RenderObject* object, SVGPaintTargetType type) const
 {
-    KRenderingDeviceContextQt* qtContext = static_cast<KRenderingDeviceContextQt*>(context);
+    QPainter* painter(context ? context->platformContext() : 0);
+    Q_ASSERT(painter);
 
     RenderStyle* renderStyle = object->style();
-    // TODO? qtContext->painter().setOpacity(renderStyle->opacity());
+    // TODO? painter->setOpacity(renderStyle->opacity());
 
     QColor c = color();
 
@@ -42,8 +45,8 @@ bool SVGPaintServerSolid::setup(KRenderingDeviceContext* context, const RenderOb
         c.setAlphaF(renderStyle->svgStyle()->fillOpacity());
 
         QBrush brush(c);
-        qtContext->painter().setBrush(brush);
-        qtContext->setFillRule(renderStyle->svgStyle()->fillRule());
+        painter->setBrush(brush);
+        context->setFillRule(renderStyle->svgStyle()->fillRule());
 
         /* if(isPaintingText()) ... */
     }
@@ -53,7 +56,7 @@ bool SVGPaintServerSolid::setup(KRenderingDeviceContext* context, const RenderOb
 
         QPen pen(c);
         setPenProperties(object, renderStyle, pen);
-        qtContext->painter().setPen(pen);
+        painter->setPen(pen);
 
         /* if(isPaintingText()) ... */
     }
index 1faa1ded7321168bc9c8bb05a64b38432ae0490b..90c9a34e3eb9d9faabdfd557a40f901062287106 100644 (file)
 */
 
 #include "config.h"
-#include "SVGResourceClipper.h"
 
 #ifdef SVG_SUPPORT
+#include "SVGResourceClipper.h"
 
-#include "KRenderingDeviceQt.h"
+#include "GraphicsContext.h"
+
+#include <QPainter>
+#include <QPainterPath>
 
 namespace WebCore {
 
-void SVGResourceClipper::applyClip(const FloatRect& boundingBox) const
+void SVGResourceClipper::applyClip(GraphicsContext* context, const FloatRect& boundingBox) const
 {
-    KRenderingDeviceContext* context = renderingDevice()->currentContext();
-    KRenderingDeviceContextQt* qtContext = static_cast<KRenderingDeviceContextQt*>(context);
     if (m_clipData.clipData().size() < 1)
         return;
 
-    context->clearPath();
+    context->beginPath();
 
     QPainterPath newPath;
 
@@ -113,7 +114,10 @@ void SVGResourceClipper::applyClip(const FloatRect& boundingBox) const
         // }
     }
 
-    qtContext->painter().setClipPath(newPath);
+    QPainter* painter(context ? context->platformContext() : 0);
+    Q_ASSERT(painter);
+
+    painter->setClipPath(newPath);
 }
 
 } // namespace WebCore
index 501f2b989daeb0e185a180290dadd0e1fc4cf3bc..fa5c5a9e90c7345149050e98086784a42df2d3f5 100644 (file)
@@ -20,9 +20,9 @@
 */
 
 #include "config.h"
-#include "SVGResourceFilter.h"
 
 #ifdef SVG_SUPPORT
+#include "SVGResourceFilter.h"
 
 namespace WebCore {
 
@@ -34,12 +34,18 @@ SVGResourceFilter::~SVGResourceFilter()
 {
 }
 
-void SVGResourceFilter::prepareFilter(const FloatRect& bbox)
+SVGFilterEffect* SVGResourceFilter::createFilterEffect(const SVGFilterEffectType&)
+{
+    // FIXME: implement me :-)
+    return 0;
+}
+
+void SVGResourceFilter::prepareFilter(GraphicsContext*&, const FloatRect&)
 {
     // FIXME: implement me :-)
 }
 
-void SVGResourceFilter::applyFilter(const FloatRect& bbox)
+void SVGResourceFilter::applyFilter(GraphicsContext*&, const FloatRect&)
 {
     // FIXME: implement me :-)
 }
index f56ac96ec3a321f1633f4fa4ef6634a035003f6d..6c5c033b443b3d0375cb367befb24228bfcc7e8e 100644 (file)
 */
 
 #include "config.h"
-#include "SVGResourceMasker.h"
 
 #ifdef SVG_SUPPORT
+#include "SVGResourceMasker.h"
 
 namespace WebCore {
 
-void SVGResourceMasker::applyMask(const FloatRect& boundingBox) const
+void SVGResourceMasker::applyMask(GraphicsContext*, const FloatRect&) const
 {
     // FIXME: implement me :-)
 }
index a2a1ca3cb56f8a006c81fd72c307119d856f68dc..9f73bcd647dcdf030a22a2d03e404b3c88702413 100644 (file)
@@ -25,6 +25,7 @@
 
 #import "config.h"
 #import "GraphicsContext.h"
+#import "SVGResourceImage.h"
 
 #import "../graphics/cg/GraphicsContextPlatformPrivate.h"
 
@@ -178,4 +179,24 @@ void GraphicsContext::drawLineForMisspellingOrBadGrammar(const IntPoint& point,
     CGContextRestoreGState(context);
 }
 
+GraphicsContext* contextForImage(SVGResourceImage* image)
+{
+    CGLayerRef cgLayer = image->cgLayer();
+
+    // FIXME: Using currentContext / graphicsPort here is a TOTAL hack. See SVGMaskElement comment for a possible solution!
+    CGContextRef currentContext = (CGContextRef) [[NSGraphicsContext currentContext] graphicsPort];
+
+    if (!cgLayer) {
+        ASSERT(currentContext);
+
+        // FIXME: we might not get back a layer if this is a loaded image
+        // maybe this logic should go into SVGResourceImage?
+        cgLayer = CGLayerCreateWithContext(currentContext, CGSize(image->size() + IntSize(1,1)), NULL);  // FIXME + 1 is a hack
+        // FIXME: we should composite the original image onto the layer...
+        image->setCGLayer(cgLayer);
+        CGLayerRelease(cgLayer);
+    }
+    return new GraphicsContext(CGLayerGetContext(cgLayer));
+}
+
 }
index 66dd4886f33eb9590d3ad7acffd7e2ed8f55d953..a8a4d62cc6fb3672324c7bd4b0167312beda9332 100644 (file)
 #define M_PI 3.14159265358979323846
 #endif
 
-#ifdef SVG_SUPPORT
-#include "KRenderingDeviceQt.h"
-#endif
-
 #define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d\n", __FILE__, __LINE__); } while(0)
 
 namespace WebCore {
@@ -220,6 +216,9 @@ public:
     IntRect focusRingClip;
     TextShadow shadow;
 
+    // Only used by SVG for now.
+    QPainterPath currentPath;
+
 private:
     QPainter* painter;
 };
@@ -487,6 +486,26 @@ void GraphicsContext::fillRect(const FloatRect& rect, const Color& c)
     m_data->p().fillRect(rect, QColor(c));
 }
 
+void GraphicsContext::beginPath()
+{
+    m_data->currentPath = QPainterPath();
+}
+
+void GraphicsContext::addPath(const Path& path)
+{
+    m_data->currentPath = *(path.platformPath());
+}
+
+void GraphicsContext::setFillRule(WindRule rule)
+{
+    m_data->currentPath.setFillRule(rule == RULE_EVENODD ? Qt::OddEvenFill : Qt::WindingFill);
+}
+
+PlatformPath* GraphicsContext::currentPath()
+{
+    return &m_data->currentPath;
+}
+
 void GraphicsContext::clip(const IntRect& rect)
 {
     if (paintingDisabled())
@@ -612,7 +631,8 @@ void GraphicsContext::strokeRect(const FloatRect& rect, float width)
     if (paintingDisabled())
         return;
 
-    QPainterPath path; path.addRect(rect);
+    QPainterPath path;
+    path.addRect(rect);
     QPen nPen = m_data->p().pen();
     nPen.setWidthF(width);
     m_data->p().strokePath(path, nPen);
@@ -830,13 +850,10 @@ void GraphicsContext::setPlatformFillColor(const Color& color)
     m_data->p().setBrush(QBrush(color));
 }
 
-#ifdef SVG_SUPPORT
-KRenderingDeviceContext* GraphicsContext::createRenderingDeviceContext()
+GraphicsContext* contextForImage(SVGResourceImage*)
 {
-    return new KRenderingDeviceContextQt(platformContext());
-}
-#endif
-
+    // FIXME!
+    return 0;
 }
 
 // vim: ts=4 sw=4 et
index 1bb17d37004a03afa962d912ccafd7b692c9a0c7..d6403bbc9fdf5ea5b04a738672da7ac23a5c97b4 100644 (file)
@@ -27,7 +27,6 @@
 #include "RenderForeignObject.h"
 
 #include "GraphicsContext.h"
-#include "KRenderingDevice.h"
 #include "SVGForeignObjectElement.h"
 #include "SVGLength.h"
 
@@ -49,22 +48,10 @@ void RenderForeignObject::paint(PaintInfo& paintInfo, int parentX, int parentY)
     if (paintInfo.context->paintingDisabled())
         return;
 
-    KRenderingDevice* device = renderingDevice();
-    KRenderingDeviceContext* context = device->currentContext();
-    bool shouldPopContext = false;
-    if (!context) {
-        // Only need to setup for KCanvas rendering if it hasn't already been done.
-        context = paintInfo.context->createRenderingDeviceContext();
-        device->pushContext(context);
-        shouldPopContext = true;
-    }
-
     paintInfo.context->save();
-
-    context->concatCTM(AffineTransform().translate(parentX, parentY));
-    context->concatCTM(localTransform());
-    context->concatCTM(translationForAttributes());
-
+    paintInfo.context->concatCTM(AffineTransform().translate(parentX, parentY));
+    paintInfo.context->concatCTM(localTransform());
+    paintInfo.context->concatCTM(translationForAttributes());
     paintInfo.context->clip(getClipRect(parentX, parentY));
 
     float opacity = style()->opacity();
@@ -79,11 +66,6 @@ void RenderForeignObject::paint(PaintInfo& paintInfo, int parentX, int parentY)
     if (opacity < 1.0f)
         paintInfo.context->endTransparencyLayer();
 
-    if (shouldPopContext) {
-        device->popContext();
-        delete context;
-    }
-
     paintInfo.context->restore();
 }
 
index 5add510803df4de1fa2814f4debd6aaef12c826b..15e3b44ee2e7021f8a518f80a27a499fdc898b9e 100644 (file)
 
 #include "GraphicsContext.h"
 #include "RenderSVGContainer.h"
+#include "SVGPaintServer.h"
 #include "SVGResourceClipper.h"
 #include "SVGResourceFilter.h"
 #include "SVGResourceMasker.h"
 #include "SVGResourceMarker.h"
 #include "KCanvasRenderingStyle.h"
-#include "KRenderingDevice.h"
 #include "SVGStyledElement.h"
-#include <wtf/OwnPtr.h>
 #include <wtf/MathExtras.h>
 
 namespace WebCore {
@@ -173,62 +172,43 @@ void RenderPath::paint(PaintInfo& paintInfo, int parentX, int parentY)
 
     if (paintInfo.context->paintingDisabled() || (paintInfo.phase != PaintPhaseForeground) || style()->visibility() == HIDDEN || path().isEmpty())
         return;
-    
-    KRenderingDevice* device = renderingDevice();
-    KRenderingDeviceContext* context = device->currentContext();
-    bool shouldPopContext = false;
-    if (context)
-        paintInfo.context->save();
-    else {
-        // Need to set up KCanvas rendering if it hasn't already been done.
-        context = paintInfo.context->createRenderingDeviceContext();
-        device->pushContext(context);
-        shouldPopContext = true;
-    }
 
-    context->concatCTM(localTransform());
+    paintInfo.context->save();
+    paintInfo.context->concatCTM(localTransform());
 
     // setup to apply filters
     SVGResourceFilter* filter = getFilterById(document(), style()->svgStyle()->filter().substring(1));
-    if (filter) {
-        filter->prepareFilter(relativeBBox(true));
-        context = device->currentContext();
-    }
+    if (filter)
+        filter->prepareFilter(paintInfo.context, relativeBBox(true));
 
     if (SVGResourceClipper* clipper = getClipperById(document(), style()->svgStyle()->clipPath().substring(1)))
-        clipper->applyClip(relativeBBox(true));
+        clipper->applyClip(paintInfo.context, relativeBBox(true));
 
     if (SVGResourceMasker* masker = getMaskerById(document(), style()->svgStyle()->maskElement().substring(1)))
-        masker->applyMask(relativeBBox(true));
+        masker->applyMask(paintInfo.context, relativeBBox(true));
 
-    context->clearPath();
+    paintInfo.context->beginPath();
     
     SVGPaintServer* fillPaintServer = KSVGPainterFactory::fillPaintServer(style(), this);
     if (fillPaintServer) {
-        context->addPath(path());
+        paintInfo.context->addPath(path());
         fillPaintServer->setActiveClient(this);
-        fillPaintServer->draw(context, this, ApplyToFillTargetType);
+        fillPaintServer->draw(paintInfo.context, this, ApplyToFillTargetType);
     }
     SVGPaintServer* strokePaintServer = KSVGPainterFactory::strokePaintServer(style(), this);
     if (strokePaintServer) {
-        context->addPath(path()); // path is cleared when filled.
+        paintInfo.context->addPath(path()); // path is cleared when filled.
         strokePaintServer->setActiveClient(this);
-        strokePaintServer->draw(context, this, ApplyToStrokeTargetType);
+        strokePaintServer->draw(paintInfo.context, this, ApplyToStrokeTargetType);
     }
 
     drawMarkersIfNeeded(paintInfo.context, paintInfo.rect, path());
 
     // actually apply the filter
     if (filter)
-        filter->applyFilter(relativeBBox(true));
-
-    // restore drawing state
-    if (!shouldPopContext)
-        paintInfo.context->restore();
-    else {
-        device->popContext();
-        delete context;
-    }
+        filter->applyFilter(paintInfo.context, relativeBBox(true));
+
+    paintInfo.context->restore();
 }
 
 void RenderPath::absoluteRects(Vector<IntRect>& rects, int _tx, int _ty)
index 5fa0a35f122746dda1a351be161cade3223acd17..77d6577dccad97171a763f0cc89fb5abeeb787af 100644 (file)
@@ -27,7 +27,6 @@
 #include "SVGResourceClipper.h"
 #include "SVGResourceFilter.h"
 #include "SVGResourceMasker.h"
-#include "KRenderingDevice.h"
 #include "SVGStyledElement.h"
 #include "GraphicsContext.h"
 #include "SVGLength.h"
@@ -148,39 +147,31 @@ void RenderSVGContainer::paint(PaintInfo& paintInfo, int parentX, int parentY)
     if (!firstChild() && !filter)
         return; // Spec: groups w/o children still may render filter content.
     
-    KRenderingDevice* device = renderingDevice();
-    KRenderingDeviceContext* deviceContext = device->currentContext();
-    bool shouldPopContext = false;
-    if (!deviceContext) {
-        // I only need to setup for KCanvas rendering if it hasn't already been done.
-        deviceContext = paintInfo.context->createRenderingDeviceContext();
-        device->pushContext(deviceContext);
-        shouldPopContext = true;
-    } else
-        paintInfo.context->save();
+    paintInfo.context->save();
 
     if (parentX != 0 || parentY != 0) {
         // Translate from parent offsets (html renderers) to a relative transform (svg renderers)
-        deviceContext->concatCTM(AffineTransform().translate(parentX, parentY));
+        paintInfo.context->concatCTM(AffineTransform().translate(parentX, parentY));
         parentX = parentY = 0;
     }
     
     if (!viewport().isEmpty()) {
         if (style()->overflowX() != OVISIBLE)
             paintInfo.context->clip(enclosingIntRect(viewport())); // FIXME: Eventually we'll want float-precision clipping
-        deviceContext->concatCTM(AffineTransform().translate(viewport().x(), viewport().y()));
+
+        paintInfo.context->concatCTM(AffineTransform().translate(viewport().x(), viewport().y()));
     }
 
     if (!localTransform().isIdentity())
-        deviceContext->concatCTM(localTransform());
+        paintInfo.context->concatCTM(localTransform());
     
     FloatRect strokeBBox = relativeBBox(true);
     
-    if (SVGResourceClipper *clipper = getClipperById(document(), style()->svgStyle()->clipPath().substring(1)))
-        clipper->applyClip(strokeBBox);
+    if (SVGResourceClipperclipper = getClipperById(document(), style()->svgStyle()->clipPath().substring(1)))
+        clipper->applyClip(paintInfo.context, strokeBBox);
 
-    if (SVGResourceMasker *masker = getMaskerById(document(), style()->svgStyle()->maskElement().substring(1)))
-        masker->applyMask(strokeBBox);
+    if (SVGResourceMaskermasker = getMaskerById(document(), style()->svgStyle()->maskElement().substring(1)))
+        masker->applyMask(paintInfo.context, strokeBBox);
 
     float opacity = style()->opacity();
     if (opacity < 1.0f) {
@@ -189,25 +180,20 @@ void RenderSVGContainer::paint(PaintInfo& paintInfo, int parentX, int parentY)
     }
 
     if (filter)
-        filter->prepareFilter(strokeBBox);
-    
+        filter->prepareFilter(paintInfo.context, strokeBBox);
+
     if (!viewBox().isEmpty())
-        deviceContext->concatCTM(viewportTransform());
+        paintInfo.context->concatCTM(viewportTransform());
 
     RenderContainer::paint(paintInfo, 0, 0);
 
     if (filter)
-        filter->applyFilter(strokeBBox);
+        filter->applyFilter(paintInfo.context, strokeBBox);
 
     if (opacity < 1.0f)
         paintInfo.context->endTransparencyLayer();
 
-    // restore drawing state
-    if (shouldPopContext) {
-        device->popContext();
-        delete deviceContext;
-    } else
-        paintInfo.context->restore();
+    paintInfo.context->restore();
 }
 
 FloatRect RenderSVGContainer::viewport() const
index 2e6730e6e4e78e7dde7ca7fd6fe9668eeb59d1cf..5c04f39aacf7c876551352f1e010151a7cc3ee4b 100644 (file)
 #include "SVGResourceClipper.h"
 #include "SVGResourceFilter.h"
 #include "SVGResourceMasker.h"
-#include "KRenderingDevice.h"
 #include "SVGLength.h"
 #include "SVGPreserveAspectRatio.h"
 #include "SVGImageElement.h"
 #include "SVGImageElement.h"
-#include <wtf/OwnPtr.h>
 
 namespace WebCore {
 
@@ -127,46 +125,32 @@ void RenderSVGImage::paint(PaintInfo& paintInfo, int parentX, int parentY)
     if (paintInfo.context->paintingDisabled() || (paintInfo.phase != PaintPhaseForeground) || style()->visibility() == HIDDEN)
         return;
     
-    KRenderingDevice* device = renderingDevice();
-    KRenderingDeviceContext* context = device->currentContext();
-    bool shouldPopContext = false;
-    if (context)
-        paintInfo.context->save();
-    else {
-        // Need to push a device context on the stack if empty.
-        context = paintInfo.context->createRenderingDeviceContext();
-        device->pushContext(context);
-        shouldPopContext = true;
-    }
+    paintInfo.context->save();
+    paintInfo.context->concatCTM(AffineTransform().translate(parentX, parentY));
+    paintInfo.context->concatCTM(localTransform());
+    paintInfo.context->concatCTM(translationForAttributes());
 
-    context->concatCTM(AffineTransform().translate(parentX, parentY));
-    context->concatCTM(localTransform());
-    translateForAttributes();
-    
     FloatRect boundingBox = FloatRect(0, 0, width(), height());
     const SVGRenderStyle* svgStyle = style()->svgStyle();
 
     if (SVGResourceClipper* clipper = getClipperById(document(), svgStyle->clipPath().substring(1)))
-        clipper->applyClip(boundingBox);
+        clipper->applyClip(paintInfo.context, boundingBox);
 
     if (SVGResourceMasker* masker = getMaskerById(document(), svgStyle->maskElement().substring(1)))
-        masker->applyMask(boundingBox);
+        masker->applyMask(paintInfo.context, boundingBox);
 
     SVGResourceFilter* filter = getFilterById(document(), svgStyle->filter().substring(1));
     if (filter)
-        filter->prepareFilter(boundingBox);
-    
-    OwnPtr<GraphicsContext> c(device->currentContext()->createGraphicsContext());
+        filter->prepareFilter(paintInfo.context, boundingBox);
 
     float opacity = style()->opacity();
     if (opacity < 1.0f) {
-        c->clip(enclosingIntRect(boundingBox));
-        c->beginTransparencyLayer(opacity);
+        paintInfo.context->clip(enclosingIntRect(boundingBox));
+        paintInfo.context->beginTransparencyLayer(opacity);
     }
 
     PaintInfo pi(paintInfo);
-    pi.context = c.get();
-    pi.rect = absoluteTransform().invert().mapRect(paintInfo.rect);
+    pi.rect = absoluteTransform().invert().mapRect(pi.rect);
 
     int x = 0, y = 0;
     if (shouldPaint(pi, x, y)) {
@@ -178,23 +162,17 @@ void RenderSVGImage::paint(PaintInfo& paintInfo, int parentX, int parentY)
             FloatRect destRect(m_x, m_y, contentWidth(), contentHeight());
             FloatRect srcRect(0, 0, image()->width(), image()->height());
             adjustRectsForAspectRatio(destRect, srcRect, imageElt->preserveAspectRatio());
-            c->drawImage(image(), destRect, srcRect);
+            paintInfo.context->drawImage(image(), destRect, srcRect);
         }
-
-        if (filter)
-            filter->applyFilter(boundingBox);
     }
-    
+
+    if (filter)
+        filter->applyFilter(paintInfo.context, boundingBox);
+
     if (opacity < 1.0f)
-        c->endTransparencyLayer();
-
-    // restore drawing state
-    if (!shouldPopContext)
-        paintInfo.context->restore();
-    else {
-        device->popContext();
-        delete context;
-    }
+        paintInfo.context->endTransparencyLayer();
+
+    paintInfo.context->restore();
 }
 
 void RenderSVGImage::computeAbsoluteRepaintRect(IntRect& r, bool f)
@@ -281,12 +259,6 @@ AffineTransform RenderSVGImage::translationForAttributes()
     return AffineTransform().translate(image->x()->value(), image->y()->value());
 }
 
-void RenderSVGImage::translateForAttributes()
-{
-    KRenderingDeviceContext* context = renderingDevice()->currentContext();
-    context->concatCTM(translationForAttributes());
-}
-
 }
 
 #endif // SVG_SUPPORT
index b4f31a5cc17f7f528b0ee32488c8b78d3884b9d2..3a9ade1223bad1a16943503d5864ff14a0c71f6c 100644 (file)
@@ -57,7 +57,6 @@ namespace WebCore {
         virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int _x, int _y, int _tx, int _ty, HitTestAction);
 
     private:
-        void translateForAttributes();
         AffineTransform translationForAttributes();
         AffineTransform m_transform;
         IntRect m_absoluteBounds;
index b1778c84abab36488a5569bf5370883921dee085..5d82e2ca6002e66ded29b19b596e384842c92b20 100644 (file)
@@ -22,6 +22,7 @@
  */
 
 #include "config.h"
+
 #ifdef SVG_SUPPORT
 #include "RenderSVGInline.h"
 #include "SVGInlineFlowBox.h"
 
 namespace WebCore {
     
-RenderSVGInline::RenderSVGInline(Node* n) : RenderInline(n) {}
-    
+RenderSVGInline::RenderSVGInline(Node* n) : RenderInline(n)
+{
+}
+
 InlineBox* RenderSVGInline::createInlineBox(bool makePlaceHolderBox, bool isRootLineBox, bool isOnlyRun)
 {
-    assert(!(!isRootLineBox && (isReplaced() || makePlaceHolderBox)));
-    assert(isInlineFlow());
+    ASSERT(!(!isRootLineBox && (isReplaced() || makePlaceHolderBox)));
+    ASSERT(isInlineFlow());
+
     InlineFlowBox* flowBox = new (renderArena()) SVGInlineFlowBox(this);
+
     if (!m_firstLineBox)
         m_firstLineBox = m_lastLineBox = flowBox;
     else {
index 1357e9d80c094eb0e34b462f5d382ff6f9e65981..364f52197acc2f847e7c592963ef5b37569e283e 100644 (file)
 
 #include "GraphicsContext.h"
 #include "KCanvasRenderingStyle.h"
-#include "KRenderingDevice.h"
 #include "AffineTransform.h"
 
 namespace WebCore {
     
 RenderSVGInlineText::RenderSVGInlineText(Node* n, StringImpl* str) 
-    : RenderText(n, str) {}
+    : RenderText(n, str)
+{
+}
 
 void RenderSVGInlineText::absoluteRects(Vector<IntRect>& rects, int tx, int ty)
 {
index eaf675c0cbd5874559d6b671a1dc9b1d5bad0ceb..ab66311df3f04112c45264a9a3d8925291f19987 100644 (file)
  */
 
 #include "config.h"
+
 #ifdef SVG_SUPPORT
 #include "RenderSVGTSpan.h"
 #include "GraphicsContext.h"
 #include "KCanvasRenderingStyle.h"
-#include "KRenderingDevice.h"
 #include "SVGRootInlineBox.h"
 #include "SVGInlineFlowBox.h"
 #include "AffineTransform.h"
 #include "SVGLengthList.h"
 
 namespace WebCore {
-    
-RenderSVGTSpan::RenderSVGTSpan(Node* n) : RenderSVGInline(n) {}
+
+RenderSVGTSpan::RenderSVGTSpan(Node* n) : RenderSVGInline(n)
+{
+}
 
 void RenderSVGTSpan::absoluteRects(Vector<IntRect>& rects, int tx, int ty)
 {
index 6ae788a2444b2033f6405b98d7709b594b979fd1..05bb0a6a66ee5ea0d789545532fa337eaddd5db3 100644 (file)
  */
 
 #include "config.h"
+
 #ifdef SVG_SUPPORT
 #include "RenderSVGText.h"
 
 #include "GraphicsContext.h"
 #include "KCanvasRenderingStyle.h"
-#include "KRenderingDevice.h"
 #include "SVGLengthList.h"
 #include "SVGTextElement.h"
 #include "SVGRootInlineBox.h"
+
 #include <wtf/OwnPtr.h>
 
 namespace WebCore {
@@ -114,12 +115,9 @@ void RenderSVGText::absoluteRects(Vector<IntRect>& rects, int tx, int ty)
 }
 
 void RenderSVGText::paint(PaintInfo& paintInfo, int tx, int ty)
-{    
-    KRenderingDevice* device = renderingDevice();
-    RenderObject::PaintInfo pi = paintInfo;
-    OwnPtr<GraphicsContext> c(device->currentContext()->createGraphicsContext());
-    pi.context = c.get();
-    pi.rect = (absoluteTransform()).invert().mapRect(paintInfo.rect);
+{   
+    RenderObject::PaintInfo pi(paintInfo);
+    pi.rect = (absoluteTransform()).invert().mapRect(pi.rect);
     RenderBlock::paint(pi, tx, ty);
 }
 
index d24178578cb324bf6688da478791dedef655c2e3..e6070df95620c70cb145a1a1b1171fb080cf8695 100644 (file)
@@ -24,7 +24,6 @@
 #include "config.h"
 
 #ifdef SVG_SUPPORT
-
 #include "SVGInlineFlowBox.h"
 
 #include "GraphicsContext.h"
 #include "SVGResourceClipper.h"
 #include "SVGResourceFilter.h"
 #include "SVGResourceMasker.h"
+#include "SVGPaintServer.h"
 #include "KCanvasRenderingStyle.h"
-#include "KRenderingDevice.h"
 #include "RootInlineBox.h"
 #include "SVGLengthList.h"
 #include "SVGTextPositioningElement.h"
-#include <wtf/OwnPtr.h>
 
 using namespace std;
 
@@ -63,77 +61,59 @@ void paintSVGInlineFlow(InlineFlowBox* flow, RenderObject* object, RenderObject:
     if (paintInfo.context->paintingDisabled())
         return;
     
-    KRenderingDevice* device = renderingDevice();
-    KRenderingDeviceContext* context = device->currentContext();
-    bool shouldPopContext = false;
-    if (context)
-        paintInfo.context->save();
-    else {
-        // Need to set up KCanvas rendering if it hasn't already been done.
-        context = paintInfo.context->createRenderingDeviceContext();
-        device->pushContext(context);
-        shouldPopContext = true;
-    }
-
-    context->concatCTM(object->localTransform());
+    paintInfo.context->save();
+    paintInfo.context->concatCTM(object->localTransform());
 
     FloatRect boundingBox(tx + flow->xPos(), ty + flow->yPos(), flow->width(), flow->height());
 
     const SVGRenderStyle* svgStyle = object->style()->svgStyle();
     if (SVGResourceClipper* clipper = getClipperById(object->document(), svgStyle->clipPath().substring(1)))
-        clipper->applyClip(boundingBox);
+        clipper->applyClip(paintInfo.context, boundingBox);
 
     if (SVGResourceMasker* masker = getMaskerById(object->document(), svgStyle->maskElement().substring(1)))
-        masker->applyMask(boundingBox);
+        masker->applyMask(paintInfo.context, boundingBox);
 
     SVGResourceFilter* filter = getFilterById(object->document(), svgStyle->filter().substring(1));
     if (filter)
-        filter->prepareFilter(boundingBox);
+        filter->prepareFilter(paintInfo.context, boundingBox);
 
-    RenderObject::PaintInfo pi = paintInfo;
-    OwnPtr<GraphicsContext> c(device->currentContext()->createGraphicsContext());
-    pi.context = c.get();
+    RenderObject::PaintInfo pi(paintInfo);
+    
     if (!flow->isRootInlineBox())
-        pi.rect = (object->localTransform()).invert().mapRect(paintInfo.rect);
+        pi.rect = (object->localTransform()).invert().mapRect(pi.rect);
 
     float opacity = object->style()->opacity();
     if (opacity < 1.0f) {
-        c->clip(enclosingIntRect(boundingBox));
-        c->beginTransparencyLayer(opacity);
+        paintInfo.context->clip(enclosingIntRect(boundingBox));
+        paintInfo.context->beginTransparencyLayer(opacity);
     }
     
     SVGPaintServer* fillPaintServer = KSVGPainterFactory::fillPaintServer(object->style(), object);
     if (fillPaintServer) {
         fillPaintServer->setPaintingText(true);
-        if (fillPaintServer->setup(context, object, ApplyToFillTargetType)) {
+        if (fillPaintServer->setup(pi.context, object, ApplyToFillTargetType)) {
             flow->InlineFlowBox::paint(pi, tx, ty);
-            fillPaintServer->teardown(context, object, ApplyToFillTargetType);
+            fillPaintServer->teardown(pi.context, object, ApplyToFillTargetType);
         }
         fillPaintServer->setPaintingText(false);
     }
     SVGPaintServer* strokePaintServer = KSVGPainterFactory::strokePaintServer(object->style(), object);
     if (strokePaintServer) {
         strokePaintServer->setPaintingText(true);
-        if (strokePaintServer->setup(context, object, ApplyToStrokeTargetType)) {
+        if (strokePaintServer->setup(pi.context, object, ApplyToStrokeTargetType)) {
             flow->InlineFlowBox::paint(pi, tx, ty);
-            strokePaintServer->teardown(context, object, ApplyToStrokeTargetType);
+            strokePaintServer->teardown(pi.context, object, ApplyToStrokeTargetType);
         }
         strokePaintServer->setPaintingText(false);
     }
 
     if (filter) 
-        filter->applyFilter(boundingBox);
+        filter->applyFilter(paintInfo.context, boundingBox);
 
     if (opacity < 1.0f)
-        c->endTransparencyLayer();
+        paintInfo.context->endTransparencyLayer();
 
-    // restore drawing state
-    if (!shouldPopContext)
-        paintInfo.context->restore();
-    else {
-        device->popContext();
-        delete context;
-    }
+    paintInfo.context->restore();
 }
 
 static bool translateBox(InlineBox* box, int x, int y, bool topLevel = true)
index 21e2f8b9f21fac106370a50542ea65c1532e888d..f0b3e6d3cf0997459dcff69de739f016ae78d300 100644 (file)
@@ -34,7 +34,6 @@
 #include "HTMLNames.h"
 #include "RenderTreeAsText.h"
 #include "RenderSVGContainer.h"
-#include "KRenderingDevice.h"
 #include "SVGPaintServerGradient.h"
 #include "SVGPaintServerPattern.h"
 #include "SVGPaintServerSolid.h"
@@ -232,12 +231,8 @@ static void writeStyle(TextStream& ts, const RenderObject &object)
         if (strokePaintServer) {
             TextStreamSeparator s(" ");
             ts << " [stroke={";
-            if (strokePaintServer) {
-                if (!strokePaintServer->idInRegistry().isEmpty())
-                    ts << s << "[id=\""<< strokePaintServer->idInRegistry() << "\"]"; 
-                else
-                    ts << s << *strokePaintServer;
-            } 
+            if (strokePaintServer)
+                ts << s << *strokePaintServer;
 
             double dashOffset = KSVGPainterFactory::cssPrimitiveToLength(&path, svgStyle->strokeDashOffset(), 0.0);
             const KCDashArray& dashArray = KSVGPainterFactory::dashArrayFromRenderingStyle(style);
@@ -263,13 +258,9 @@ static void writeStyle(TextStream& ts, const RenderObject &object)
         if (fillPaintServer) {
             TextStreamSeparator s(" ");
             ts << " [fill={";
-            if (fillPaintServer) {
-                if (!fillPaintServer->idInRegistry().isEmpty())
-                    ts << s << "[id=\"" << fillPaintServer->idInRegistry() << "\"]";
-                else
-                    ts << s << *fillPaintServer;
-            }
-            
+            if (fillPaintServer)
+                ts << s << *fillPaintServer;
+
             if (style->svgStyle()->fillOpacity() != 1.0f)
                 ts << s << "[opacity=" << style->svgStyle()->fillOpacity() << "]";
             if (style->svgStyle()->fillRule() != RULE_NONZERO)