liver Hunt <oliver@apple.com>
authoroliver <oliver@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Oct 2006 02:33:47 +0000 (02:33 +0000)
committeroliver <oliver@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Oct 2006 02:33:47 +0000 (02:33 +0000)
        Reviewed by Anders.

        Roll out last patch

        * CMakeLists.txt:
        * ChangeLog:
        * WebCore.xcodeproj/project.pbxproj:
        * graphics/svg/SVGResource.cpp:
        * graphics/svg/SVGResourceClipper.cpp:
        * graphics/svg/SVGResourceClipper.h:
        * graphics/svg/SVGResourceImage.h:
        * graphics/svg/SVGResourceListener.h:
        * graphics/svg/SVGResourceMarker.cpp:
        * graphics/svg/SVGResourceMarker.h:
        * graphics/svg/SVGResourceMasker.cpp:
        * graphics/svg/SVGResourceMasker.h:
        * kcanvas/KCanvasClipper.cpp: Added.
        (WebCore::operator<<):
        (WebCore::KCanvasClipper::KCanvasClipper):
        (WebCore::KCanvasClipper::~KCanvasClipper):
        (WebCore::KCanvasClipper::resetClipData):
        (WebCore::KCanvasClipper::addClipData):
        (WebCore::KCanvasClipper::clipData):
        (WebCore::KCanvasClipper::externalRepresentation):
        (WebCore::getClipperById):
        * kcanvas/KCanvasClipper.h: Added.
        (WebCore::KCClipData::windRule):
        (WebCore::KCClipDataList::KCClipDataList):
        (WebCore::KCClipDataList::addPath):
        (WebCore::KCanvasClipper::isClipper):
        * kcanvas/KCanvasFilters.cpp:
        (WebCore::getFilterById):
        * kcanvas/KCanvasFilters.h:
        * kcanvas/KCanvasImage.h: Added.
        (WebCore::KCanvasImage::KCanvasImage):
        (WebCore::KCanvasImage::~KCanvasImage):
        * kcanvas/KCanvasMarker.cpp: Added.
        (WebCore::KCanvasMarker::KCanvasMarker):
        (WebCore::KCanvasMarker::~KCanvasMarker):
        (WebCore::KCanvasMarker::setMarker):
        (WebCore::KCanvasMarker::setRef):
        (WebCore::KCanvasMarker::refX):
        (WebCore::KCanvasMarker::refY):
        (WebCore::KCanvasMarker::setAngle):
        (WebCore::KCanvasMarker::angle):
        (WebCore::KCanvasMarker::setAutoAngle):
        (WebCore::KCanvasMarker::setUseStrokeWidth):
        (WebCore::KCanvasMarker::useStrokeWidth):
        (WebCore::KCanvasMarker::draw):
        (WebCore::KCanvasMarker::externalRepresentation):
        (WebCore::getMarkerById):
        * kcanvas/KCanvasMarker.h: Added.
        (WebCore::KCanvasMarker::isMarker):
        * kcanvas/KCanvasMasker.cpp: Added.
        (WebCore::KCanvasMasker::KCanvasMasker):
        (WebCore::KCanvasMasker::~KCanvasMasker):
        (WebCore::KCanvasMasker::setMask):
        (WebCore::KCanvasMasker::externalRepresentation):
        (WebCore::getMaskerById):
        * kcanvas/KCanvasMasker.h: Added.
        (WebCore::KCanvasMasker::isMasker):
        (WebCore::KCanvasMasker::mask):
        * kcanvas/KCanvasResource.cpp: Added.
        (WebCore::operator<<):
        (WebCore::KCanvasResource::KCanvasResource):
        (WebCore::KCanvasResource::~KCanvasResource):
        (WebCore::KCanvasResource::addClient):
        (WebCore::KCanvasResource::clients):
        (WebCore::KCanvasResource::invalidate):
        (WebCore::KCanvasResource::idInRegistry):
        (WebCore::KCanvasResource::setIdInRegistry):
        (WebCore::KCanvasResource::externalRepresentation):
        (WebCore::getResourceById):
        (WebCore::getPaintServerById):
        * kcanvas/KCanvasResource.h:
        (WebCore::):
        (WebCore::KCanvasResource::isPaintServer):
        (WebCore::KCanvasResource::isFilter):
        (WebCore::KCanvasResource::isClipper):
        (WebCore::KCanvasResource::isMarker):
        (WebCore::KCanvasResource::isMasker):
        * kcanvas/KCanvasResourceListener.h: Added.
        (KCanvasResourceListener::KCanvasResourceListener):
        (KCanvasResourceListener::~KCanvasResourceListener):
        * kcanvas/KCanvasTreeDebug.cpp:
        (WebCore::writeRenderResources):
        * kcanvas/device/KRenderingDevice.h:
        * kcanvas/device/KRenderingPaintServer.h:
        (WebCore::KRenderingPaintServer::KRenderingPaintServer):
        (WebCore::KRenderingPaintServer::idInRegistry):
        (WebCore::KRenderingPaintServer::setIdInRegistry):
        * kcanvas/device/KRenderingPaintServerGradient.cpp:
        (WebCore::KRenderingPaintServerGradient::listener):
        (WebCore::KRenderingPaintServerGradient::setListener):
        * kcanvas/device/KRenderingPaintServerGradient.h:
        * kcanvas/device/KRenderingPaintServerPattern.cpp:
        (WebCore::KRenderingPaintServerPattern::KRenderingPaintServerPattern):
        (WebCore::KRenderingPaintServerPattern::~KRenderingPaintServerPattern):
        (WebCore::KRenderingPaintServerPattern::tile):
        (WebCore::KRenderingPaintServerPattern::setTile):
        (WebCore::KRenderingPaintServerPattern::listener):
        (WebCore::KRenderingPaintServerPattern::setListener):
        * kcanvas/device/KRenderingPaintServerPattern.h:
        * kcanvas/device/KRenderingPaintServerSolid.h:
        * kcanvas/device/qt/KCanvasClipperQt.cpp:
        (WebCore::KCanvasClipperQt::applyClip):
        * kcanvas/device/qt/KCanvasClipperQt.h:
        (WebCore::KCanvasClipperQt::KCanvasClipperQt):
        * kcanvas/device/qt/KRenderingDeviceQt.cpp:
        (WebCore::KRenderingDeviceQt::contextForImage):
        (WebCore::KRenderingDeviceQt::createResource):
        (WebCore::KRenderingDeviceQt::createPaintServer):
        * kcanvas/device/qt/KRenderingDeviceQt.h:
        * kcanvas/device/qt/KRenderingPaintServerGradientQt.cpp:
        * kcanvas/device/qt/KRenderingPaintServerPatternQt.cpp:
        * kcanvas/device/qt/KRenderingPaintServerQt.cpp:
        * kcanvas/device/qt/KRenderingPaintServerSolidQt.cpp:
        * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
        (WebCore::KCanvasFilterQuartz::getCIFilterStack):
        * kcanvas/device/quartz/KCanvasItemQuartz.mm:
        * kcanvas/device/quartz/KCanvasMaskerQuartz.h:
        (WebCore::KCanvasMaskerQuartz::KCanvasMaskerQuartz):
        * kcanvas/device/quartz/KCanvasMaskerQuartz.mm:
        (WebCore::applyLuminanceToAlphaFilter):
        (WebCore::applyExpandAlphatoGrayscaleFilter):
        (WebCore::transformImageIntoGrayscaleMask):
        (WebCore::KCanvasMaskerQuartz::applyMask):
        * kcanvas/device/quartz/KCanvasResourcesQuartz.h:
        (WebCore::KCanvasClipperQuartz::KCanvasClipperQuartz):
        (WebCore::KCanvasImageQuartz::KCanvasImageQuartz):
        (WebCore::KCanvasImageQuartz::init):
        (WebCore::KCanvasImageQuartz::size):
        * kcanvas/device/quartz/KCanvasResourcesQuartz.mm:
        (WebCore::KCanvasClipperQuartz::applyClip):
        (WebCore::KCanvasImageQuartz::~KCanvasImageQuartz):
        (WebCore::KCanvasImageQuartz::cgLayer):
        (WebCore::KCanvasImageQuartz::setCGLayer):
        * kcanvas/device/quartz/KRenderingDeviceQuartz.h:
        * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
        (WebCore::KRenderingDeviceQuartz::contextForImage):
        (WebCore::KRenderingDeviceQuartz::createPaintServer):
        (WebCore::KRenderingDeviceQuartz::createResource):
        * kcanvas/device/quartz/KRenderingPaintServerGradientQuartz.mm:
        (WebCore::KRenderingPaintServerGradientQuartz::KRenderingPaintServerGradientQuartz):
        (WebCore::KRenderingPaintServerGradientQuartz::~KRenderingPaintServerGradientQuartz):
        (WebCore::KRenderingPaintServerGradientQuartz::setup):
        (WebCore::KRenderingPaintServerGradientQuartz::teardown):
        * kcanvas/device/quartz/KRenderingPaintServerQuartz.h:
        * kcanvas/device/quartz/KRenderingPaintServerQuartz.mm:
        (WebCore::patternCallback):
        (WebCore::KRenderingPaintServerPatternQuartz::setup):
        * kcanvas/device/quartz/QuartzSupport.mm:
        * ksvg2/misc/KCanvasRenderingStyle.cpp:
        (WebCore::sharedSolidPaintServer):
        * ksvg2/svg/SVGClipPathElement.cpp:
        (WebCore::SVGClipPathElement::SVGClipPathElement):
        (WebCore::SVGClipPathElement::~SVGClipPathElement):
        (WebCore::SVGClipPathElement::canvasResource):
        * ksvg2/svg/SVGClipPathElement.h:
        * ksvg2/svg/SVGFEImageElement.cpp:
        * ksvg2/svg/SVGFilterElement.cpp:
        (WebCore::SVGFilterElement::SVGFilterElement):
        (WebCore::SVGFilterElement::~SVGFilterElement):
        (WebCore::SVGFilterElement::canvasResource):
        * ksvg2/svg/SVGFilterElement.h:
        * ksvg2/svg/SVGGradientElement.cpp:
        (WebCore::SVGGradientElement::SVGGradientElement):
        (WebCore::SVGGradientElement::~SVGGradientElement):
        (WebCore::SVGGradientElement::canvasResource):
        (WebCore::SVGGradientElement::resourceNotification):
        * ksvg2/svg/SVGGradientElement.h:
        * ksvg2/svg/SVGImageElement.cpp:
        * ksvg2/svg/SVGLinearGradientElement.cpp:
        (WebCore::SVGLinearGradientElement::buildGradient):
        * ksvg2/svg/SVGLinearGradientElement.h:
        * ksvg2/svg/SVGMarkerElement.cpp:
        (WebCore::SVGMarkerElement::SVGMarkerElement):
        (WebCore::SVGMarkerElement::~SVGMarkerElement):
        (WebCore::SVGMarkerElement::canvasResource):
        * ksvg2/svg/SVGMarkerElement.h:
        * ksvg2/svg/SVGMaskElement.cpp:
        (WebCore::SVGMaskElement::SVGMaskElement):
        (WebCore::SVGMaskElement::~SVGMaskElement):
        (WebCore::SVGMaskElement::drawMaskerContent):
        (WebCore::SVGMaskElement::canvasResource):
        * ksvg2/svg/SVGMaskElement.h:
        * ksvg2/svg/SVGPatternElement.cpp:
        (WebCore::SVGPatternElement::SVGPatternElement):
        (WebCore::SVGPatternElement::~SVGPatternElement):
        (WebCore::SVGPatternElement::fillAttributesFromReferencePattern):
        (WebCore::SVGPatternElement::drawPatternContentIntoTile):
        (WebCore::SVGPatternElement::canvasResource):
        * ksvg2/svg/SVGPatternElement.h:
        * ksvg2/svg/SVGRadialGradientElement.cpp:
        (WebCore::SVGRadialGradientElement::buildGradient):
        * ksvg2/svg/SVGRadialGradientElement.h:
        * ksvg2/svg/SVGStyledElement.h:
        (WebCore::SVGStyledElement::canvasResource):
        * platform/GraphicsContext.cpp: Added.
        (WebCore::GraphicsContextState::GraphicsContextState):
        (WebCore::GraphicsContextPrivate::GraphicsContextPrivate):
        (WebCore::GraphicsContext::createGraphicsContextPrivate):
        (WebCore::GraphicsContext::destroyGraphicsContextPrivate):
        (WebCore::GraphicsContext::save):
        (WebCore::GraphicsContext::restore):
        (WebCore::GraphicsContext::font):
        (WebCore::GraphicsContext::setFont):
        (WebCore::GraphicsContext::pen):
        (WebCore::GraphicsContext::setPen):
        (WebCore::GraphicsContext::setFillColor):
        (WebCore::GraphicsContext::fillColor):
        (WebCore::GraphicsContext::updatingControlTints):
        (WebCore::GraphicsContext::setUpdatingControlTints):
        (WebCore::GraphicsContext::setPaintingDisabled):
        (WebCore::GraphicsContext::paintingDisabled):
        (WebCore::GraphicsContext::drawImage):
        (WebCore::GraphicsContext::drawText):
        (WebCore::GraphicsContext::drawHighlightForText):
        (WebCore::GraphicsContext::initFocusRing):
        (WebCore::GraphicsContext::clearFocusRing):
        (WebCore::GraphicsContext::focusRingBoundingRect):
        (WebCore::GraphicsContext::addFocusRingRect):
        (WebCore::GraphicsContext::focusRingWidth):
        (WebCore::GraphicsContext::focusRingOffset):
        (WebCore::GraphicsContext::focusRingRects):
        (WebCore::GraphicsContext::drawTiledImage):
        * platform/GraphicsContext.h: Added.
        * platform/GraphicsTypes.cpp: Added.
        (WebCore::):
        (WebCore::parseCompositeOperator):
        (WebCore::compositeOperatorName):
        (WebCore::parseLineCap):
        (WebCore::lineCapName):
        (WebCore::parseLineJoin):
        (WebCore::lineJoinName):
        * platform/GraphicsTypes.h: Added.
        (WebCore::):
        * platform/graphics/GraphicsContext.cpp:
        * platform/graphics/GraphicsContext.h:
        * platform/graphics/GraphicsTypes.cpp:
        * platform/graphics/GraphicsTypes.h:
        * platform/qt/GraphicsContextQt.cpp:
        * rendering/RenderPath.cpp:
        (WebCore::RenderPath::paint):
        (WebCore::DrawMarkersData::DrawMarkersData):
        (WebCore::RenderPath::drawMarkersIfNeeded):
        * rendering/RenderSVGContainer.cpp:
        (WebCore::RenderSVGContainer::paint):
        * rendering/RenderSVGImage.cpp:
        (WebCore::RenderSVGImage::paint):
        * rendering/SVGInlineFlowBox.cpp:
        (WebCore::paintSVGInlineFlow):

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

87 files changed:
WebCore/CMakeLists.txt
WebCore/ChangeLog
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/graphics/svg/SVGResource.cpp
WebCore/graphics/svg/SVGResourceClipper.cpp
WebCore/graphics/svg/SVGResourceClipper.h
WebCore/graphics/svg/SVGResourceImage.h
WebCore/graphics/svg/SVGResourceListener.h
WebCore/graphics/svg/SVGResourceMarker.cpp
WebCore/graphics/svg/SVGResourceMarker.h
WebCore/graphics/svg/SVGResourceMasker.cpp
WebCore/graphics/svg/SVGResourceMasker.h
WebCore/kcanvas/KCanvasClipper.cpp [new file with mode: 0644]
WebCore/kcanvas/KCanvasClipper.h [new file with mode: 0644]
WebCore/kcanvas/KCanvasCreator.cpp [new file with mode: 0644]
WebCore/kcanvas/KCanvasCreator.h [new file with mode: 0644]
WebCore/kcanvas/KCanvasFilters.cpp
WebCore/kcanvas/KCanvasFilters.h
WebCore/kcanvas/KCanvasImage.h [new file with mode: 0644]
WebCore/kcanvas/KCanvasMarker.cpp [new file with mode: 0644]
WebCore/kcanvas/KCanvasMarker.h [new file with mode: 0644]
WebCore/kcanvas/KCanvasMasker.cpp [new file with mode: 0644]
WebCore/kcanvas/KCanvasMasker.h [new file with mode: 0644]
WebCore/kcanvas/KCanvasResource.cpp [new file with mode: 0644]
WebCore/kcanvas/KCanvasResource.h
WebCore/kcanvas/KCanvasResourceListener.h [new file with mode: 0644]
WebCore/kcanvas/KCanvasTreeDebug.cpp
WebCore/kcanvas/device/KRenderingDevice.h
WebCore/kcanvas/device/KRenderingPaintServer.h
WebCore/kcanvas/device/KRenderingPaintServerGradient.cpp
WebCore/kcanvas/device/KRenderingPaintServerGradient.h
WebCore/kcanvas/device/KRenderingPaintServerPattern.cpp
WebCore/kcanvas/device/KRenderingPaintServerPattern.h
WebCore/kcanvas/device/KRenderingPaintServerSolid.h
WebCore/kcanvas/device/qt/KCanvasClipperQt.cpp
WebCore/kcanvas/device/qt/KCanvasClipperQt.h
WebCore/kcanvas/device/qt/KRenderingDeviceQt.cpp
WebCore/kcanvas/device/qt/KRenderingDeviceQt.h
WebCore/kcanvas/device/qt/KRenderingPaintServerGradientQt.cpp
WebCore/kcanvas/device/qt/KRenderingPaintServerPatternQt.cpp
WebCore/kcanvas/device/qt/KRenderingPaintServerQt.cpp
WebCore/kcanvas/device/qt/KRenderingPaintServerSolidQt.cpp
WebCore/kcanvas/device/quartz/KCanvasFilterQuartz.mm
WebCore/kcanvas/device/quartz/KCanvasItemQuartz.mm
WebCore/kcanvas/device/quartz/KCanvasMaskerQuartz.h
WebCore/kcanvas/device/quartz/KCanvasMaskerQuartz.mm
WebCore/kcanvas/device/quartz/KCanvasResourcesQuartz.h
WebCore/kcanvas/device/quartz/KCanvasResourcesQuartz.mm
WebCore/kcanvas/device/quartz/KRenderingDeviceQuartz.h
WebCore/kcanvas/device/quartz/KRenderingDeviceQuartz.mm
WebCore/kcanvas/device/quartz/KRenderingPaintServerGradientQuartz.mm
WebCore/kcanvas/device/quartz/KRenderingPaintServerQuartz.h
WebCore/kcanvas/device/quartz/KRenderingPaintServerQuartz.mm
WebCore/kcanvas/device/quartz/QuartzSupport.mm
WebCore/ksvg2/misc/KCanvasRenderingStyle.cpp
WebCore/ksvg2/svg/SVGClipPathElement.cpp
WebCore/ksvg2/svg/SVGClipPathElement.h
WebCore/ksvg2/svg/SVGFEImageElement.cpp
WebCore/ksvg2/svg/SVGFilterElement.cpp
WebCore/ksvg2/svg/SVGFilterElement.h
WebCore/ksvg2/svg/SVGGradientElement.cpp
WebCore/ksvg2/svg/SVGGradientElement.h
WebCore/ksvg2/svg/SVGImageElement.cpp
WebCore/ksvg2/svg/SVGLinearGradientElement.cpp
WebCore/ksvg2/svg/SVGLinearGradientElement.h
WebCore/ksvg2/svg/SVGMarkerElement.cpp
WebCore/ksvg2/svg/SVGMarkerElement.h
WebCore/ksvg2/svg/SVGMaskElement.cpp
WebCore/ksvg2/svg/SVGMaskElement.h
WebCore/ksvg2/svg/SVGPatternElement.cpp
WebCore/ksvg2/svg/SVGPatternElement.h
WebCore/ksvg2/svg/SVGRadialGradientElement.cpp
WebCore/ksvg2/svg/SVGRadialGradientElement.h
WebCore/ksvg2/svg/SVGStyledElement.h
WebCore/platform/GraphicsContext.cpp [new file with mode: 0644]
WebCore/platform/GraphicsContext.h [new file with mode: 0644]
WebCore/platform/GraphicsTypes.cpp [new file with mode: 0644]
WebCore/platform/GraphicsTypes.h [new file with mode: 0644]
WebCore/platform/graphics/GraphicsContext.cpp
WebCore/platform/graphics/GraphicsContext.h
WebCore/platform/graphics/GraphicsTypes.cpp
WebCore/platform/graphics/GraphicsTypes.h
WebCore/platform/qt/GraphicsContextQt.cpp
WebCore/rendering/RenderPath.cpp
WebCore/rendering/RenderSVGContainer.cpp
WebCore/rendering/RenderSVGImage.cpp
WebCore/rendering/SVGInlineFlowBox.cpp

index c9bb837981c381e6b581189e9754edf426bdd328..87e3881d5ce6a375740485d5d577ae1fbf00f816 100644 (file)
@@ -6,6 +6,8 @@ include (CheckCXXCompilerFlag)
 include_directories(
    BEFORE ${CMAKE_CURRENT_BINARY_DIR}
    ${CMAKE_CURRENT_SOURCE_DIR}/ForwardingHeaders
+   ${CMAKE_CURRENT_SOURCE_DIR}/platform
+   ${CMAKE_CURRENT_SOURCE_DIR}/platform/network
    ${CMAKE_CURRENT_SOURCE_DIR}/loader
    ${CMAKE_CURRENT_SOURCE_DIR}/loader/icon
    ${CMAKE_CURRENT_BINARY_DIR}/css
@@ -32,12 +34,6 @@ include_directories(
    ${CMAKE_CURRENT_BINARY_DIR}/ksvg2/misc 
    ${CMAKE_CURRENT_SOURCE_DIR}/ksvg2/events
    ${CMAKE_CURRENT_BINARY_DIR}/platform
-   ${CMAKE_CURRENT_SOURCE_DIR}/platform
-   ${CMAKE_CURRENT_SOURCE_DIR}/platform/qt
-   ${CMAKE_CURRENT_SOURCE_DIR}/platform/network
-   ${CMAKE_CURRENT_SOURCE_DIR}/platform/network/qt
-   ${CMAKE_CURRENT_SOURCE_DIR}/platform/graphics
-   ${CMAKE_CURRENT_SOURCE_DIR}/platform/graphics/qt
    ${CMAKE_CURRENT_SOURCE_DIR}/platform/image-decoders
    ${CMAKE_CURRENT_SOURCE_DIR}/platform/image-decoders/gif
    ${CMAKE_CURRENT_SOURCE_DIR}/platform/image-decoders/jpeg
@@ -45,6 +41,8 @@ include_directories(
    ${CMAKE_CURRENT_SOURCE_DIR}/platform/image-decoders/xbm
    ${CMAKE_CURRENT_SOURCE_DIR}/platform/image-decoders/bmp
    ${CMAKE_CURRENT_SOURCE_DIR}/platform/image-decoders/png
+   ${CMAKE_CURRENT_SOURCE_DIR}/platform/qt
+   ${CMAKE_CURRENT_SOURCE_DIR}/platform/network/qt
    ${CMAKE_CURRENT_SOURCE_DIR}/WebCore+SVG
    ${CMAKE_CURRENT_SOURCE_DIR}/../JavaScriptCore/kjs
    ${CMAKE_CURRENT_SOURCE_DIR}/../JavaScriptCore/bindings
@@ -639,6 +637,8 @@ set (SVG_SOURCES
     ksvg2/svg/SVGStopElement.cpp
     ksvg2/svg/SVGDefsElement.cpp
     ksvg2/svg/SVGMetadataElement.cpp
+#   ksvg2/ecma/GlobalObject.cpp
+#   ksvg2/ecma/Ecma.cpp
     ksvg2/misc/SVGImageLoader.cpp
     ksvg2/misc/SVGDocumentExtensions.cpp
     ksvg2/misc/KSVGTimeScheduler.cpp
@@ -647,6 +647,10 @@ set (SVG_SOURCES
     ksvg2/events/SVGZoomEvent.cpp
     kcanvas/KCanvasTreeDebug.cpp
     kcanvas/KCanvasFilters.cpp
+    kcanvas/KCanvasClipper.cpp
+    kcanvas/KCanvasMarker.cpp
+    kcanvas/KCanvasMasker.cpp
+    kcanvas/KCanvasResource.cpp
     kcanvas/device/KRenderingPaintServerGradient.cpp
     kcanvas/device/KRenderingPaintServerSolid.cpp
     kcanvas/device/KRenderingPaintServerPattern.cpp
@@ -657,6 +661,7 @@ set (SVG_SOURCES
     kcanvas/device/qt/KRenderingPaintServerGradientQt.cpp
     kcanvas/device/qt/KRenderingPaintServerPatternQt.cpp
     kcanvas/device/qt/KRenderingPaintServerQt.cpp
+    kcanvas/device/qt/KCanvasClipperQt.cpp
 #   kcanvas/device/qt/KCanvasFilterQt.cpp
 #   kcanvas/device/qt/KCanvasImageItemQt.cpp
     rendering/RenderForeignObject.cpp
@@ -993,6 +998,7 @@ set(WebCore_SRCS
     platform/FloatSize.cpp
     platform/String.cpp
     platform/DeprecatedValueListImpl.cpp
+    platform/GraphicsTypes.cpp
     platform/IntRect.cpp
     platform/Arena.cpp
     platform/ArrayImpl.cpp
@@ -1007,12 +1013,14 @@ set(WebCore_SRCS
     platform/TextDecoder.cpp
     platform/TextEncoding.cpp
     platform/TextEncodingRegistry.cpp
+    platform/GraphicsContext.cpp
     platform/Logging.cpp
     platform/Color.cpp
     platform/DeprecatedPtrListImpl.cpp
     platform/KURL.cpp
     platform/StringImpl.cpp
     platform/FloatRect.cpp
+    platform/network/ResourceHandle.cpp
     platform/Path.cpp
     platform/qt/EditorClientQt.cpp
     platform/qt/SoundQt.cpp
@@ -1035,7 +1043,6 @@ set(WebCore_SRCS
     platform/qt/FontDataQt.cpp
     platform/qt/SharedTimerQt.cpp
     platform/qt/PopupMenuQt.cpp
-    platform/network/ResourceHandle.cpp
     platform/network/qt/ResourceHandleManager.cpp
     platform/network/qt/ResourceHandleQt.cpp
     platform/qt/FloatPointQt.cpp
@@ -1059,18 +1066,6 @@ set(WebCore_SRCS
     platform/qt/ScrollViewCanvasQt.cpp
     platform/qt/PlatformMouseEventQt.cpp
     platform/qt/PlatformKeyboardEventQt.cpp
-    platform/network/ResourceLoader.cpp
-    platform/network/qt/ResourceLoaderManager.cpp
-    platform/network/qt/ResourceLoaderQt.cpp
-    platform/graphics/GraphicsTypes.cpp
-    platform/graphics/GraphicsContext.cpp
-    platform/graphics/svg/SVGResource.cpp
-    platform/graphics/svg/SVGResourceClipper.cpp
-    platform/graphics/svg/SVGResourceMasker.cpp
-    platform/graphics/svg/SVGResourceMarker.cpp
-    platform/graphics/svg/qt/SVGResourceClipperQt.cpp
-    platform/graphics/svg/qt/SVGResourceImageQt.cpp
-    platform/graphics/svg/qt/SVGResourceMaskerQt.cpp
     platform/image-decoders/bmp/BMPImageDecoder.cpp
     platform/image-decoders/gif/GIFImageReader.cpp
     platform/image-decoders/gif/GIFImageDecoder.cpp
index 683507cd6a1b8b8dc7ae169c773489c4ca59ee18..99538cf4f51662d83a7115cd86ed6d300917e5fa 100644 (file)
@@ -1,41 +1,96 @@
-2006-10-31  Nikolas Zimmermann  <zimmermann@kde.org>
+2006-10-30  Oliver Hunt  <oliver@apple.com>
 
-        Reviewed by Oliver.
-
-        Fixes: http://bugs.webkit.org/show_bug.cgi?id=11436
-
-        Better SVG integration in WebKit, Part I.
-
-        The patch is mostly about creating a new platform/graphics directory, and
-        moving the kcanvas resources (clipper/masker/marker) there (in svg budir),
-        with a new name (KCanvasClipper -> SVGResourceClipper). Also fix several ownership
-        issues, by using ref counting (the SVG classes now store RefPtrs to the resources).
+        Reviewed by Anders.
 
-        KCanvasFilters is still left in kcanvas/ subdirectory, to be converted in a next patch.
-        All details of the patch, and upcoming patches can be found in the bug report.
+        Roll out last patch
 
         * CMakeLists.txt:
+        * ChangeLog:
         * WebCore.xcodeproj/project.pbxproj:
-        * kcanvas/KCanvasClipper.cpp: Removed.
-        * kcanvas/KCanvasClipper.h: Removed.
-        * kcanvas/KCanvasCreator.cpp: Removed.
-        * kcanvas/KCanvasCreator.h: Removed.
+        * graphics/svg/SVGResource.cpp:
+        * graphics/svg/SVGResourceClipper.cpp:
+        * graphics/svg/SVGResourceClipper.h:
+        * graphics/svg/SVGResourceImage.h:
+        * graphics/svg/SVGResourceListener.h:
+        * graphics/svg/SVGResourceMarker.cpp:
+        * graphics/svg/SVGResourceMarker.h:
+        * graphics/svg/SVGResourceMasker.cpp:
+        * graphics/svg/SVGResourceMasker.h:
+        * kcanvas/KCanvasClipper.cpp: Added.
+        (WebCore::operator<<):
+        (WebCore::KCanvasClipper::KCanvasClipper):
+        (WebCore::KCanvasClipper::~KCanvasClipper):
+        (WebCore::KCanvasClipper::resetClipData):
+        (WebCore::KCanvasClipper::addClipData):
+        (WebCore::KCanvasClipper::clipData):
+        (WebCore::KCanvasClipper::externalRepresentation):
+        (WebCore::getClipperById):
+        * kcanvas/KCanvasClipper.h: Added.
+        (WebCore::KCClipData::windRule):
+        (WebCore::KCClipDataList::KCClipDataList):
+        (WebCore::KCClipDataList::addPath):
+        (WebCore::KCanvasClipper::isClipper):
         * kcanvas/KCanvasFilters.cpp:
         (WebCore::getFilterById):
         * kcanvas/KCanvasFilters.h:
-        * kcanvas/KCanvasImage.h: Removed.
-        * kcanvas/KCanvasMarker.cpp: Removed.
-        * kcanvas/KCanvasMarker.h: Removed.
-        * kcanvas/KCanvasMasker.cpp: Removed.
-        * kcanvas/KCanvasMasker.h: Removed.
-        * kcanvas/KCanvasResource.cpp: Removed.
-        * kcanvas/KCanvasResource.h: Removed.
-        * kcanvas/KCanvasResourceListener.h: Removed.
+        * kcanvas/KCanvasImage.h: Added.
+        (WebCore::KCanvasImage::KCanvasImage):
+        (WebCore::KCanvasImage::~KCanvasImage):
+        * kcanvas/KCanvasMarker.cpp: Added.
+        (WebCore::KCanvasMarker::KCanvasMarker):
+        (WebCore::KCanvasMarker::~KCanvasMarker):
+        (WebCore::KCanvasMarker::setMarker):
+        (WebCore::KCanvasMarker::setRef):
+        (WebCore::KCanvasMarker::refX):
+        (WebCore::KCanvasMarker::refY):
+        (WebCore::KCanvasMarker::setAngle):
+        (WebCore::KCanvasMarker::angle):
+        (WebCore::KCanvasMarker::setAutoAngle):
+        (WebCore::KCanvasMarker::setUseStrokeWidth):
+        (WebCore::KCanvasMarker::useStrokeWidth):
+        (WebCore::KCanvasMarker::draw):
+        (WebCore::KCanvasMarker::externalRepresentation):
+        (WebCore::getMarkerById):
+        * kcanvas/KCanvasMarker.h: Added.
+        (WebCore::KCanvasMarker::isMarker):
+        * kcanvas/KCanvasMasker.cpp: Added.
+        (WebCore::KCanvasMasker::KCanvasMasker):
+        (WebCore::KCanvasMasker::~KCanvasMasker):
+        (WebCore::KCanvasMasker::setMask):
+        (WebCore::KCanvasMasker::externalRepresentation):
+        (WebCore::getMaskerById):
+        * kcanvas/KCanvasMasker.h: Added.
+        (WebCore::KCanvasMasker::isMasker):
+        (WebCore::KCanvasMasker::mask):
+        * kcanvas/KCanvasResource.cpp: Added.
+        (WebCore::operator<<):
+        (WebCore::KCanvasResource::KCanvasResource):
+        (WebCore::KCanvasResource::~KCanvasResource):
+        (WebCore::KCanvasResource::addClient):
+        (WebCore::KCanvasResource::clients):
+        (WebCore::KCanvasResource::invalidate):
+        (WebCore::KCanvasResource::idInRegistry):
+        (WebCore::KCanvasResource::setIdInRegistry):
+        (WebCore::KCanvasResource::externalRepresentation):
+        (WebCore::getResourceById):
+        (WebCore::getPaintServerById):
+        * kcanvas/KCanvasResource.h:
+        (WebCore::):
+        (WebCore::KCanvasResource::isPaintServer):
+        (WebCore::KCanvasResource::isFilter):
+        (WebCore::KCanvasResource::isClipper):
+        (WebCore::KCanvasResource::isMarker):
+        (WebCore::KCanvasResource::isMasker):
+        * kcanvas/KCanvasResourceListener.h: Added.
+        (KCanvasResourceListener::KCanvasResourceListener):
+        (KCanvasResourceListener::~KCanvasResourceListener):
         * kcanvas/KCanvasTreeDebug.cpp:
         (WebCore::writeRenderResources):
         * kcanvas/device/KRenderingDevice.h:
         * kcanvas/device/KRenderingPaintServer.h:
         (WebCore::KRenderingPaintServer::KRenderingPaintServer):
+        (WebCore::KRenderingPaintServer::idInRegistry):
+        (WebCore::KRenderingPaintServer::setIdInRegistry):
         * kcanvas/device/KRenderingPaintServerGradient.cpp:
         (WebCore::KRenderingPaintServerGradient::listener):
         (WebCore::KRenderingPaintServerGradient::setListener):
         (WebCore::KRenderingPaintServerPattern::setListener):
         * kcanvas/device/KRenderingPaintServerPattern.h:
         * kcanvas/device/KRenderingPaintServerSolid.h:
-        * kcanvas/device/qt/KCanvasClipperQt.cpp: Removed.
-        * kcanvas/device/qt/KCanvasClipperQt.h: Removed.
+        * kcanvas/device/qt/KCanvasClipperQt.cpp:
+        (WebCore::KCanvasClipperQt::applyClip):
+        * kcanvas/device/qt/KCanvasClipperQt.h:
+        (WebCore::KCanvasClipperQt::KCanvasClipperQt):
         * kcanvas/device/qt/KRenderingDeviceQt.cpp:
         (WebCore::KRenderingDeviceQt::contextForImage):
         (WebCore::KRenderingDeviceQt::createResource):
         * kcanvas/device/qt/KRenderingPaintServerPatternQt.cpp:
         * kcanvas/device/qt/KRenderingPaintServerQt.cpp:
         * kcanvas/device/qt/KRenderingPaintServerSolidQt.cpp:
-        * kcanvas/device/qt/RenderPathQt.h: Removed.
         * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
         (WebCore::KCanvasFilterQuartz::getCIFilterStack):
         * kcanvas/device/quartz/KCanvasItemQuartz.mm:
-        * kcanvas/device/quartz/KCanvasMaskerQuartz.h: Removed.
-        * kcanvas/device/quartz/KCanvasMaskerQuartz.mm: Removed.
-        * kcanvas/device/quartz/KCanvasResourcesQuartz.h: Removed.
-        * kcanvas/device/quartz/KCanvasResourcesQuartz.mm: Removed.
+        * kcanvas/device/quartz/KCanvasMaskerQuartz.h:
+        (WebCore::KCanvasMaskerQuartz::KCanvasMaskerQuartz):
+        * kcanvas/device/quartz/KCanvasMaskerQuartz.mm:
+        (WebCore::applyLuminanceToAlphaFilter):
+        (WebCore::applyExpandAlphatoGrayscaleFilter):
+        (WebCore::transformImageIntoGrayscaleMask):
+        (WebCore::KCanvasMaskerQuartz::applyMask):
+        * kcanvas/device/quartz/KCanvasResourcesQuartz.h:
+        (WebCore::KCanvasClipperQuartz::KCanvasClipperQuartz):
+        (WebCore::KCanvasImageQuartz::KCanvasImageQuartz):
+        (WebCore::KCanvasImageQuartz::init):
+        (WebCore::KCanvasImageQuartz::size):
+        * kcanvas/device/quartz/KCanvasResourcesQuartz.mm:
+        (WebCore::KCanvasClipperQuartz::applyClip):
+        (WebCore::KCanvasImageQuartz::~KCanvasImageQuartz):
+        (WebCore::KCanvasImageQuartz::cgLayer):
+        (WebCore::KCanvasImageQuartz::setCGLayer):
         * kcanvas/device/quartz/KRenderingDeviceQuartz.h:
         * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
         (WebCore::KRenderingDeviceQuartz::contextForImage):
         * ksvg2/svg/SVGRadialGradientElement.h:
         * ksvg2/svg/SVGStyledElement.h:
         (WebCore::SVGStyledElement::canvasResource):
-        * platform/GraphicsContext.cpp: Removed.
-        * platform/GraphicsContext.h: Removed.
-        * platform/GraphicsTypes.cpp: Removed.
-        * platform/GraphicsTypes.h: Removed.
-        * platform/graphics/GraphicsContext.cpp: Added.
+        * platform/GraphicsContext.cpp: Added.
         (WebCore::GraphicsContextState::GraphicsContextState):
         (WebCore::GraphicsContextPrivate::GraphicsContextPrivate):
         (WebCore::GraphicsContext::createGraphicsContextPrivate):
         (WebCore::GraphicsContext::focusRingOffset):
         (WebCore::GraphicsContext::focusRingRects):
         (WebCore::GraphicsContext::drawTiledImage):
-        * platform/graphics/GraphicsContext.h: Added.
-        * platform/graphics/GraphicsTypes.cpp: Added.
+        * platform/GraphicsContext.h: Added.
+        * platform/GraphicsTypes.cpp: Added.
         (WebCore::):
         (WebCore::parseCompositeOperator):
         (WebCore::compositeOperatorName):
         (WebCore::lineCapName):
         (WebCore::parseLineJoin):
         (WebCore::lineJoinName):
-        * platform/graphics/GraphicsTypes.h: Added.
-        (WebCore::):
-        * platform/graphics/svg/SVGResource.cpp: Added.
-        (WebCore::SVGResource::SVGResource):
-        (WebCore::SVGResource::~SVGResource):
-        (WebCore::SVGResource::invalidate):
-        (WebCore::SVGResource::addClient):
-        (WebCore::SVGResource::clients):
-        (WebCore::SVGResource::idInRegistry):
-        (WebCore::SVGResource::setIdInRegistry):
-        (WebCore::SVGResource::externalRepresentation):
-        (WebCore::getResourceById):
-        (WebCore::getPaintServerById):
-        (WebCore::operator<<):
-        * platform/graphics/svg/SVGResource.h: Added.
+        * platform/GraphicsTypes.h: Added.
         (WebCore::):
-        (WebCore::SVGResource::isPaintServer):
-        (WebCore::SVGResource::isFilter):
-        (WebCore::SVGResource::isClipper):
-        (WebCore::SVGResource::isMarker):
-        (WebCore::SVGResource::isMasker):
-        (WebCore::SVGResourceListener::~SVGResourceListener):
-        * platform/graphics/svg/SVGResourceClipper.cpp: Added.
-        (WebCore::SVGResourceClipper::SVGResourceClipper):
-        (WebCore::SVGResourceClipper::~SVGResourceClipper):
-        (WebCore::SVGResourceClipper::resetClipData):
-        (WebCore::SVGResourceClipper::addClipData):
-        (WebCore::SVGResourceClipper::clipData):
-        (WebCore::SVGResourceClipper::externalRepresentation):
-        (WebCore::operator<<):
-        (WebCore::getClipperById):
-        * platform/graphics/svg/SVGResourceClipper.h: Added.
-        (WebCore::ClipDataList::addPath):
-        (WebCore::SVGResourceClipper::isClipper):
-        * platform/graphics/svg/SVGResourceImage.h: Added.
-        * platform/graphics/svg/SVGResourceMarker.cpp: Added.
-        (WebCore::SVGResourceMarker::SVGResourceMarker):
-        (WebCore::SVGResourceMarker::~SVGResourceMarker):
-        (WebCore::SVGResourceMarker::setMarker):
-        (WebCore::SVGResourceMarker::setRef):
-        (WebCore::SVGResourceMarker::draw):
-        (WebCore::SVGResourceMarker::externalRepresentation):
-        (WebCore::getMarkerById):
-        * platform/graphics/svg/SVGResourceMarker.h: Added.
-        (WebCore::SVGResourceMarker::refX):
-        (WebCore::SVGResourceMarker::refY):
-        (WebCore::SVGResourceMarker::setAngle):
-        (WebCore::SVGResourceMarker::setAutoAngle):
-        (WebCore::SVGResourceMarker::angle):
-        (WebCore::SVGResourceMarker::setUseStrokeWidth):
-        (WebCore::SVGResourceMarker::useStrokeWidth):
-        (WebCore::SVGResourceMarker::isMarker):
-        * platform/graphics/svg/SVGResourceMasker.cpp: Added.
-        (WebCore::SVGResourceMasker::SVGResourceMasker):
-        (WebCore::SVGResourceMasker::~SVGResourceMasker):
-        (WebCore::SVGResourceMasker::setMask):
-        (WebCore::SVGResourceMasker::mask):
-        (WebCore::SVGResourceMasker::externalRepresentation):
-        (WebCore::getMaskerById):
-        * platform/graphics/svg/SVGResourceMasker.h: Added.
-        (WebCore::SVGResourceMasker::isMasker):
-        * platform/graphics/svg/cg/SVGResourceClipperCg.mm: Added.
-        (WebCore::SVGResourceClipper::applyClip):
-        * platform/graphics/svg/cg/SVGResourceImageCg.mm: Added.
-        (WebCore::SVGResourceImage::SVGResourceImage):
-        (WebCore::SVGResourceImage::~SVGResourceImage):
-        (WebCore::SVGResourceImage::init):
-        (WebCore::SVGResourceImage::size):
-        (WebCore::SVGResourceImage::cgLayer):
-        (WebCore::SVGResourceImage::setCGLayer):
-        * platform/graphics/svg/cg/SVGResourceMaskerCg.mm: Added.
-        (WebCore::applyLuminanceToAlphaFilter):
-        (WebCore::applyExpandAlphatoGrayscaleFilter):
-        (WebCore::transformImageIntoGrayscaleMask):
-        (WebCore::SVGResourceMasker::applyMask):
-        * platform/graphics/svg/qt/SVGResourceClipperQt.cpp: Added.
-        (WebCore::SVGResourceClipper::applyClip):
-        * platform/graphics/svg/qt/SVGResourceImageQt.cpp: Added.
-        (WebCore::SVGResourceImage::init):
-        (WebCore::SVGResourceImage::size):
-        * platform/graphics/svg/qt/SVGResourceMaskerQt.cpp: Added.
-        (WebCore::SVGResourceMasker::applyMask):
+        * platform/graphics/GraphicsContext.cpp:
+        * platform/graphics/GraphicsContext.h:
+        * platform/graphics/GraphicsTypes.cpp:
+        * platform/graphics/GraphicsTypes.h:
         * platform/qt/GraphicsContextQt.cpp:
         * rendering/RenderPath.cpp:
         (WebCore::RenderPath::paint):
index 4b87247b3d80ce4818a8b7c2c0ad60f794764634..4fd5c97c9fd3600d8f573c348e9ffb6036842bf7 100644 (file)
                9352088209BD45E900F2038D /* CookieJar.h in Headers */ = {isa = PBXBuildFile; fileRef = 9352088109BD45E900F2038D /* CookieJar.h */; };
                9353673F09AED79200D35CD6 /* ScrollBarMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 9353673E09AED79200D35CD6 /* ScrollBarMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
                9353676B09AED88B00D35CD6 /* ScrollViewMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9353676A09AED88B00D35CD6 /* ScrollViewMac.mm */; };
+               935367E509AF77DD00D35CD6 /* GraphicsContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 935367E409AF77DD00D35CD6 /* GraphicsContext.h */; };
                935367E909AF77EF00D35CD6 /* GraphicsContextMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 935367E809AF77EF00D35CD6 /* GraphicsContextMac.mm */; };
                9353686B09AF78F600D35CD6 /* TextDirection.h in Headers */ = {isa = PBXBuildFile; fileRef = 9353686A09AF78F600D35CD6 /* TextDirection.h */; settings = {ATTRIBUTES = (Private, ); }; };
                935C475D09AC4CA000A6AAB4 /* History.h in Headers */ = {isa = PBXBuildFile; fileRef = 935C475C09AC4CA000A6AAB4 /* History.h */; };
                938E65F709F0985D008A48EC /* JSHTMLElementWrapperFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 938E65F609F0985D008A48EC /* JSHTMLElementWrapperFactory.cpp */; };
                938E666009F09B81008A48EC /* JSHTMLCanvasElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 938E665F09F09B81008A48EC /* JSHTMLCanvasElement.cpp */; };
                938E666209F09B87008A48EC /* JSHTMLCanvasElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 938E666109F09B87008A48EC /* JSHTMLCanvasElement.h */; };
+               938E683C09F0BD7B008A48EC /* GraphicsTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 938E683B09F0BD7A008A48EC /* GraphicsTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               938E685409F0BE04008A48EC /* GraphicsTypes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 938E685309F0BE04008A48EC /* GraphicsTypes.cpp */; };
                9392F1420AD185F400691BD4 /* RenderCounter.h in Headers */ = {isa = PBXBuildFile; fileRef = 9392F1410AD185F400691BD4 /* RenderCounter.h */; };
                9392F1440AD185FE00691BD4 /* RenderCounter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9392F1430AD185FE00691BD4 /* RenderCounter.cpp */; };
                9392F1460AD1860C00691BD4 /* CounterResetNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 9392F1450AD1860C00691BD4 /* CounterResetNode.h */; };
                A81369E5097374F600D74463 /* HTMLKeygenElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A81369C9097374F600D74463 /* HTMLKeygenElement.cpp */; };
                A8136D380973A8E700D74463 /* FormDataList.h in Headers */ = {isa = PBXBuildFile; fileRef = A8136D360973A8E700D74463 /* FormDataList.h */; };
                A8136D390973A8E700D74463 /* FormDataList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8136D370973A8E700D74463 /* FormDataList.cpp */; };
+               A81655D4096BBEAC00601058 /* KCanvasMaskerQuartz.h in Headers */ = {isa = PBXBuildFile; fileRef = A81655D2096BBEAC00601058 /* KCanvasMaskerQuartz.h */; };
+               A81655D5096BBEAC00601058 /* KCanvasMaskerQuartz.mm in Sources */ = {isa = PBXBuildFile; fileRef = A81655D3096BBEAC00601058 /* KCanvasMaskerQuartz.mm */; };
                A81655E4096BC13900601058 /* SVGMaskElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A81655E2096BC13900601058 /* SVGMaskElement.cpp */; };
                A81655E5096BC13900601058 /* SVGMaskElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A81655E3096BC13900601058 /* SVGMaskElement.h */; };
                A8185F3909765766005826D9 /* DocumentType.h in Headers */ = {isa = PBXBuildFile; fileRef = A8185F3109765765005826D9 /* DocumentType.h */; };
                A82398A809B3ACF500B60641 /* PlugInInfoStoreMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A82398A709B3ACF500B60641 /* PlugInInfoStoreMac.mm */; };
                A8239E0009B3CF8A00B60641 /* Logging.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8239DFE09B3CF8A00B60641 /* Logging.cpp */; };
                A8239E0109B3CF8A00B60641 /* Logging.h in Headers */ = {isa = PBXBuildFile; fileRef = A8239DFF09B3CF8A00B60641 /* Logging.h */; };
+               A823A75C09B6E53900B60641 /* GraphicsContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A823A75B09B6E53900B60641 /* GraphicsContext.cpp */; };
                A826E8AE0A1A8F2300CD1BB6 /* JSHTMLOptionElementConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = A826E8AC0A1A8F2300CD1BB6 /* JSHTMLOptionElementConstructor.h */; };
                A826EC480A1B0CBE00CD1BB6 /* JSHTMLOptionElementConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A826E8AD0A1A8F2300CD1BB6 /* JSHTMLOptionElementConstructor.cpp */; };
                A833C7CA0A2CF06B00D57664 /* SVGNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 656581E809D1508D000E61D7 /* SVGNames.cpp */; };
                A833C80C0A2CF25600D57664 /* XMLNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A833C80A0A2CF25600D57664 /* XMLNames.cpp */; };
                A833C80D0A2CF25600D57664 /* XMLNames.h in Headers */ = {isa = PBXBuildFile; fileRef = A833C80B0A2CF25600D57664 /* XMLNames.h */; };
                A833C8520A2CF52800D57664 /* SVGElementFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 656581E609D1508D000E61D7 /* SVGElementFactory.cpp */; };
+               A8415F9A0AC10C5D00F7D0DF /* KCanvasClipper.h in Headers */ = {isa = PBXBuildFile; fileRef = A8415F910AC10C5D00F7D0DF /* KCanvasClipper.h */; };
+               A8415F9B0AC10C5D00F7D0DF /* KCanvasClipper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8415F920AC10C5D00F7D0DF /* KCanvasClipper.cpp */; };
+               A8415F9C0AC10C5D00F7D0DF /* KCanvasResource.h in Headers */ = {isa = PBXBuildFile; fileRef = A8415F930AC10C5D00F7D0DF /* KCanvasResource.h */; };
+               A8415F9D0AC10C5D00F7D0DF /* KCanvasResource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8415F940AC10C5D00F7D0DF /* KCanvasResource.cpp */; };
+               A8415F9E0AC10C5D00F7D0DF /* KCanvasMasker.h in Headers */ = {isa = PBXBuildFile; fileRef = A8415F950AC10C5D00F7D0DF /* KCanvasMasker.h */; };
+               A8415F9F0AC10C5D00F7D0DF /* KCanvasMasker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8415F960AC10C5D00F7D0DF /* KCanvasMasker.cpp */; };
+               A8415FA00AC10C5D00F7D0DF /* KCanvasMarker.h in Headers */ = {isa = PBXBuildFile; fileRef = A8415F970AC10C5D00F7D0DF /* KCanvasMarker.h */; };
+               A8415FA10AC10C5D00F7D0DF /* KCanvasMarker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8415F980AC10C5D00F7D0DF /* KCanvasMarker.cpp */; };
                A8415FA20AC10C5D00F7D0DF /* KCanvasFilters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8415F990AC10C5D00F7D0DF /* KCanvasFilters.cpp */; };
                A86629CF09DA2B47009633A5 /* JSUIEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A86629C909DA2B47009633A5 /* JSUIEvent.h */; };
                A86629D009DA2B48009633A5 /* JSUIEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A86629CA09DA2B47009633A5 /* JSUIEvent.cpp */; };
                A88AD3AA0952486D001DD196 /* KCanvasFilterQuartz.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0FB69089701F800BA5114 /* KCanvasFilterQuartz.h */; };
                A88AD3AB0952486D001DD196 /* KCanvasFilterQuartz.mm in Sources */ = {isa = PBXBuildFile; fileRef = A8C0FB6A089701F800BA5114 /* KCanvasFilterQuartz.mm */; };
                A88AD3AD0952486D001DD196 /* KCanvasItemQuartz.mm in Sources */ = {isa = PBXBuildFile; fileRef = A8C0FB6C089701F800BA5114 /* KCanvasItemQuartz.mm */; };
+               A88AD3AE0952486D001DD196 /* KCanvasResourcesQuartz.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0FB6D089701F800BA5114 /* KCanvasResourcesQuartz.h */; };
+               A88AD3AF0952486D001DD196 /* KCanvasResourcesQuartz.mm in Sources */ = {isa = PBXBuildFile; fileRef = A8C0FB6E089701F800BA5114 /* KCanvasResourcesQuartz.mm */; };
                A88AD3B00952486E001DD196 /* KRenderingDeviceQuartz.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0FB71089701F800BA5114 /* KRenderingDeviceQuartz.h */; };
                A88AD3B10952486E001DD196 /* KRenderingDeviceQuartz.mm in Sources */ = {isa = PBXBuildFile; fileRef = A8C0FB72089701F800BA5114 /* KRenderingDeviceQuartz.mm */; };
                A88AD3B20952486E001DD196 /* KRenderingPaintServerGradientQuartz.mm in Sources */ = {isa = PBXBuildFile; fileRef = A8C0FB73089701F800BA5114 /* KRenderingPaintServerGradientQuartz.mm */; };
                A88AD3B50952486E001DD196 /* QuartzSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0FB76089701F800BA5114 /* QuartzSupport.h */; };
                A88AD3B60952486E001DD196 /* QuartzSupport.mm in Sources */ = {isa = PBXBuildFile; fileRef = A8C0FB77089701F800BA5114 /* QuartzSupport.mm */; };
                A88AD3BE0952486E001DD196 /* KCanvasFilters.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0FB7F089701F800BA5114 /* KCanvasFilters.h */; };
+               A88AD3C00952486E001DD196 /* KCanvasImage.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0FB81089701F800BA5114 /* KCanvasImage.h */; };
+               A88AD3C70952486E001DD196 /* KCanvasResourceListener.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0FB89089701F800BA5114 /* KCanvasResourceListener.h */; };
                A88AD3CB0952486E001DD196 /* KCanvasTreeDebug.h in Headers */ = {isa = PBXBuildFile; fileRef = A810E39308A4160F00333D98 /* KCanvasTreeDebug.h */; };
                A88AD3CC0952486E001DD196 /* KCanvasTreeDebug.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A810E39408A4160F00333D98 /* KCanvasTreeDebug.cpp */; };
                A88AD401095248F0001DD196 /* SVGRenderStyle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0F6FF089701F100BA5114 /* SVGRenderStyle.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 */; };
-               B2A015A80AF6CD53006BCE0E /* GraphicsContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2A015920AF6CD53006BCE0E /* GraphicsContext.cpp */; };
-               B2A015A90AF6CD53006BCE0E /* GraphicsContext.h in Headers */ = {isa = PBXBuildFile; fileRef = B2A015930AF6CD53006BCE0E /* GraphicsContext.h */; };
-               B2A015AA0AF6CD53006BCE0E /* GraphicsTypes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2A015940AF6CD53006BCE0E /* GraphicsTypes.cpp */; };
-               B2A015AB0AF6CD53006BCE0E /* GraphicsTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = B2A015950AF6CD53006BCE0E /* GraphicsTypes.h */; };
-               B2A015AC0AF6CD53006BCE0E /* SVGResourceClipperCg.mm in Sources */ = {isa = PBXBuildFile; fileRef = B2A015980AF6CD53006BCE0E /* SVGResourceClipperCg.mm */; };
-               B2A015AD0AF6CD53006BCE0E /* SVGResourceImageCg.mm in Sources */ = {isa = PBXBuildFile; fileRef = B2A015990AF6CD53006BCE0E /* SVGResourceImageCg.mm */; };
-               B2A015AE0AF6CD53006BCE0E /* SVGResourceMaskerCg.mm in Sources */ = {isa = PBXBuildFile; fileRef = B2A0159A0AF6CD53006BCE0E /* SVGResourceMaskerCg.mm */; };
-               B2A015B20AF6CD53006BCE0E /* SVGResource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2A0159F0AF6CD53006BCE0E /* SVGResource.cpp */; };
-               B2A015B30AF6CD53006BCE0E /* SVGResource.h in Headers */ = {isa = PBXBuildFile; fileRef = B2A015A00AF6CD53006BCE0E /* SVGResource.h */; };
-               B2A015B40AF6CD53006BCE0E /* SVGResourceClipper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2A015A10AF6CD53006BCE0E /* SVGResourceClipper.cpp */; };
-               B2A015B50AF6CD53006BCE0E /* SVGResourceClipper.h in Headers */ = {isa = PBXBuildFile; fileRef = B2A015A20AF6CD53006BCE0E /* SVGResourceClipper.h */; };
-               B2A015B60AF6CD53006BCE0E /* SVGResourceImage.h in Headers */ = {isa = PBXBuildFile; fileRef = B2A015A30AF6CD53006BCE0E /* SVGResourceImage.h */; };
-               B2A015B70AF6CD53006BCE0E /* SVGResourceMarker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2A015A40AF6CD53006BCE0E /* SVGResourceMarker.cpp */; };
-               B2A015B80AF6CD53006BCE0E /* SVGResourceMarker.h in Headers */ = {isa = PBXBuildFile; fileRef = B2A015A50AF6CD53006BCE0E /* SVGResourceMarker.h */; };
-               B2A015B90AF6CD53006BCE0E /* SVGResourceMasker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2A015A60AF6CD53006BCE0E /* SVGResourceMasker.cpp */; };
-               B2A015BA0AF6CD53006BCE0E /* SVGResourceMasker.h in Headers */ = {isa = PBXBuildFile; fileRef = B2A015A70AF6CD53006BCE0E /* SVGResourceMasker.h */; };
                B2CB41930AB75904004D9C45 /* SVGRenderingIntent.h in Headers */ = {isa = PBXBuildFile; fileRef = B2CB414C0AB75904004D9C45 /* SVGRenderingIntent.h */; };
                B2CB41A60AB75904004D9C45 /* SVGUnitTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = B2CB415F0AB75904004D9C45 /* SVGUnitTypes.h */; };
                B2FA3D360AB75A6F000E5AC4 /* JSSVGAnimateColorElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2FA3C4E0AB75A6E000E5AC4 /* JSSVGAnimateColorElement.cpp */; };
                9352088109BD45E900F2038D /* CookieJar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CookieJar.h; sourceTree = "<group>"; };
                9353673E09AED79200D35CD6 /* ScrollBarMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollBarMode.h; sourceTree = "<group>"; };
                9353676A09AED88B00D35CD6 /* ScrollViewMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ScrollViewMac.mm; sourceTree = "<group>"; };
+               935367E409AF77DD00D35CD6 /* GraphicsContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicsContext.h; sourceTree = "<group>"; };
                935367E809AF77EF00D35CD6 /* GraphicsContextMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GraphicsContextMac.mm; sourceTree = "<group>"; };
                9353686A09AF78F600D35CD6 /* TextDirection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextDirection.h; sourceTree = "<group>"; };
                935C475C09AC4CA000A6AAB4 /* History.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = History.h; sourceTree = "<group>"; };
                938E662509F09956008A48EC /* HTMLCanvasElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLCanvasElement.idl; sourceTree = "<group>"; };
                938E665F09F09B81008A48EC /* JSHTMLCanvasElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLCanvasElement.cpp; sourceTree = "<group>"; };
                938E666109F09B87008A48EC /* JSHTMLCanvasElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSHTMLCanvasElement.h; sourceTree = "<group>"; };
+               938E683B09F0BD7A008A48EC /* GraphicsTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicsTypes.h; sourceTree = "<group>"; };
+               938E685309F0BE04008A48EC /* GraphicsTypes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsTypes.cpp; sourceTree = "<group>"; };
                9392F1410AD185F400691BD4 /* RenderCounter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderCounter.h; sourceTree = "<group>"; };
                9392F1430AD185FE00691BD4 /* RenderCounter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderCounter.cpp; sourceTree = "<group>"; };
                9392F1450AD1860C00691BD4 /* CounterResetNode.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CounterResetNode.h; sourceTree = "<group>"; };
                A81369C9097374F600D74463 /* HTMLKeygenElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLKeygenElement.cpp; sourceTree = "<group>"; };
                A8136D360973A8E700D74463 /* FormDataList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FormDataList.h; sourceTree = "<group>"; };
                A8136D370973A8E700D74463 /* FormDataList.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FormDataList.cpp; sourceTree = "<group>"; };
+               A81655D2096BBEAC00601058 /* KCanvasMaskerQuartz.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = KCanvasMaskerQuartz.h; sourceTree = "<group>"; };
+               A81655D3096BBEAC00601058 /* KCanvasMaskerQuartz.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = KCanvasMaskerQuartz.mm; sourceTree = "<group>"; };
                A81655E2096BC13900601058 /* SVGMaskElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGMaskElement.cpp; sourceTree = "<group>"; };
                A81655E3096BC13900601058 /* SVGMaskElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGMaskElement.h; sourceTree = "<group>"; };
                A8185F3109765765005826D9 /* DocumentType.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DocumentType.h; sourceTree = "<group>"; };
                A82398A709B3ACF500B60641 /* PlugInInfoStoreMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = PlugInInfoStoreMac.mm; sourceTree = "<group>"; };
                A8239DFE09B3CF8A00B60641 /* Logging.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Logging.cpp; sourceTree = "<group>"; };
                A8239DFF09B3CF8A00B60641 /* Logging.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Logging.h; sourceTree = "<group>"; };
+               A823A75B09B6E53900B60641 /* GraphicsContext.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContext.cpp; sourceTree = "<group>"; };
                A826E8AC0A1A8F2300CD1BB6 /* JSHTMLOptionElementConstructor.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLOptionElementConstructor.h; sourceTree = "<group>"; };
                A826E8AD0A1A8F2300CD1BB6 /* JSHTMLOptionElementConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLOptionElementConstructor.cpp; sourceTree = "<group>"; };
                A82FC33B08CBB07C00EFEE23 /* SVGCursorElement.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = SVGCursorElement.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A833C7F60A2CF1D800D57664 /* xmlattrs.in */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = xmlattrs.in; sourceTree = "<group>"; };
                A833C80A0A2CF25600D57664 /* XMLNames.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = XMLNames.cpp; sourceTree = "<group>"; };
                A833C80B0A2CF25600D57664 /* XMLNames.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = XMLNames.h; sourceTree = "<group>"; };
+               A8415F910AC10C5D00F7D0DF /* KCanvasClipper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KCanvasClipper.h; sourceTree = "<group>"; };
+               A8415F920AC10C5D00F7D0DF /* KCanvasClipper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KCanvasClipper.cpp; sourceTree = "<group>"; };
+               A8415F930AC10C5D00F7D0DF /* KCanvasResource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KCanvasResource.h; sourceTree = "<group>"; };
+               A8415F940AC10C5D00F7D0DF /* KCanvasResource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KCanvasResource.cpp; sourceTree = "<group>"; };
+               A8415F950AC10C5D00F7D0DF /* KCanvasMasker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KCanvasMasker.h; sourceTree = "<group>"; };
+               A8415F960AC10C5D00F7D0DF /* KCanvasMasker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KCanvasMasker.cpp; sourceTree = "<group>"; };
+               A8415F970AC10C5D00F7D0DF /* KCanvasMarker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KCanvasMarker.h; sourceTree = "<group>"; };
+               A8415F980AC10C5D00F7D0DF /* KCanvasMarker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KCanvasMarker.cpp; sourceTree = "<group>"; };
                A8415F990AC10C5D00F7D0DF /* KCanvasFilters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KCanvasFilters.cpp; sourceTree = "<group>"; };
                A85D7A2F0879EBA9006A9172 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = /System/Library/Frameworks/QuartzCore.framework; sourceTree = "<absolute>"; };
                A85D7A8C0879EC64006A9172 /* AffineTransform.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AffineTransform.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8C0FB69089701F800BA5114 /* KCanvasFilterQuartz.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KCanvasFilterQuartz.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8C0FB6A089701F800BA5114 /* KCanvasFilterQuartz.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KCanvasFilterQuartz.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8C0FB6C089701F800BA5114 /* KCanvasItemQuartz.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KCanvasItemQuartz.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+               A8C0FB6D089701F800BA5114 /* KCanvasResourcesQuartz.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KCanvasResourcesQuartz.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+               A8C0FB6E089701F800BA5114 /* KCanvasResourcesQuartz.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KCanvasResourcesQuartz.mm; 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.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KRenderingDeviceQuartz.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8C0FB73089701F800BA5114 /* KRenderingPaintServerGradientQuartz.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KRenderingPaintServerGradientQuartz.mm; 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.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = QuartzSupport.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8C0FB7F089701F800BA5114 /* KCanvasFilters.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KCanvasFilters.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+               A8C0FB81089701F800BA5114 /* KCanvasImage.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KCanvasImage.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+               A8C0FB89089701F800BA5114 /* KCanvasResourceListener.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KCanvasResourceListener.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8C32920093BB732000B9CAC /* WKArithmeticFilter.cikernel */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = text; path = WKArithmeticFilter.cikernel; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8C32921093BB732000B9CAC /* WKArithmeticFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WKArithmeticFilter.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8C32922093BB732000B9CAC /* WKArithmeticFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WKArithmeticFilter.m; 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>"; };
-               B2A015920AF6CD53006BCE0E /* GraphicsContext.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContext.cpp; sourceTree = "<group>"; };
-               B2A015930AF6CD53006BCE0E /* GraphicsContext.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = GraphicsContext.h; sourceTree = "<group>"; };
-               B2A015940AF6CD53006BCE0E /* GraphicsTypes.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsTypes.cpp; sourceTree = "<group>"; };
-               B2A015950AF6CD53006BCE0E /* GraphicsTypes.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = GraphicsTypes.h; sourceTree = "<group>"; };
-               B2A015980AF6CD53006BCE0E /* SVGResourceClipperCg.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = SVGResourceClipperCg.mm; sourceTree = "<group>"; };
-               B2A015990AF6CD53006BCE0E /* SVGResourceImageCg.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = SVGResourceImageCg.mm; sourceTree = "<group>"; };
-               B2A0159A0AF6CD53006BCE0E /* SVGResourceMaskerCg.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = SVGResourceMaskerCg.mm; sourceTree = "<group>"; };
-               B2A0159F0AF6CD53006BCE0E /* SVGResource.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGResource.cpp; sourceTree = "<group>"; };
-               B2A015A00AF6CD53006BCE0E /* SVGResource.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGResource.h; sourceTree = "<group>"; };
-               B2A015A10AF6CD53006BCE0E /* SVGResourceClipper.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGResourceClipper.cpp; sourceTree = "<group>"; };
-               B2A015A20AF6CD53006BCE0E /* SVGResourceClipper.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGResourceClipper.h; sourceTree = "<group>"; };
-               B2A015A30AF6CD53006BCE0E /* SVGResourceImage.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGResourceImage.h; sourceTree = "<group>"; };
-               B2A015A40AF6CD53006BCE0E /* SVGResourceMarker.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGResourceMarker.cpp; sourceTree = "<group>"; };
-               B2A015A50AF6CD53006BCE0E /* SVGResourceMarker.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGResourceMarker.h; sourceTree = "<group>"; };
-               B2A015A60AF6CD53006BCE0E /* SVGResourceMasker.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGResourceMasker.cpp; sourceTree = "<group>"; };
-               B2A015A70AF6CD53006BCE0E /* SVGResourceMasker.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGResourceMasker.h; sourceTree = "<group>"; };
                B2CB41010AB758E6004D9C45 /* SVGAElement.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGAElement.idl; sourceTree = "<group>"; };
                B2CB41020AB758E6004D9C45 /* SVGAnimateColorElement.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGAnimateColorElement.idl; sourceTree = "<group>"; };
                B2CB41030AB758E6004D9C45 /* SVGAnimatedLengthList.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGAnimatedLengthList.idl; sourceTree = "<group>"; };
                        isa = PBXGroup;
                        children = (
                                A8C0FB53089701F700BA5114 /* device */,
+                               A8415F920AC10C5D00F7D0DF /* KCanvasClipper.cpp */,
+                               A8415F910AC10C5D00F7D0DF /* KCanvasClipper.h */,
                                A8415F990AC10C5D00F7D0DF /* KCanvasFilters.cpp */,
                                A8C0FB7F089701F800BA5114 /* KCanvasFilters.h */,
+                               A8C0FB81089701F800BA5114 /* KCanvasImage.h */,
+                               A8415F980AC10C5D00F7D0DF /* KCanvasMarker.cpp */,
+                               A8415F970AC10C5D00F7D0DF /* KCanvasMarker.h */,
+                               A8415F960AC10C5D00F7D0DF /* KCanvasMasker.cpp */,
+                               A8415F950AC10C5D00F7D0DF /* KCanvasMasker.h */,
+                               A8415F940AC10C5D00F7D0DF /* KCanvasResource.cpp */,
+                               A8415F930AC10C5D00F7D0DF /* KCanvasResource.h */,
+                               A8C0FB89089701F800BA5114 /* KCanvasResourceListener.h */,
                                A810E39408A4160F00333D98 /* KCanvasTreeDebug.cpp */,
                                A810E39308A4160F00333D98 /* KCanvasTreeDebug.h */,
                        );
                                A8C0FB69089701F800BA5114 /* KCanvasFilterQuartz.h */,
                                A8C0FB6A089701F800BA5114 /* KCanvasFilterQuartz.mm */,
                                A8C0FB6C089701F800BA5114 /* KCanvasItemQuartz.mm */,
+                               A81655D2096BBEAC00601058 /* KCanvasMaskerQuartz.h */,
+                               A81655D3096BBEAC00601058 /* KCanvasMaskerQuartz.mm */,
+                               A8C0FB6D089701F800BA5114 /* KCanvasResourcesQuartz.h */,
+                               A8C0FB6E089701F800BA5114 /* KCanvasResourcesQuartz.mm */,
                                A8C0FB71089701F800BA5114 /* KRenderingDeviceQuartz.h */,
                                A8C0FB72089701F800BA5114 /* KRenderingDeviceQuartz.mm */,
                                A8C0FB73089701F800BA5114 /* KRenderingPaintServerGradientQuartz.mm */,
                        path = filters;
                        sourceTree = "<group>";
                };
-               B2A015910AF6CD53006BCE0E /* graphics */ = {
-                       isa = PBXGroup;
-                       children = (
-                               B2A015920AF6CD53006BCE0E /* GraphicsContext.cpp */,
-                               B2A015930AF6CD53006BCE0E /* GraphicsContext.h */,
-                               B2A015940AF6CD53006BCE0E /* GraphicsTypes.cpp */,
-                               B2A015950AF6CD53006BCE0E /* GraphicsTypes.h */,
-                               B2A015960AF6CD53006BCE0E /* svg */,
-                       );
-                       path = graphics;
-                       sourceTree = "<group>";
-               };
-               B2A015960AF6CD53006BCE0E /* svg */ = {
-                       isa = PBXGroup;
-                       children = (
-                               B2A015970AF6CD53006BCE0E /* cg */,
-                               B2A0159F0AF6CD53006BCE0E /* SVGResource.cpp */,
-                               B2A015A00AF6CD53006BCE0E /* SVGResource.h */,
-                               B2A015A10AF6CD53006BCE0E /* SVGResourceClipper.cpp */,
-                               B2A015A20AF6CD53006BCE0E /* SVGResourceClipper.h */,
-                               B2A015A30AF6CD53006BCE0E /* SVGResourceImage.h */,
-                               B2A015A40AF6CD53006BCE0E /* SVGResourceMarker.cpp */,
-                               B2A015A50AF6CD53006BCE0E /* SVGResourceMarker.h */,
-                               B2A015A60AF6CD53006BCE0E /* SVGResourceMasker.cpp */,
-                               B2A015A70AF6CD53006BCE0E /* SVGResourceMasker.h */,
-                       );
-                       path = svg;
-                       sourceTree = "<group>";
-               };
-               B2A015970AF6CD53006BCE0E /* cg */ = {
-                       isa = PBXGroup;
-                       children = (
-                               B2A015980AF6CD53006BCE0E /* SVGResourceClipperCg.mm */,
-                               B2A015990AF6CD53006BCE0E /* SVGResourceImageCg.mm */,
-                               B2A0159A0AF6CD53006BCE0E /* SVGResourceMaskerCg.mm */,
-                       );
-                       path = cg;
-                       sourceTree = "<group>";
-               };
                BC1A3790097C6F970019F3D8 /* bindings */ = {
                        isa = PBXGroup;
                        children = (
                BCF1A5BA097832090061A123 /* platform */ = {
                        isa = PBXGroup;
                        children = (
-                               B2A015910AF6CD53006BCE0E /* graphics */,
                                656B84D70AEA1CE900A095B4 /* network */,
                                1AE42F670AA4B8CB00C8612D /* cf */,
                                93032CCC09AEC36200F82A18 /* cg */,
                                BC6DB3680A1A7CB700E5CD14 /* GlyphMap.h */,
                                BCC089550A1C4CC9006189A6 /* GlyphWidthMap.cpp */,
                                BCC089290A1C4991006189A6 /* GlyphWidthMap.h */,
+                               A823A75B09B6E53900B60641 /* GraphicsContext.cpp */,
+                               935367E409AF77DD00D35CD6 /* GraphicsContext.h */,
+                               938E685309F0BE04008A48EC /* GraphicsTypes.cpp */,
+                               938E683B09F0BD7A008A48EC /* GraphicsTypes.h */,
                                066C773B0AB6052700238CC4 /* Icon.h */,
                                BC6B7BAE0993603C0052867B /* Image.cpp */,
                                BCD75ABB0989A446003E28DF /* Image.h */,
                                A88AD3A50952486D001DD196 /* WKSpecularLightingFilter.h in Headers */,
                                A88AD3A80952486D001DD196 /* WKSpotLightFilter.h in Headers */,
                                A88AD3AA0952486D001DD196 /* KCanvasFilterQuartz.h in Headers */,
+                               A88AD3AE0952486D001DD196 /* KCanvasResourcesQuartz.h in Headers */,
                                A88AD3B00952486E001DD196 /* KRenderingDeviceQuartz.h in Headers */,
                                A88AD3B30952486E001DD196 /* KRenderingPaintServerQuartz.h in Headers */,
                                A88AD3B50952486E001DD196 /* QuartzSupport.h in Headers */,
                                A88AD3BE0952486E001DD196 /* KCanvasFilters.h in Headers */,
+                               A88AD3C00952486E001DD196 /* KCanvasImage.h in Headers */,
+                               A88AD3C70952486E001DD196 /* KCanvasResourceListener.h in Headers */,
                                A88AD3CB0952486E001DD196 /* KCanvasTreeDebug.h in Headers */,
                                A88AD402095248F0001DD196 /* SVGRenderStyle.h in Headers */,
                                A88AD404095248F0001DD196 /* SVGRenderStyleDefs.h in Headers */,
                                A88AD50C095248F0001DD196 /* SVGZoomAndPan.h in Headers */,
                                A88AD50D095248F0001DD196 /* ksvg.h in Headers */,
                                6552E7AA096AA11B0006F248 /* WebCoreFrameNamespaces.h in Headers */,
+                               A81655D4096BBEAC00601058 /* KCanvasMaskerQuartz.h in Headers */,
                                A81655E5096BC13900601058 /* SVGMaskElement.h in Headers */,
                                A81369CA097374F600D74463 /* HTMLIsIndexElement.h in Headers */,
                                A81369CC097374F600D74463 /* HTMLInputElement.h in Headers */,
                                6593923809AE4346002C531F /* KURL.h in Headers */,
                                BC6D6DD309AF906600F59759 /* Font.h in Headers */,
                                9353673F09AED79200D35CD6 /* ScrollBarMode.h in Headers */,
+                               935367E509AF77DD00D35CD6 /* GraphicsContext.h in Headers */,
                                9353686B09AF78F600D35CD6 /* TextDirection.h in Headers */,
                                657BD74E09AFDC54005A2056 /* TextCodec.h in Headers */,
                                657BD75009AFDC54005A2056 /* TextEncoding.h in Headers */,
                                14CF7B3409F6ECD700EB3665 /* JSCSSRule.h in Headers */,
                                938E65F109F09840008A48EC /* JSHTMLElementWrapperFactory.h in Headers */,
                                938E666209F09B87008A48EC /* JSHTMLCanvasElement.h in Headers */,
+                               938E683C09F0BD7B008A48EC /* GraphicsTypes.h in Headers */,
                                8116896009F2A4A000772CA0 /* SVGTRefElement.h in Headers */,
                                14115B5209F84B7100CA4FC1 /* Node.h in Headers */,
                                14115B7309F84CD600CA4FC1 /* JSNodeFilter.h in Headers */,
                                851EE8210ABCA58100A6AA33 /* DOMRangeException.h in Headers */,
                                858015CE0ABCA75D0080588D /* DOMXPathException.h in Headers */,
                                85C78A680ABDE1B40044FC16 /* DOMException.h in Headers */,
+                               A8415F9A0AC10C5D00F7D0DF /* KCanvasClipper.h in Headers */,
+                               A8415F9C0AC10C5D00F7D0DF /* KCanvasResource.h in Headers */,
+                               A8415F9E0AC10C5D00F7D0DF /* KCanvasMasker.h in Headers */,
+                               A8415FA00AC10C5D00F7D0DF /* KCanvasMarker.h in Headers */,
                                BC3FCAA90AC3DB5800BA54AD /* PlatformScrollBar.h in Headers */,
                                85E7118D0AC5D5350053270F /* DOMAttrInternal.h in Headers */,
                                85E7118E0AC5D5350053270F /* DOMCDATASectionInternal.h in Headers */,
                                93E22A730AF5E94C00D48324 /* PageState.h in Headers */,
                                658821660AF4CDF700F01D1F /* ResourceResponse.h in Headers */,
                                6588216B0AF4CE1200F01D1F /* ResourceResponseMac.h in Headers */,
-                               B2A015A90AF6CD53006BCE0E /* GraphicsContext.h in Headers */,
-                               B2A015AB0AF6CD53006BCE0E /* GraphicsTypes.h in Headers */,
-                               B2A015B30AF6CD53006BCE0E /* SVGResource.h in Headers */,
-                               B2A015B50AF6CD53006BCE0E /* SVGResourceClipper.h in Headers */,
-                               B2A015B60AF6CD53006BCE0E /* SVGResourceImage.h in Headers */,
-                               B2A015B80AF6CD53006BCE0E /* SVGResourceMarker.h in Headers */,
-                               B2A015BA0AF6CD53006BCE0E /* SVGResourceMasker.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                A88AD3A90952486D001DD196 /* WKSpotLightFilter.m in Sources */,
                                A88AD3AB0952486D001DD196 /* KCanvasFilterQuartz.mm in Sources */,
                                A88AD3AD0952486D001DD196 /* KCanvasItemQuartz.mm in Sources */,
+                               A88AD3AF0952486D001DD196 /* KCanvasResourcesQuartz.mm in Sources */,
                                A88AD3B10952486E001DD196 /* KRenderingDeviceQuartz.mm in Sources */,
                                A88AD3B20952486E001DD196 /* KRenderingPaintServerGradientQuartz.mm in Sources */,
                                A88AD3B40952486E001DD196 /* KRenderingPaintServerQuartz.mm in Sources */,
                                A88AD50B095248F0001DD196 /* SVGZoomAndPan.cpp in Sources */,
                                A88AD5AA09525131001DD196 /* SVGCSSStyleSelector.cpp in Sources */,
                                6552E7AB096AA11B0006F248 /* WebCoreFrameNamespaces.mm in Sources */,
+                               A81655D5096BBEAC00601058 /* KCanvasMaskerQuartz.mm in Sources */,
                                A81655E4096BC13900601058 /* SVGMaskElement.cpp in Sources */,
                                A81369CB097374F600D74463 /* HTMLIsIndexElement.cpp in Sources */,
                                A81369CD097374F600D74463 /* HTMLInputElement.cpp in Sources */,
                                A8239E0009B3CF8A00B60641 /* Logging.cpp in Sources */,
                                BCEB377309B7BA3900CB38B1 /* FontMac.mm in Sources */,
                                C6D74AE409AA290A000B0A52 /* ModifySelectionListLevel.cpp in Sources */,
+                               A823A75C09B6E53900B60641 /* GraphicsContext.cpp in Sources */,
                                AB23A31209BBA7760067CC53 /* HTMLTextFieldInnerElement.cpp in Sources */,
                                AB23A32709BBA7D00067CC53 /* BeforeTextInsertedEvent.cpp in Sources */,
                                9352071D09BD3BBB00F2038D /* TextBoundaries.mm in Sources */,
                                14CF7B3309F6ECD700EB3665 /* JSCSSRule.cpp in Sources */,
                                938E65F709F0985D008A48EC /* JSHTMLElementWrapperFactory.cpp in Sources */,
                                938E666009F09B81008A48EC /* JSHTMLCanvasElement.cpp in Sources */,
+                               938E685409F0BE04008A48EC /* GraphicsTypes.cpp in Sources */,
                                8116895F09F2A4A000772CA0 /* SVGTRefElement.cpp in Sources */,
                                14115B7209F84CD600CA4FC1 /* JSNodeFilter.cpp in Sources */,
                                14E8378409F85D1C00B85AE4 /* JSEvent.cpp in Sources */,
                                853BF4DC0ABB6B55008647BB /* DOMNode.mm in Sources */,
                                85BCBC140ABBA87D00381160 /* DOMHTMLDocument.mm in Sources */,
                                AA21ECCA0ABF0FBA002B834C /* CSSCursorImageValue.cpp in Sources */,
+                               A8415F9B0AC10C5D00F7D0DF /* KCanvasClipper.cpp in Sources */,
+                               A8415F9D0AC10C5D00F7D0DF /* KCanvasResource.cpp in Sources */,
+                               A8415F9F0AC10C5D00F7D0DF /* KCanvasMasker.cpp in Sources */,
+                               A8415FA10AC10C5D00F7D0DF /* KCanvasMarker.cpp in Sources */,
                                A8415FA20AC10C5D00F7D0DF /* KCanvasFilters.cpp in Sources */,
                                8541636A0AC7180B0001E01B /* DOMSVGTransformList.mm in Sources */,
                                8541636C0AC7180B0001E01B /* DOMSVGTransform.mm in Sources */,
                                93E227E30AF589AD00D48324 /* ResourceLoader.cpp in Sources */,
                                93E227E40AF589AD00D48324 /* SubresourceLoader.cpp in Sources */,
                                93E22A6F0AF5E94100D48324 /* PageState.cpp in Sources */,
-                               B2A015A80AF6CD53006BCE0E /* GraphicsContext.cpp in Sources */,
-                               B2A015AA0AF6CD53006BCE0E /* GraphicsTypes.cpp in Sources */,
-                               B2A015AC0AF6CD53006BCE0E /* SVGResourceClipperCg.mm in Sources */,
-                               B2A015AD0AF6CD53006BCE0E /* SVGResourceImageCg.mm in Sources */,
-                               B2A015AE0AF6CD53006BCE0E /* SVGResourceMaskerCg.mm in Sources */,
-                               B2A015B20AF6CD53006BCE0E /* SVGResource.cpp in Sources */,
-                               B2A015B40AF6CD53006BCE0E /* SVGResourceClipper.cpp in Sources */,
-                               B2A015B70AF6CD53006BCE0E /* SVGResourceMarker.cpp in Sources */,
-                               B2A015B90AF6CD53006BCE0E /* SVGResourceMasker.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 79e6289dfb9abc0fa8dadfb8d8018b71e2901761..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,106 +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.
-*/
-
-#include "config.h"
-#ifdef SVG_SUPPORT
-#include "KCanvasResource.h"
-
-#include "Document.h"
-#include "KRenderingPaintServer.h"
-#include "SVGStyledElement.h"
-
-namespace WebCore {
-
-TextStream& operator<<(TextStream& ts, const KCanvasResource& r) 
-{ 
-    return r.externalRepresentation(ts); 
-}
-
-KCanvasResource::KCanvasResource()
-{
-}
-
-KCanvasResource::~KCanvasResource()
-{
-}
-
-void KCanvasResource::addClient(const RenderPath *item)
-{
-    if(m_clients.find(item) != m_clients.end())
-        return;
-
-    m_clients.append(item);
-}
-
-const RenderPathList &KCanvasResource::clients() const
-{
-    return m_clients;
-}
-
-void KCanvasResource::invalidate()
-{
-    RenderPathList::ConstIterator it = m_clients.begin();
-    RenderPathList::ConstIterator end = m_clients.end();
-
-    for(; it != end; ++it)
-        const_cast<RenderPath*>(*it)->repaint();
-}
-
-String KCanvasResource::idInRegistry() const
-{
-    return m_registryId;
-}
-
-void KCanvasResource::setIdInRegistry(const String& newId)
-{
-    m_registryId = newId;
-} 
-
-TextStream& KCanvasResource::externalRepresentation(TextStream& ts) const
-{
-    return ts;
-}
-
-KCanvasResource* getResourceById(Document* document, const AtomicString& id)
-{
-    if (id.isEmpty())
-        return 0;
-    Element *element = document->getElementById(id);
-    SVGElement *svgElement = svg_dynamic_cast(element);
-    if (svgElement && svgElement->isStyled())
-        return static_cast<SVGStyledElement*>(svgElement)->canvasResource();
-    return 0;
-}
-
-KRenderingPaintServer* getPaintServerById(Document* document, const AtomicString& id)
-{
-    KCanvasResource* resource = getResourceById(document, id);
-    if (resource && resource->isPaintServer())
-        return static_cast<KRenderingPaintServer*>(resource);
-    return 0;
-}
-
-}
-
-// vim:ts=4:noet
-#endif // SVG_SUPPORT
-
index feeffc836108222ce149d603f5770a73402e4e54..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,94 +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.
-*/
-
-#include "config.h"
-#ifdef SVG_SUPPORT
-#include "KCanvasClipper.h"
-
-#include "TextStream.h"
-#include "KCanvasTreeDebug.h"
-
-namespace WebCore {
-
-TextStream& operator<<(TextStream& ts, WindRule rule)
-{
-    switch (rule) {
-        case RULE_NONZERO:
-            ts << "NON-ZERO"; break;
-        case RULE_EVENODD:
-            ts << "EVEN-ODD"; break;
-    }
-    return ts;
-}
-
-TextStream& operator<<(TextStream& ts, const KCClipData &d)
-{
-    ts << "[winding=" << d.windRule() << "]";
-    if (d.bboxUnits)
-        ts << " [bounding box mode=" << d.bboxUnits  << "]";    
-    ts << " [path=" << d.path.debugString() << "]";
-    return ts;
-}
-
-KCanvasClipper::KCanvasClipper() : KCanvasResource()
-{
-}
-
-KCanvasClipper::~KCanvasClipper()
-{
-}
-
-void KCanvasClipper::resetClipData()
-{
-    m_clipData.clear();
-}
-
-void KCanvasClipper::addClipData(const Path& path, WindRule rule, bool bboxUnits)
-{
-    m_clipData.addPath(path, rule, bboxUnits);
-}
-
-KCClipDataList KCanvasClipper::clipData() const
-{
-    return m_clipData;
-}
-
-TextStream& KCanvasClipper::externalRepresentation(TextStream& ts) const
-{
-    ts << "[type=CLIPPER]";
-    ts << " [clip data=" << clipData() << "]";
-    return ts;
-}
-
-KCanvasClipper *getClipperById(Document *document, const AtomicString &id)
-{
-    KCanvasResource *resource = getResourceById(document, id);
-    if (resource && resource->isClipper())
-        return static_cast<KCanvasClipper*>(resource);
-    return 0;
-}
-
-}
-
-// vim:ts=4:noet
-#endif // SVG_SUPPORT
-
index b55c78bf359f11cc697a302d52ed7df11e37aa6b..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,88 +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 KCanvasClipper_h
-#define KCanvasClipper_h
-#ifdef SVG_SUPPORT
-
-#include "KCanvasResource.h"
-
-namespace WebCore {
-
-typedef DeprecatedValueList<const RenderPath*> RenderPathList;
-
-class TextStream;
-
-struct KCClipData
-{
-    WindRule windRule() const { return m_windRule; }
-    WindRule m_windRule;
-    bool bboxUnits : 1;
-    Path path;
-};
-
-class KCClipDataList : public DeprecatedValueList<KCClipData>
-{
-public:
-    KCClipDataList() { }
-
-    inline void addPath(const Path& pathData, WindRule windRule, bool bboxUnits)
-    {
-        KCClipData clipData;
-        clipData.bboxUnits = bboxUnits;
-        clipData.m_windRule = windRule;
-        clipData.path = pathData;
-        append(clipData);
-    }
-};
-
-class KCanvasClipper : public KCanvasResource
-{
-public:
-    KCanvasClipper();
-    virtual ~KCanvasClipper();
-    
-    virtual bool isClipper() const { return true; }
-
-    void resetClipData();
-    void addClipData(const Path&, WindRule, bool bboxUnits);
-    
-    virtual void applyClip(const FloatRect& boundingBox) const = 0;
-
-    KCClipDataList clipData() const;
-
-    TextStream& externalRepresentation(TextStream&) const; 
-protected:
-    KCClipDataList m_clipData;
-};
-
-TextStream& operator<<(TextStream&, WindRule);
-TextStream& operator<<(TextStream&, const KCClipData&);
-
-KCanvasClipper* getClipperById(Document*, const AtomicString&);
-
-}
-
-#endif // SVG_SUPPORT
-#endif
-
-// vim:ts=4:noet
index 822a4c9dc237239e6b93c178b86693ec7c385de2..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,49 +0,0 @@
-/*
-    Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
-                  2004, 2005 Rob Buis <buis@kde.org>
-                  2005 Eric Seidel <eric.seidel@kdemail.net>
-
-    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 KCanvasImage_H
-#define KCanvasImage_H
-#ifdef SVG_SUPPORT
-
-#include "KCanvasResource.h"
-
-namespace WebCore {
-class Image;
-
-class KCanvasImage : public KCanvasResource
-{
-public:
-    KCanvasImage() { };
-    virtual ~KCanvasImage() { };
-
-    virtual void init(const Image&) = 0;
-    virtual void init(IntSize) = 0;
-
-    virtual IntSize size() = 0;
-};
-
-}
-
-#endif // SVG_SUPPORT
-#endif
-
index c758adf49a21cb83b041920cdc293136369c60ca..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,39 +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 KCanvasResourceListener_H
-#define KCanvasResourceListener_H
-#ifdef SVG_SUPPORT
-
-class KCanvasResourceListener
-{
-public:
-    KCanvasResourceListener() { }
-    virtual ~KCanvasResourceListener() { }
-
-    virtual void resourceNotification() const = 0;
-};
-
-#endif // SVG_SUPPORT
-#endif
-
-// vim:ts=4:noet
index df33dde0f38246690d88064ad3303a2526860a87..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,153 +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.
-*/
-
-#include "config.h"
-#ifdef SVG_SUPPORT
-#include "KCanvasMarker.h"
-
-#include "RenderSVGContainer.h"
-#include "GraphicsContext.h"
-#include "TextStream.h"
-
-namespace WebCore {
-
-// KCanvasMarker
-KCanvasMarker::KCanvasMarker(RenderSVGContainer* marker)
-    : KCanvasResource()
-    , m_refX(0)
-    , m_refY(0)
-    , m_marker(marker)
-    , m_useStrokeWidth(true)
-{
-    setAutoAngle();
-}
-
-KCanvasMarker::~KCanvasMarker()
-{
-}
-
-void KCanvasMarker::setMarker(RenderSVGContainer* marker)
-{
-    m_marker = marker;
-}
-
-void KCanvasMarker::setRef(double refX, double refY)
-{
-    m_refX = refX;
-    m_refY = refY;
-}
-
-double KCanvasMarker::refX() const
-{
-    return m_refX;
-}
-
-double KCanvasMarker::refY() const
-{
-    return m_refY;
-}
-
-void KCanvasMarker::setAngle(float angle)
-{
-    m_angle = angle;
-}
-
-float KCanvasMarker::angle() const
-{
-    return m_angle;
-}
-
-void KCanvasMarker::setAutoAngle()
-{
-    m_angle = -1;
-}
-
-void KCanvasMarker::setUseStrokeWidth(bool useStrokeWidth)
-{
-    m_useStrokeWidth = useStrokeWidth;
-}
-
-bool KCanvasMarker::useStrokeWidth() const
-{
-    return m_useStrokeWidth;
-}
-
-void KCanvasMarker::draw(GraphicsContext* context, const FloatRect& rect, double x, double y, double strokeWidth, double angle)
-{
-    if (!m_marker)
-        return;
-    
-    AffineTransform transform;
-    transform.translate(x, y);
-    transform.rotate(m_angle > -1 ? m_angle : angle);
-    
-    // refX and refY are given in coordinates relative to the viewport established by the marker, yet they affect
-    // the translation performed on the viewport itself.
-    AffineTransform viewportTransform;
-    if (m_useStrokeWidth)
-        viewportTransform.scale(strokeWidth, strokeWidth);
-    if (!m_marker->viewBox().isEmpty())
-        viewportTransform *= m_marker->viewportTransform();
-    double refX, refY;
-    viewportTransform.map(m_refX, m_refY, &refX, &refY);
-    transform.translate(-refX, -refY);
-    
-    if (m_useStrokeWidth)
-        transform.scale(strokeWidth, strokeWidth);
-    
-    // FIXME: PaintInfo should be passed into this method instead of being created here
-    // FIXME: bounding box fractions are lost
-    RenderObject::PaintInfo info(context, enclosingIntRect(rect), PaintPhaseForeground, 0, 0, 0);
-    
-    context->save();
-    context->concatCTM(transform);
-    m_marker->setDrawsContents(true);
-    m_marker->paint(info, 0, 0);
-    m_marker->setDrawsContents(false);
-    context->restore();
-}
-
-TextStream& KCanvasMarker::externalRepresentation(TextStream& ts) const
-{
-    ts << "[type=MARKER]"
-       << " [angle=";
-    if (angle() == -1) 
-        ts << "auto" << "]";
-    else 
-        ts << angle() << "]";        
-    ts << " [ref x=" << refX() << " y=" << refY() << "]";
-    return ts;
-}
-
-KCanvasMarker *getMarkerById(Document *document, const AtomicString &id)
-{
-    KCanvasResource *resource = getResourceById(document, id);
-    if (resource && resource->isMarker())
-        return static_cast<KCanvasMarker*>(resource);
-    return 0;
-}
-
-}
-
-// vim:ts=4:noet
-#endif // SVG_SUPPORT
-
index 716a9e03be8930c50618b4e30bf487098dc22c9e..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,70 +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 KCanvasMarker_H
-#define KCanvasMarker_H
-#ifdef SVG_SUPPORT
-
-#include "KCanvasResource.h"
-
-namespace WebCore {
-
-class KCanvasMarker : public KCanvasResource
-{
-public:
-    KCanvasMarker(RenderSVGContainer* = 0);
-    virtual ~KCanvasMarker();
-    
-    virtual bool isMarker() const { return true; }
-
-    void setMarker(RenderSVGContainer*);
-    
-    void setRef(double refX, double refY);
-    double refX() const;    
-    double refY() const;
-    
-    void setAngle(float angle);
-    void setAutoAngle();
-    float angle() const;
-
-    void setUseStrokeWidth(bool useStrokeWidth = true);
-    bool useStrokeWidth() const;
-
-    void draw(GraphicsContext*, const FloatRect&, double x, double y, double strokeWidth = 1, double angle = 0);
-
-    TextStream& externalRepresentation(TextStream&) const; 
-
-private:
-    double m_refX, m_refY;
-    float m_angle;
-    RenderSVGContainer* m_marker;
-    bool m_useStrokeWidth;
-};
-
-KCanvasMarker* getMarkerById(Document*, const AtomicString&);
-
-}
-
-#endif // SVG_SUPPORT
-#endif
-
-// vim:ts=4:noet
index fd09b8cd7d09a464a6130e1698c6a348a1ab5bee..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,69 +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.
-*/
-
-#include "config.h"
-#ifdef SVG_SUPPORT
-#include "KCanvasMasker.h"
-
-#include "KCanvasImage.h"
-#include "TextStream.h"
-
-namespace WebCore {
-
-KCanvasMasker::KCanvasMasker()
-    : KCanvasResource()
-    , m_mask(0)
-{
-}
-
-KCanvasMasker::~KCanvasMasker()
-{
-    delete m_mask;
-}
-
-void KCanvasMasker::setMask(KCanvasImage* mask)
-{
-    if (m_mask != mask) {
-        delete m_mask;
-        m_mask = mask;
-    }
-}
-
-TextStream& KCanvasMasker::externalRepresentation(TextStream& ts) const
-{
-    ts << "[type=MASKER]";
-    return ts;
-}
-
-KCanvasMasker* getMaskerById(Document* document, const AtomicString& id)
-{
-    KCanvasResource* resource = getResourceById(document, id);
-    if (resource && resource->isMasker())
-        return static_cast<KCanvasMasker*>(resource);
-    return 0;
-}
-
-}
-
-// vim:ts=4:noet
-#endif // SVG_SUPPORT
-
index e2e8752306239cd51b1c3e1bfe9bdfb161a11da4..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,58 +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 KCanvasMasker_H
-#define KCanvasMasker_H
-#ifdef SVG_SUPPORT
-
-#include "KCanvasResource.h"
-
-namespace WebCore {
-
-class TextStream;
-class KCanvasImage;
-
-class KCanvasMasker : public KCanvasResource
-{
-public:
-    KCanvasMasker();
-    virtual ~KCanvasMasker();
-    
-    virtual bool isMasker() const { return true; }
-    void setMask(KCanvasImage*);
-    KCanvasImage* mask() const { return m_mask; }
-    
-    virtual void applyMask(const FloatRect& boundingBox) const = 0;
-
-    TextStream& externalRepresentation(TextStream&) const; 
-protected:
-    KCanvasImage* m_mask;
-};
-
-KCanvasMasker* getMaskerById(Document*, const AtomicString&);
-
-}
-
-#endif // SVG_SUPPORT
-#endif
-
-// vim:ts=4:noet
diff --git a/WebCore/kcanvas/KCanvasClipper.cpp b/WebCore/kcanvas/KCanvasClipper.cpp
new file mode 100644 (file)
index 0000000..feeffc8
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+    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.
+*/
+
+#include "config.h"
+#ifdef SVG_SUPPORT
+#include "KCanvasClipper.h"
+
+#include "TextStream.h"
+#include "KCanvasTreeDebug.h"
+
+namespace WebCore {
+
+TextStream& operator<<(TextStream& ts, WindRule rule)
+{
+    switch (rule) {
+        case RULE_NONZERO:
+            ts << "NON-ZERO"; break;
+        case RULE_EVENODD:
+            ts << "EVEN-ODD"; break;
+    }
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const KCClipData &d)
+{
+    ts << "[winding=" << d.windRule() << "]";
+    if (d.bboxUnits)
+        ts << " [bounding box mode=" << d.bboxUnits  << "]";    
+    ts << " [path=" << d.path.debugString() << "]";
+    return ts;
+}
+
+KCanvasClipper::KCanvasClipper() : KCanvasResource()
+{
+}
+
+KCanvasClipper::~KCanvasClipper()
+{
+}
+
+void KCanvasClipper::resetClipData()
+{
+    m_clipData.clear();
+}
+
+void KCanvasClipper::addClipData(const Path& path, WindRule rule, bool bboxUnits)
+{
+    m_clipData.addPath(path, rule, bboxUnits);
+}
+
+KCClipDataList KCanvasClipper::clipData() const
+{
+    return m_clipData;
+}
+
+TextStream& KCanvasClipper::externalRepresentation(TextStream& ts) const
+{
+    ts << "[type=CLIPPER]";
+    ts << " [clip data=" << clipData() << "]";
+    return ts;
+}
+
+KCanvasClipper *getClipperById(Document *document, const AtomicString &id)
+{
+    KCanvasResource *resource = getResourceById(document, id);
+    if (resource && resource->isClipper())
+        return static_cast<KCanvasClipper*>(resource);
+    return 0;
+}
+
+}
+
+// vim:ts=4:noet
+#endif // SVG_SUPPORT
+
diff --git a/WebCore/kcanvas/KCanvasClipper.h b/WebCore/kcanvas/KCanvasClipper.h
new file mode 100644 (file)
index 0000000..b55c78b
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+    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 KCanvasClipper_h
+#define KCanvasClipper_h
+#ifdef SVG_SUPPORT
+
+#include "KCanvasResource.h"
+
+namespace WebCore {
+
+typedef DeprecatedValueList<const RenderPath*> RenderPathList;
+
+class TextStream;
+
+struct KCClipData
+{
+    WindRule windRule() const { return m_windRule; }
+    WindRule m_windRule;
+    bool bboxUnits : 1;
+    Path path;
+};
+
+class KCClipDataList : public DeprecatedValueList<KCClipData>
+{
+public:
+    KCClipDataList() { }
+
+    inline void addPath(const Path& pathData, WindRule windRule, bool bboxUnits)
+    {
+        KCClipData clipData;
+        clipData.bboxUnits = bboxUnits;
+        clipData.m_windRule = windRule;
+        clipData.path = pathData;
+        append(clipData);
+    }
+};
+
+class KCanvasClipper : public KCanvasResource
+{
+public:
+    KCanvasClipper();
+    virtual ~KCanvasClipper();
+    
+    virtual bool isClipper() const { return true; }
+
+    void resetClipData();
+    void addClipData(const Path&, WindRule, bool bboxUnits);
+    
+    virtual void applyClip(const FloatRect& boundingBox) const = 0;
+
+    KCClipDataList clipData() const;
+
+    TextStream& externalRepresentation(TextStream&) const; 
+protected:
+    KCClipDataList m_clipData;
+};
+
+TextStream& operator<<(TextStream&, WindRule);
+TextStream& operator<<(TextStream&, const KCClipData&);
+
+KCanvasClipper* getClipperById(Document*, const AtomicString&);
+
+}
+
+#endif // SVG_SUPPORT
+#endif
+
+// vim:ts=4:noet
diff --git a/WebCore/kcanvas/KCanvasCreator.cpp b/WebCore/kcanvas/KCanvasCreator.cpp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/WebCore/kcanvas/KCanvasCreator.h b/WebCore/kcanvas/KCanvasCreator.h
new file mode 100644 (file)
index 0000000..e69de29
index 39e5960d42fb3d19b5eee5cc9198a15216a2654f..a55c32397efc9fe00047000f754faea3bb9ff070 100644 (file)
@@ -90,9 +90,9 @@ TextStream& KCanvasFilter::externalRepresentation(TextStream& ts) const
     return ts;
 }
 
-KCanvasFiltergetFilterById(Document *document, const AtomicString &id)
+KCanvasFilter *getFilterById(Document *document, const AtomicString &id)
 {
-    SVGResource* resource = getResourceById(document, id);
+    KCanvasResource *resource = getResourceById(document, id);
     if (resource && resource->isFilter())
         return static_cast<KCanvasFilter*>(resource);
     return 0;
index 2a0b05ad29e48b2b63414f77b652d45bcab8ae6b..71c2a27a55f79b285923231c6c33af680c28d827 100644 (file)
 #define KCanvasFilters_H
 #ifdef SVG_SUPPORT
 
-#include "CachedImage.h"
-#include "CachedResourceClient.h"
-#include "Color.h"
-#include "FloatRect.h"
-#include "SVGResource.h"
+#include "KCanvasResource.h"
 
 #ifdef __OBJC__
 @class CIFilter;
@@ -39,9 +35,7 @@ class CIFilter;
 
 namespace WebCore {
 
-#if PLATFORM(MAC)
 class KCanvasFilterQuartz;
-#endif
 
 // Enumerations
 typedef enum {
@@ -102,7 +96,7 @@ private:
 class KCanvasFilterEffect;
 class KRenderingDevice;
 
-class KCanvasFilter : public SVGResource {
+class KCanvasFilter : public KCanvasResource {
 public:
     KCanvasFilter() { }
     virtual ~KCanvasFilter() { }
@@ -154,7 +148,7 @@ public:
     String result() const;
     void setResult(const String&);
 
-#if PLATFORM(MAC)
+#if __APPLE__
     virtual CIFilter* getCIFilter(KCanvasFilterQuartz*) const = 0;
 #endif
 
diff --git a/WebCore/kcanvas/KCanvasImage.h b/WebCore/kcanvas/KCanvasImage.h
new file mode 100644 (file)
index 0000000..822a4c9
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+    Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
+                  2004, 2005 Rob Buis <buis@kde.org>
+                  2005 Eric Seidel <eric.seidel@kdemail.net>
+
+    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 KCanvasImage_H
+#define KCanvasImage_H
+#ifdef SVG_SUPPORT
+
+#include "KCanvasResource.h"
+
+namespace WebCore {
+class Image;
+
+class KCanvasImage : public KCanvasResource
+{
+public:
+    KCanvasImage() { };
+    virtual ~KCanvasImage() { };
+
+    virtual void init(const Image&) = 0;
+    virtual void init(IntSize) = 0;
+
+    virtual IntSize size() = 0;
+};
+
+}
+
+#endif // SVG_SUPPORT
+#endif
+
diff --git a/WebCore/kcanvas/KCanvasMarker.cpp b/WebCore/kcanvas/KCanvasMarker.cpp
new file mode 100644 (file)
index 0000000..df33dde
--- /dev/null
@@ -0,0 +1,153 @@
+/*
+    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.
+*/
+
+#include "config.h"
+#ifdef SVG_SUPPORT
+#include "KCanvasMarker.h"
+
+#include "RenderSVGContainer.h"
+#include "GraphicsContext.h"
+#include "TextStream.h"
+
+namespace WebCore {
+
+// KCanvasMarker
+KCanvasMarker::KCanvasMarker(RenderSVGContainer* marker)
+    : KCanvasResource()
+    , m_refX(0)
+    , m_refY(0)
+    , m_marker(marker)
+    , m_useStrokeWidth(true)
+{
+    setAutoAngle();
+}
+
+KCanvasMarker::~KCanvasMarker()
+{
+}
+
+void KCanvasMarker::setMarker(RenderSVGContainer* marker)
+{
+    m_marker = marker;
+}
+
+void KCanvasMarker::setRef(double refX, double refY)
+{
+    m_refX = refX;
+    m_refY = refY;
+}
+
+double KCanvasMarker::refX() const
+{
+    return m_refX;
+}
+
+double KCanvasMarker::refY() const
+{
+    return m_refY;
+}
+
+void KCanvasMarker::setAngle(float angle)
+{
+    m_angle = angle;
+}
+
+float KCanvasMarker::angle() const
+{
+    return m_angle;
+}
+
+void KCanvasMarker::setAutoAngle()
+{
+    m_angle = -1;
+}
+
+void KCanvasMarker::setUseStrokeWidth(bool useStrokeWidth)
+{
+    m_useStrokeWidth = useStrokeWidth;
+}
+
+bool KCanvasMarker::useStrokeWidth() const
+{
+    return m_useStrokeWidth;
+}
+
+void KCanvasMarker::draw(GraphicsContext* context, const FloatRect& rect, double x, double y, double strokeWidth, double angle)
+{
+    if (!m_marker)
+        return;
+    
+    AffineTransform transform;
+    transform.translate(x, y);
+    transform.rotate(m_angle > -1 ? m_angle : angle);
+    
+    // refX and refY are given in coordinates relative to the viewport established by the marker, yet they affect
+    // the translation performed on the viewport itself.
+    AffineTransform viewportTransform;
+    if (m_useStrokeWidth)
+        viewportTransform.scale(strokeWidth, strokeWidth);
+    if (!m_marker->viewBox().isEmpty())
+        viewportTransform *= m_marker->viewportTransform();
+    double refX, refY;
+    viewportTransform.map(m_refX, m_refY, &refX, &refY);
+    transform.translate(-refX, -refY);
+    
+    if (m_useStrokeWidth)
+        transform.scale(strokeWidth, strokeWidth);
+    
+    // FIXME: PaintInfo should be passed into this method instead of being created here
+    // FIXME: bounding box fractions are lost
+    RenderObject::PaintInfo info(context, enclosingIntRect(rect), PaintPhaseForeground, 0, 0, 0);
+    
+    context->save();
+    context->concatCTM(transform);
+    m_marker->setDrawsContents(true);
+    m_marker->paint(info, 0, 0);
+    m_marker->setDrawsContents(false);
+    context->restore();
+}
+
+TextStream& KCanvasMarker::externalRepresentation(TextStream& ts) const
+{
+    ts << "[type=MARKER]"
+       << " [angle=";
+    if (angle() == -1) 
+        ts << "auto" << "]";
+    else 
+        ts << angle() << "]";        
+    ts << " [ref x=" << refX() << " y=" << refY() << "]";
+    return ts;
+}
+
+KCanvasMarker *getMarkerById(Document *document, const AtomicString &id)
+{
+    KCanvasResource *resource = getResourceById(document, id);
+    if (resource && resource->isMarker())
+        return static_cast<KCanvasMarker*>(resource);
+    return 0;
+}
+
+}
+
+// vim:ts=4:noet
+#endif // SVG_SUPPORT
+
diff --git a/WebCore/kcanvas/KCanvasMarker.h b/WebCore/kcanvas/KCanvasMarker.h
new file mode 100644 (file)
index 0000000..716a9e0
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+    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 KCanvasMarker_H
+#define KCanvasMarker_H
+#ifdef SVG_SUPPORT
+
+#include "KCanvasResource.h"
+
+namespace WebCore {
+
+class KCanvasMarker : public KCanvasResource
+{
+public:
+    KCanvasMarker(RenderSVGContainer* = 0);
+    virtual ~KCanvasMarker();
+    
+    virtual bool isMarker() const { return true; }
+
+    void setMarker(RenderSVGContainer*);
+    
+    void setRef(double refX, double refY);
+    double refX() const;    
+    double refY() const;
+    
+    void setAngle(float angle);
+    void setAutoAngle();
+    float angle() const;
+
+    void setUseStrokeWidth(bool useStrokeWidth = true);
+    bool useStrokeWidth() const;
+
+    void draw(GraphicsContext*, const FloatRect&, double x, double y, double strokeWidth = 1, double angle = 0);
+
+    TextStream& externalRepresentation(TextStream&) const; 
+
+private:
+    double m_refX, m_refY;
+    float m_angle;
+    RenderSVGContainer* m_marker;
+    bool m_useStrokeWidth;
+};
+
+KCanvasMarker* getMarkerById(Document*, const AtomicString&);
+
+}
+
+#endif // SVG_SUPPORT
+#endif
+
+// vim:ts=4:noet
diff --git a/WebCore/kcanvas/KCanvasMasker.cpp b/WebCore/kcanvas/KCanvasMasker.cpp
new file mode 100644 (file)
index 0000000..fd09b8c
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+    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.
+*/
+
+#include "config.h"
+#ifdef SVG_SUPPORT
+#include "KCanvasMasker.h"
+
+#include "KCanvasImage.h"
+#include "TextStream.h"
+
+namespace WebCore {
+
+KCanvasMasker::KCanvasMasker()
+    : KCanvasResource()
+    , m_mask(0)
+{
+}
+
+KCanvasMasker::~KCanvasMasker()
+{
+    delete m_mask;
+}
+
+void KCanvasMasker::setMask(KCanvasImage* mask)
+{
+    if (m_mask != mask) {
+        delete m_mask;
+        m_mask = mask;
+    }
+}
+
+TextStream& KCanvasMasker::externalRepresentation(TextStream& ts) const
+{
+    ts << "[type=MASKER]";
+    return ts;
+}
+
+KCanvasMasker* getMaskerById(Document* document, const AtomicString& id)
+{
+    KCanvasResource* resource = getResourceById(document, id);
+    if (resource && resource->isMasker())
+        return static_cast<KCanvasMasker*>(resource);
+    return 0;
+}
+
+}
+
+// vim:ts=4:noet
+#endif // SVG_SUPPORT
+
diff --git a/WebCore/kcanvas/KCanvasMasker.h b/WebCore/kcanvas/KCanvasMasker.h
new file mode 100644 (file)
index 0000000..e2e8752
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+    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 KCanvasMasker_H
+#define KCanvasMasker_H
+#ifdef SVG_SUPPORT
+
+#include "KCanvasResource.h"
+
+namespace WebCore {
+
+class TextStream;
+class KCanvasImage;
+
+class KCanvasMasker : public KCanvasResource
+{
+public:
+    KCanvasMasker();
+    virtual ~KCanvasMasker();
+    
+    virtual bool isMasker() const { return true; }
+    void setMask(KCanvasImage*);
+    KCanvasImage* mask() const { return m_mask; }
+    
+    virtual void applyMask(const FloatRect& boundingBox) const = 0;
+
+    TextStream& externalRepresentation(TextStream&) const; 
+protected:
+    KCanvasImage* m_mask;
+};
+
+KCanvasMasker* getMaskerById(Document*, const AtomicString&);
+
+}
+
+#endif // SVG_SUPPORT
+#endif
+
+// vim:ts=4:noet
diff --git a/WebCore/kcanvas/KCanvasResource.cpp b/WebCore/kcanvas/KCanvasResource.cpp
new file mode 100644 (file)
index 0000000..79e6289
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+    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.
+*/
+
+#include "config.h"
+#ifdef SVG_SUPPORT
+#include "KCanvasResource.h"
+
+#include "Document.h"
+#include "KRenderingPaintServer.h"
+#include "SVGStyledElement.h"
+
+namespace WebCore {
+
+TextStream& operator<<(TextStream& ts, const KCanvasResource& r) 
+{ 
+    return r.externalRepresentation(ts); 
+}
+
+KCanvasResource::KCanvasResource()
+{
+}
+
+KCanvasResource::~KCanvasResource()
+{
+}
+
+void KCanvasResource::addClient(const RenderPath *item)
+{
+    if(m_clients.find(item) != m_clients.end())
+        return;
+
+    m_clients.append(item);
+}
+
+const RenderPathList &KCanvasResource::clients() const
+{
+    return m_clients;
+}
+
+void KCanvasResource::invalidate()
+{
+    RenderPathList::ConstIterator it = m_clients.begin();
+    RenderPathList::ConstIterator end = m_clients.end();
+
+    for(; it != end; ++it)
+        const_cast<RenderPath*>(*it)->repaint();
+}
+
+String KCanvasResource::idInRegistry() const
+{
+    return m_registryId;
+}
+
+void KCanvasResource::setIdInRegistry(const String& newId)
+{
+    m_registryId = newId;
+} 
+
+TextStream& KCanvasResource::externalRepresentation(TextStream& ts) const
+{
+    return ts;
+}
+
+KCanvasResource* getResourceById(Document* document, const AtomicString& id)
+{
+    if (id.isEmpty())
+        return 0;
+    Element *element = document->getElementById(id);
+    SVGElement *svgElement = svg_dynamic_cast(element);
+    if (svgElement && svgElement->isStyled())
+        return static_cast<SVGStyledElement*>(svgElement)->canvasResource();
+    return 0;
+}
+
+KRenderingPaintServer* getPaintServerById(Document* document, const AtomicString& id)
+{
+    KCanvasResource* resource = getResourceById(document, id);
+    if (resource && resource->isPaintServer())
+        return static_cast<KRenderingPaintServer*>(resource);
+    return 0;
+}
+
+}
+
+// vim:ts=4:noet
+#endif // SVG_SUPPORT
+
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..2f4b88f6c29f0d30c6870bad8c74512a050e2cae 100644 (file)
@@ -0,0 +1,86 @@
+/*
+    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 KCanvasResource_H
+#define KCanvasResource_H
+#ifdef SVG_SUPPORT
+
+#include "DeprecatedValueList.h"
+#include "Path.h"
+#include "RenderPath.h"
+#include "KCanvasResourceListener.h"
+
+namespace WebCore {
+
+typedef DeprecatedValueList<const RenderPath*> RenderPathList;
+
+class TextStream;
+
+typedef enum
+{
+    // Painting mode
+    RS_CLIPPER = 0,
+    RS_MARKER = 1,
+    RS_IMAGE = 2,
+    RS_FILTER = 3,
+    RS_MASKER = 4
+} KCResourceType;
+
+class KRenderingPaintServer;
+
+class KCanvasResource
+{
+public:
+    KCanvasResource();
+    virtual ~KCanvasResource();
+
+    virtual void invalidate();
+    void addClient(const RenderPath*);
+
+    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; }
+    virtual bool isMarker() const { return false; }
+    virtual bool isMasker() const { return false; }
+    
+    virtual TextStream& externalRepresentation(TextStream&) const; 
+private:
+    RenderPathList m_clients;
+    String m_registryId;
+};
+
+KCanvasResource* getResourceById(Document*, const AtomicString&);
+KRenderingPaintServer* getPaintServerById(Document*, const AtomicString&);
+
+TextStream& operator<<(TextStream&, const KCanvasResource&);
+
+}
+
+#endif // SVG_SUPPORT
+#endif
+
+// vim:ts=4:noet
diff --git a/WebCore/kcanvas/KCanvasResourceListener.h b/WebCore/kcanvas/KCanvasResourceListener.h
new file mode 100644 (file)
index 0000000..c758adf
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+    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 KCanvasResourceListener_H
+#define KCanvasResourceListener_H
+#ifdef SVG_SUPPORT
+
+class KCanvasResourceListener
+{
+public:
+    KCanvasResourceListener() { }
+    virtual ~KCanvasResourceListener() { }
+
+    virtual void resourceNotification() const = 0;
+};
+
+#endif // SVG_SUPPORT
+#endif
+
+// vim:ts=4:noet
index 5a9900babae4ff435fef5afd283ed46128d948dd..f7861aaa14941e991426ca3f3c01476e41f5b767 100644 (file)
 #ifdef SVG_SUPPORT
 #include "KCanvasTreeDebug.h"
 
-#include "SVGResourceClipper.h"
 #include "GraphicsTypes.h"
 #include "HTMLNames.h"
 #include "RenderTreeAsText.h"
 #include "RenderSVGContainer.h"
+#include "KCanvasClipper.h"
 #include "KRenderingDevice.h"
 #include "KRenderingPaintServerGradient.h"
 #include "KRenderingPaintServerPattern.h"
@@ -362,15 +362,14 @@ void writeRenderResources(TextStream& ts, Node *parent)
             continue;
 
         SVGStyledElement *styled = static_cast<SVGStyledElement*>(svgElement);
-        RefPtr<SVGResource> resource(styled->canvasResource());
+        KCanvasResource *resource = styled->canvasResource();
         if (!resource)
             continue;
         
         DeprecatedString elementId = svgElement->getAttribute(HTMLNames::idAttr).deprecatedString();
-        if (resource->isPaintServer()) {
-            RefPtr<KRenderingPaintServer> paintServer = WTF::static_pointer_cast<KRenderingPaintServer>(resource);
-            ts << "KRenderingPaintServer {id=\"" << elementId << "\" " << *paintServer << "}" << endl;
-        } else
+        if (resource->isPaintServer())
+            ts << "KRenderingPaintServer {id=\"" << elementId << "\" " << *static_cast<KRenderingPaintServer*>(resource) << "}" << endl;
+        else
             ts << "KCanvasResource {id=\"" << elementId << "\" " << *resource << "}" << endl;
     } while ((node = node->traverseNextNode(parent)));
 }
index f8ef3942e02341ee9b2b6a9e5b7484a3618410d7..3f3e9cf28ba2acf36c4aa5d0125434fcceec0d79 100644 (file)
 
 namespace WebCore {
 
-class AffineTransform;
-class GraphicsContext;
-class Path;
-
 // aka where to draw
 class KRenderingDeviceContext
 {
@@ -49,7 +45,7 @@ public:
     virtual GraphicsContext* createGraphicsContext() = 0;
 };
 
-class SVGResourceImage;
+class KCanvasImage;
 class KCanvasFilterEffect;
 class KRenderingDevice
 {
@@ -67,12 +63,12 @@ public:
     virtual KRenderingDeviceContext* popContext();
     virtual void pushContext(KRenderingDeviceContext*);
     
-    virtual KRenderingDeviceContext* contextForImage(SVGResourceImage*) const = 0;
+    virtual KRenderingDeviceContext* contextForImage(KCanvasImage*) const = 0;
 
     // Creation tools
-    virtual PassRefPtr<SVGResource> createResource(const SVGResourceType&) const = 0;
+    virtual KCanvasResource* createResource(const KCResourceType&) const = 0;
     virtual KCanvasFilterEffect* createFilterEffect(const KCFilterEffectType&) const = 0;
-    virtual PassRefPtr<KRenderingPaintServer> createPaintServer(const KCPaintServerType&) const = 0;
+    virtual KRenderingPaintServer* createPaintServer(const KCPaintServerType&) const = 0;
 
 private:
     Vector<KRenderingDeviceContext*> m_contextStack;
index e1136a48d6229e09d57b29e56dc8caaab8048730..55dc6a42a034d960220671c7f3781bfc9b614191 100644 (file)
 #define KRenderingPaintServer_H
 #ifdef SVG_SUPPORT
 
-#include "SVGResource.h"
+#include "KCanvasResource.h"
 
 namespace WebCore {
 
 class KRenderingDeviceContext;
-class RenderObject;
 class RenderPath;
 class RenderStyle;
 class TextStream;
@@ -50,11 +49,11 @@ enum KCPaintTargetType {
     APPLY_TO_STROKE = 2
 };
 
-class KRenderingPaintServer : public SVGResource
+class KRenderingPaintServer : public KCanvasResource
 {
 public:
     KRenderingPaintServer()
-        : SVGResource()
+        : KCanvasResource()
         , m_activeClient(0)
         , m_paintingText(false)
     { }
@@ -65,6 +64,9 @@ public:
     const RenderPath* activeClient() const { return m_activeClient;}
     void setActiveClient(const RenderPath* client) { m_activeClient = client; }
 
+    String idInRegistry() const {  return m_registryId; }
+    void setIdInRegistry(const String& newId) { m_registryId = newId; } 
+    
     virtual KCPaintServerType type() const = 0;
     
     // Actual rendering function
@@ -81,11 +83,14 @@ public:
     virtual void renderPath(KRenderingDeviceContext*, const RenderPath*, KCPaintTargetType) const = 0;
 private:
     const RenderPath* m_activeClient;
+    String m_registryId;
     bool m_paintingText;
 };
 
 TextStream& operator<<(TextStream&, const KRenderingPaintServer&);
 
+KRenderingPaintServer* getPaintServerById(Document*, const AtomicString&);
+
 }
 
 #endif // SVG_SUPPORT
index e626f2e0f51c7bad43dfb90c0a8423ad852c4feb..bd62344490c11effbb2806e20a791e6c6b37cddf 100644 (file)
@@ -226,12 +226,12 @@ KCPaintServerType KRenderingPaintServerRadialGradient::type() const
     return PS_RADIAL_GRADIENT;
 }
 
-SVGResourceListener* KRenderingPaintServerGradient::listener() const
+KCanvasResourceListener* KRenderingPaintServerGradient::listener() const
 {
     return m_listener;
 }
 
-void KRenderingPaintServerGradient::setListener(SVGResourceListener* listener)
+void KRenderingPaintServerGradient::setListener(KCanvasResourceListener* listener)
 {
     m_listener = listener;
 }
index 6fa04922a0cdde55afd122c980c50a88d92a7581..21dcf4d8ddce9557a0857e29ec667712cf5de393 100644 (file)
@@ -24,9 +24,6 @@
 #define KRenderingPaintServerGradient_H
 #ifdef SVG_SUPPORT
 
-#include "AffineTransform.h"
-#include "Color.h"
-#include "FloatPoint.h"
 #include "KRenderingPaintServer.h"
 
 namespace WebCore {
@@ -66,8 +63,8 @@ public:
     AffineTransform gradientTransform() const;
     void setGradientTransform(const AffineTransform&);
     
-    SVGResourceListener* listener() const;
-    void setListener(SVGResourceListener*);
+    KCanvasResourceListener* listener() const;
+    void setListener(KCanvasResourceListener*);
 
     TextStream& externalRepresentation(TextStream&) const;
 private:
@@ -75,7 +72,7 @@ private:
     KCGradientSpreadMethod m_spreadMethod;
     bool m_boundingBoxMode;
     AffineTransform m_gradientTransform;
-    SVGResourceListener* m_listener;
+    KCanvasResourceListener* m_listener;
 };
 
 class KRenderingPaintServerLinearGradient : public KRenderingPaintServerGradient
index e9687e7c114f9b3d7606228f5606c90a0aeab9e8..36243f92b9e9794c6dffeea07295ba686a6a892f 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "config.h"
 #ifdef SVG_SUPPORT
-#include "SVGResourceImage.h"
+#include "KCanvasImage.h"
 #include "KRenderingPaintServerPattern.h"
 
 #include "AffineTransform.h"
@@ -33,6 +33,7 @@ namespace WebCore {
 
 KRenderingPaintServerPattern::KRenderingPaintServerPattern()
     : KRenderingPaintServer()
+    , m_tile(0)
     , m_useBoundingBoxMode(true)
     , m_listener(0)
 {
@@ -40,6 +41,7 @@ KRenderingPaintServerPattern::KRenderingPaintServerPattern()
 
 KRenderingPaintServerPattern::~KRenderingPaintServerPattern()
 {
+    delete m_tile;
 }
 
 void KRenderingPaintServerPattern::setBbox(const FloatRect& rect)
@@ -62,12 +64,12 @@ void KRenderingPaintServerPattern::setBoundingBoxMode(bool mode)
     m_useBoundingBoxMode = mode;
 }
 
-SVGResourceImage* KRenderingPaintServerPattern::tile() const
+KCanvasImage* KRenderingPaintServerPattern::tile() const
 {
-    return m_tile.get();
+    return m_tile;
 }
 
-void KRenderingPaintServerPattern::setTile(const PassRefPtr<SVGResourceImage>& tile)
+void KRenderingPaintServerPattern::setTile(KCanvasImage* tile)
 {
     m_tile = tile;
 }
@@ -87,12 +89,12 @@ KCPaintServerType KRenderingPaintServerPattern::type() const
     return PS_PATTERN;
 }
 
-SVGResourceListener* KRenderingPaintServerPattern::listener() const
+KCanvasResourceListener* KRenderingPaintServerPattern::listener() const
 {
     return m_listener;
 }
 
-void KRenderingPaintServerPattern::setListener(SVGResourceListener* listener)
+void KRenderingPaintServerPattern::setListener(KCanvasResourceListener* listener)
 {
     m_listener = listener;
 }
index 59e809139bf4cc101763a9e9a15d01c49c910633..2bc166dd574a7f74b9eaf2f6044f7ad4a5c3173b 100644 (file)
 #define KRenderingPaintServerPattern_H
 #ifdef SVG_SUPPORT
 
-#include "AffineTransform.h"
-#include "FloatRect.h"
 #include "KRenderingPaintServer.h"
 
 namespace WebCore {
 
-class SVGResourceImage;
+class KCanvasImage;
 
 class KRenderingPaintServerPattern : public KRenderingPaintServer
 {
@@ -50,22 +48,22 @@ public:
     void setBoundingBoxMode(bool mode = true);
     
     // 'Pattern' interface
-    SVGResourceImage* tile() const;
-    void setTile(const PassRefPtr<SVGResourceImage>&);
+    KCanvasImage* tile() const;
+    void setTile(KCanvasImage*);
 
     AffineTransform patternTransform() const;
     void setPatternTransform(const AffineTransform&);
 
-    SVGResourceListener* listener() const;
-    void setListener(SVGResourceListener*);
+    KCanvasResourceListener* listener() const;
+    void setListener(KCanvasResourceListener*);
     TextStream& externalRepresentation(TextStream&) const;
 
 private:
-    RefPtr<SVGResourceImage> m_tile;
+    KCanvasImage* m_tile;
     AffineTransform m_patternTransform;
     FloatRect m_bbox;
     bool m_useBoundingBoxMode;
-    SVGResourceListener* m_listener;
+    KCanvasResourceListener* m_listener;
 
 };
 
index 007fc2027ce51aee6f5d393073463c33d73b1616..d30a2e32ff5e3ccce46ab613187dfe0510d0d944 100644 (file)
@@ -24,7 +24,6 @@
 #define KRenderingPaintServerSolid_H
 #ifdef SVG_SUPPORT
 
-#include "Color.h"
 #include "KRenderingPaintServer.h"
 
 namespace WebCore {
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..6890e427ace188588bf543dac897fdc8b45a1f12 100644 (file)
@@ -0,0 +1,118 @@
+/*
+    Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <wildfox@kde.org>
+                  2004, 2005, 2006 Rob Buis <buis@kde.org>
+                  2005 Apple Computer, Inc.
+
+    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"
+
+#include "KCanvasClipperQt.h"
+#include "KRenderingDeviceQt.h"
+
+namespace WebCore {
+
+void KCanvasClipperQt::applyClip(const FloatRect& boundingBox) const
+{
+    KRenderingDeviceContext* context = renderingDevice()->currentContext();
+    KRenderingDeviceContextQt* qtContext = static_cast<KRenderingDeviceContextQt*>(context);
+    if (m_clipData.count() < 1)
+        return;
+
+    context->clearPath();
+
+    QPainterPath newPath;
+
+    bool heterogenousClipRules = false;
+    WindRule clipRule = m_clipData[0].windRule();
+
+    for (unsigned int x = 0; x < m_clipData.count(); x++) {
+        KCClipData clipData = m_clipData[x];
+        if (clipData.windRule() != clipRule)
+            heterogenousClipRules = true;
+       
+        QPainterPath path = *(clipData.path.platformPath());
+        if (path.isEmpty())
+            continue;
+
+        if (!newPath.isEmpty())
+            newPath.closeSubpath();
+
+        // Respect clipping units...
+        QMatrix transform;
+
+        if (clipData.bboxUnits) {
+            transform.translate(boundingBox.x(), boundingBox.y());
+            transform.scale(boundingBox.width(), boundingBox.height());
+        }
+
+        // TODO: support heterogenous clip rules!
+        //clipRule = (clipData.windRule() == RULE_EVENODD ? Qt::OddEvenFill : Qt::WindingFill);
+
+        for (int i = 0; i < path.elementCount(); ++i) {
+            const QPainterPath::Element &cur = path.elementAt(i);
+
+            switch (cur.type) {
+                case QPainterPath::MoveToElement:
+                    newPath.moveTo(QPointF(cur.x, cur.y) * transform);
+                    break;
+                case QPainterPath::LineToElement:
+                    newPath.lineTo(QPointF(cur.x, cur.y) * transform);
+                    break;
+                case QPainterPath::CurveToElement:
+                {
+                    const QPainterPath::Element &c1 = path.elementAt(i + 1);
+                    const QPainterPath::Element &c2 = path.elementAt(i + 2);
+
+                    Q_ASSERT(c1.type == QPainterPath::CurveToDataElement);
+                    Q_ASSERT(c2.type == QPainterPath::CurveToDataElement);
+
+                    newPath.cubicTo(QPointF(cur.x, cur.y) * transform,
+                                    QPointF(c1.x, c1.y) * transform,
+                                    QPointF(c2.x, c2.y) * transform);
+
+                    i += 2;
+                    break;
+                }
+                case QPainterPath::CurveToDataElement:
+                    Q_ASSERT(false);
+                    break;
+            }
+        }
+    }
+
+    if (m_clipData.count()) {
+        // FIXME!
+        // We don't currently allow for heterogenous clip rules.
+        // we would have to detect such, draw to a mask, and then clip
+        // to that mask
+        // if (!CGContextIsPathEmpty(cgContext)) {
+            if (clipRule == RULE_EVENODD)
+                newPath.setFillRule(Qt::OddEvenFill);
+            else
+                newPath.setFillRule(Qt::WindingFill);
+        // }
+    }
+
+    qtContext->painter().setClipPath(newPath);
+}
+
+}
+
+// vim:ts=4:noet
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..eee821ff9568775b1fd6866d36d082421537dba5 100644 (file)
@@ -0,0 +1,44 @@
+/*
+    Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <wildfox@kde.org>
+                  2004, 2005, 2006 Rob Buis <buis@kde.org>
+                  2005 Apple Computer, Inc.
+
+    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 KCanvasClipperQt_h
+#define KCanvasClipperQt_h
+
+#include "KCanvasClipper.h"
+
+namespace WebCore {
+
+class KCanvasClipperQt : public KCanvasClipper {
+public:
+    KCanvasClipperQt()
+    {
+    }
+    
+    virtual void applyClip(const FloatRect& boundingBox) const;
+};
+
+}
+
+#endif
+
+// vim:ts=4:noet
index a1d208b15052379e6e2ffbed22212b608aa4a42f..844c65b9073334c324c64750132c92c8d1f4f797 100644 (file)
@@ -26,8 +26,8 @@
 #include "RenderPathQt.h"
 #include "AffineTransform.h"
 #include "GraphicsContext.h"
-#include "SVGResourceClipper.h"
-#include "SVGResourceMarker.h"
+#include "KCanvasClipperQt.h"
+#include "KCanvasMarker.h"
 #include "KRenderingDeviceQt.h"
 #include "KRenderingPaintServerSolidQt.h"
 #include "KRenderingPaintServerGradientQt.h"
@@ -135,23 +135,23 @@ KRenderingDeviceContextQt* KRenderingDeviceQt::qtContext() const
     return static_cast<KRenderingDeviceContextQt*>(currentContext());
 }
 
-KRenderingDeviceContext* KRenderingDeviceQt::contextForImage(SVGResourceImage* image) const
+KRenderingDeviceContext* KRenderingDeviceQt::contextForImage(KCanvasImage* image) const
 {
     qDebug("KRenderingDeviceQt::contextForImage() TODO!");
     return 0;
 }
 
 // Resource creation
-PassRefPtr<SVGResource> KRenderingDeviceQt::createResource(const SVGResourceType& type) const
+KCanvasResource* KRenderingDeviceQt::createResource(const KCResourceType& type) const
 {
     switch (type)
     {
         case RS_CLIPPER:
-            return new SVGResourceClipper();
+            return new KCanvasClipperQt();
         case RS_MARKER:
-            return new SVGResourceMarker(); // Use default implementation...
+            return new KCanvasMarker(); // Use default implementation...
         case RS_IMAGE:
-            // return new SVGResourceImageQt();
+            // return new KCanvasImageQt();
         case RS_FILTER:
             // return new KCanvasFilterQt();
         case RS_MASKER:
@@ -161,7 +161,7 @@ PassRefPtr<SVGResource> KRenderingDeviceQt::createResource(const SVGResourceType
     }
 }
 
-PassRefPtr<KRenderingPaintServer> KRenderingDeviceQt::createPaintServer(const KCPaintServerType& type) const
+KRenderingPaintServer* KRenderingDeviceQt::createPaintServer(const KCPaintServerType& type) const
 {
     switch (type)
     {
index d63a13d1d76fe976e2b937588b24d5dd30d11551..0c15fc75be8a8bc5abedddb035dc0f50c421962e 100644 (file)
@@ -74,11 +74,11 @@ public:
 
     // context management.
     KRenderingDeviceContextQt* qtContext() const;
-    virtual KRenderingDeviceContext* contextForImage(SVGResourceImage*) const;
+    virtual KRenderingDeviceContext* contextForImage(KCanvasImage*) const;
 
     // Resource creation
-    virtual PassRefPtr<SVGResource> createResource(const SVGResourceType&) const;
-    virtual PassRefPtr<KRenderingPaintServer> createPaintServer(const KCPaintServerType&) const;
+    virtual KCanvasResource* createResource(const KCResourceType&) const;
+    virtual KRenderingPaintServer* createPaintServer(const KCPaintServerType&) const;
     virtual KCanvasFilterEffect* createFilterEffect(const KCFilterEffectType&) const;
 };
 
index ca33376846e361a1ccca35a0bea0a2889653691b..946aa9e9d1e65e07fdb23e45427fd5a9c73978fa 100644 (file)
@@ -25,7 +25,6 @@
 #include <math.h>
 #include <QPointF>
 
-#include "RenderPath.h"
 #include "RenderStyle.h"
 #include "AffineTransform.h"
 #include "KRenderingDeviceQt.h"
index d6bb1e1db21286b0c935c25e8cf4eabeec5a27a7..9a687ffccdee3bf67aede1b7f8c88fbe28adac65 100644 (file)
 #include <QPointF>
 #include <QPainterPath>
 
-#include "RenderPath.h"
 #include "RenderStyle.h"
 #include "KRenderingDeviceQt.h"
 #include "KCanvasRenderingStyle.h"
 #include "KRenderingPaintServerPatternQt.h"
-#include "SVGResourceImage.h"
+#include "KCanvasImage.h"
 
 namespace WebCore {
 
index 781a472cc5816b9ec9b54801349ed739b123059c..03716f095ed032ce6f2fce49f63b7049578210be 100644 (file)
@@ -25,7 +25,6 @@
 #include <QPen>
 #include <QVector>
 
-#include "RenderStyle.h"
 #include "KCanvasRenderingStyle.h"
 #include "KRenderingPaintServerQt.h"
 
index bb866db41c451e6776728b35be4d960e8fe6a619..f6978c85ccfda30cf4875be502a97a14066ddaf1 100644 (file)
@@ -26,7 +26,6 @@
 #include <QBrush>
 #include <QPainter>
 
-#include "RenderPath.h"
 #include "RenderStyle.h"
 #include "KRenderingDeviceQt.h"
 #include "KCanvasRenderingStyle.h"
index a8cc3389fd07fd3b5963f8cc09ab428963e19d98..fcb4de1fceaab473ea157af306b801384c80028f 100644 (file)
@@ -180,7 +180,6 @@ NSArray *KCanvasFilterQuartz::getCIFilterStack(CIImage *inputImage)
     DeprecatedValueListIterator<KCanvasFilterEffect*> end = m_effects.end();
 
     setImageForName(inputImage, "SourceGraphic"); // input
-
     for (;it != end; it++) {
         CIFilter *filter = (*it)->getCIFilter(this);
         if (filter)
index 27da08df7809d31a8755ef5808e6568e0a13a46a..e8a5d131b1963d6a95f84b06e600e3fcdf1840d0 100644 (file)
@@ -31,7 +31,9 @@
 #import <wtf/Assertions.h>
 
 #import "KCanvasFilterQuartz.h"
+#import "KCanvasMaskerQuartz.h"
 #import "KCanvasRenderingStyle.h"
+#import "KCanvasResourcesQuartz.h"
 #import "KRenderingDeviceQuartz.h"
 #import "QuartzSupport.h"
 #import "RenderPath.h"
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..4f7914b01e54fb7614c60f8c215d9c8796a0c806 100644 (file)
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2005 Apple Computer, Inc.  All rights reserved.
+ *               2005, 2006 Alexander Kellett <lypanov@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 "KCanvasMasker.h"
+#include "KCanvasImage.h"
+
+namespace WebCore {
+
+class KCanvasMaskerQuartz : public KCanvasMasker {
+public:
+    KCanvasMaskerQuartz() { }
+    
+    virtual void applyMask(const FloatRect& boundingBox) const;
+};
+
+}
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..efecf8c93a7b6e19dbe09a287b9654ae19beeb5d 100644 (file)
@@ -0,0 +1,117 @@
+/*
+ * Copyright (C) 2005, 2006 Alexander Kellett <lypanov@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
+#import "KCanvasMaskerQuartz.h"
+
+#import "SVGRenderStyle.h"
+
+#import "KCanvasResourcesQuartz.h"
+#import "KRenderingDeviceQuartz.h"
+#import "QuartzSupport.h"
+
+#import <QuartzCore/CoreImage.h>
+
+namespace WebCore {
+
+static CIImage *applyLuminanceToAlphaFilter(CIImage *inputImage)
+{
+    CIFilter *luminanceToAlpha = [CIFilter filterWithName:@"CIColorMatrix"];
+    [luminanceToAlpha setDefaults];
+    CGFloat alpha[4] = {0.2125, 0.7154, 0.0721, 0};
+    CGFloat zero[4] = {0, 0, 0, 0};
+    [luminanceToAlpha setValue:inputImage forKey:@"inputImage"];  
+    [luminanceToAlpha setValue:[CIVector vectorWithValues:zero count:4] forKey:@"inputRVector"];
+    [luminanceToAlpha setValue:[CIVector vectorWithValues:zero count:4] forKey:@"inputGVector"];
+    [luminanceToAlpha setValue:[CIVector vectorWithValues:zero count:4] forKey:@"inputBVector"];
+    [luminanceToAlpha setValue:[CIVector vectorWithValues:alpha count:4] forKey:@"inputAVector"];
+    [luminanceToAlpha setValue:[CIVector vectorWithValues:zero count:4] forKey:@"inputBiasVector"];
+    return [luminanceToAlpha valueForKey:@"outputImage"];
+}
+
+static CIImage *applyExpandAlphatoGrayscaleFilter(CIImage *inputImage)
+{
+    CIFilter *alphaToGrayscale = [CIFilter filterWithName:@"CIColorMatrix"];
+    CGFloat zero[4] = {0, 0, 0, 0};
+    [alphaToGrayscale setDefaults];
+    [alphaToGrayscale setValue:inputImage forKey:@"inputImage"];
+    [alphaToGrayscale setValue:[CIVector vectorWithValues:zero count:4] forKey:@"inputRVector"];
+    [alphaToGrayscale setValue:[CIVector vectorWithValues:zero count:4] forKey:@"inputGVector"];
+    [alphaToGrayscale setValue:[CIVector vectorWithValues:zero count:4] forKey:@"inputBVector"];
+    [alphaToGrayscale setValue:[CIVector vectorWithX:0.0 Y:0.0 Z:0.0 W:1.0] forKey:@"inputAVector"];
+    [alphaToGrayscale setValue:[CIVector vectorWithX:1.0 Y:1.0 Z:1.0 W:0.0] forKey:@"inputBiasVector"];
+    return [alphaToGrayscale valueForKey:@"outputImage"];
+}
+
+static CIImage *transformImageIntoGrayscaleMask(CIImage *inputImage)
+{
+    CIFilter *blackBackground = [CIFilter filterWithName:@"CIConstantColorGenerator"];
+    [blackBackground setValue:[CIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0] forKey:@"inputColor"];
+
+    CIFilter *layerOverBlack = [CIFilter filterWithName:@"CISourceOverCompositing"];
+    [layerOverBlack setValue:[blackBackground valueForKey:@"outputImage"] forKey:@"inputBackgroundImage"];  
+    [layerOverBlack setValue:inputImage forKey:@"inputImage"];  
+
+    CIImage *luminanceAlpha = applyLuminanceToAlphaFilter([layerOverBlack valueForKey:@"outputImage"]);
+    CIImage *luminanceAsGrayscale = applyExpandAlphatoGrayscaleFilter(luminanceAlpha);
+    CIImage *alphaAsGrayscale = applyExpandAlphatoGrayscaleFilter(inputImage);
+
+    CIFilter *multipliedGrayscale = [CIFilter filterWithName:@"CIMultiplyCompositing"];
+    [multipliedGrayscale setValue:luminanceAsGrayscale forKey:@"inputBackgroundImage"];  
+    [multipliedGrayscale setValue:alphaAsGrayscale forKey:@"inputImage"];  
+    return [multipliedGrayscale valueForKey:@"outputImage"];
+}
+
+void KCanvasMaskerQuartz::applyMask(const FloatRect& boundingBox) const
+{
+    if (!m_mask)
+        return;
+    // Create grayscale bitmap context
+    int width = m_mask->size().width();
+    int height = m_mask->size().height();
+    void *imageBuffer = fastMalloc(width * height);
+    CGColorSpaceRef grayColorSpace = CGColorSpaceCreateDeviceGray();
+    CGContextRef grayscaleContext = CGBitmapContextCreate(imageBuffer, width, height, 8, width, grayColorSpace, kCGImageAlphaNone);
+    CGColorSpaceRelease(grayColorSpace);
+    CIContext *ciGrayscaleContext = [CIContext contextWithCGContext:grayscaleContext options:nil];
+
+    KCanvasImageQuartz* maskImage = static_cast<KCanvasImageQuartz*>(m_mask);
+    CIImage *grayscaleMask = transformImageIntoGrayscaleMask([CIImage imageWithCGLayer:maskImage->cgLayer()]);
+    [ciGrayscaleContext drawImage:grayscaleMask atPoint:CGPointZero fromRect:CGRectMake(0, 0, width, height)];
+
+    CGImageRef grayscaleImage = CGBitmapContextCreateImage(grayscaleContext);
+    CGContextRef cgContext = static_cast<KRenderingDeviceQuartz*>(renderingDevice())->currentCGContext();
+    CGContextClipToMask(cgContext, CGRectMake(0, 0, width, height), grayscaleImage);
+    
+    CGImageRelease(grayscaleImage);
+    CGContextRelease(grayscaleContext);
+    fastFree(imageBuffer);
+}
+
+}
+
+#endif // SVG_SUPPORT
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..a7e9a2209262acac437a5ab81372ec634709a755 100644 (file)
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2005 Apple Computer, Inc.  All rights reserved.
+ *
+ * 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 KCanvasResourcesQuartz_h
+#define KCanvasResourcesQuartz_h
+
+#include "KCanvasClipper.h"
+
+#include "KCanvasImage.h"
+#include "RenderSVGContainer.h"
+#include "AffineTransform.h"
+
+typedef struct CGContext *CGContextRef;
+typedef struct CGLayer *CGLayerRef;
+
+namespace WebCore {
+
+class KCanvasClipperQuartz : public KCanvasClipper {
+public:
+    KCanvasClipperQuartz() { }
+    
+    virtual void applyClip(const FloatRect& boundingBox) const;
+};
+
+class KCanvasImageQuartz : public KCanvasImage {
+public:
+    KCanvasImageQuartz() : m_cgLayer(0) { }
+    ~KCanvasImageQuartz();
+    void init(const Image&) { }
+    void init(IntSize size) { m_size = size; }
+    
+    CGLayerRef cgLayer();
+    void setCGLayer(CGLayerRef layer);
+
+    IntSize size() { return m_size; }
+    
+private:
+    IntSize m_size;
+    CGLayerRef m_cgLayer;
+};
+
+}
+
+#endif
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..4553fc71e3ac7da77b32ad4425cce84631277824 100644 (file)
@@ -0,0 +1,103 @@
+/*
+ * Copyright (C) 2005 Apple Computer, Inc.  All rights reserved.
+ *               2005 Alexander Kellett <lypanov@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
+#import "KCanvasResourcesQuartz.h"
+
+#import "GraphicsContext.h"
+#import "KCanvasFilterQuartz.h"
+#import "KCanvasMaskerQuartz.h"
+#import "KRenderingDeviceQuartz.h"
+#import "QuartzSupport.h"
+
+namespace WebCore {
+
+void KCanvasClipperQuartz::applyClip(const FloatRect& boundingBox) const
+{
+    KRenderingDeviceContext* context = renderingDevice()->currentContext();
+    CGContextRef cgContext = static_cast<KRenderingDeviceContextQuartz*>(context)->cgContext();
+    if (m_clipData.count() < 1)
+        return;
+
+    BOOL heterogenousClipRules = NO;
+    WindRule clipRule = m_clipData[0].windRule();
+
+    context->clearPath();
+
+    CGAffineTransform bboxTransform = CGAffineTransformMakeMapBetweenRects(CGRectMake(0,0,1,1), CGRect(boundingBox));
+
+    for (unsigned x = 0; x < m_clipData.count(); x++) {
+        KCClipData data = m_clipData[x];
+        if (data.windRule() != clipRule)
+            heterogenousClipRules = YES;
+        
+        CGPathRef clipPath = data.path.platformPath();
+
+        if (data.bboxUnits) {
+            CGMutablePathRef transformedPath = CGPathCreateMutable();
+            CGPathAddPath(transformedPath, &bboxTransform, clipPath);
+            CGContextAddPath(cgContext, transformedPath);
+            CGPathRelease(transformedPath);
+        } else
+            CGContextAddPath(cgContext, clipPath);
+    }
+
+    if (m_clipData.count()) {
+        // FIXME!
+        // We don't currently allow for heterogenous clip rules.
+        // we would have to detect such, draw to a mask, and then clip
+        // to that mask                
+        if (!CGContextIsPathEmpty(cgContext)) {
+            if (clipRule == RULE_EVENODD)
+                CGContextEOClip(cgContext);
+            else
+                CGContextClip(cgContext);
+        }
+    }
+}
+
+KCanvasImageQuartz::~KCanvasImageQuartz()
+{
+    CGLayerRelease(m_cgLayer);
+}
+
+CGLayerRef KCanvasImageQuartz::cgLayer()
+{
+    return m_cgLayer;
+}
+
+void KCanvasImageQuartz::setCGLayer(CGLayerRef layer)
+{
+    if (m_cgLayer != layer) {
+        CGLayerRelease(m_cgLayer);
+        m_cgLayer = CGLayerRetain(layer);
+    }
+}
+
+}
+#endif // SVG_SUPPORT
index 33e675473377b99687fcb89b6c5d6bd0df3ab138..b53d4ba6e5de8761f03ad61bbe7da65897bdbb7c 100644 (file)
@@ -65,11 +65,11 @@ public:
     // context management.
     KRenderingDeviceContextQuartz* quartzContext() const;
     CGContextRef currentCGContext() const;
-    virtual KRenderingDeviceContext* contextForImage(SVGResourceImage*) const;
+    virtual KRenderingDeviceContext* contextForImage(KCanvasImage*) const;
 
     // Resource creation
-    virtual PassRefPtr<SVGResource> createResource(const SVGResourceType&) const;
-    virtual PassRefPtr<KRenderingPaintServer> createPaintServer(const KCPaintServerType&) const;
+    virtual KCanvasResource *createResource(const KCResourceType&) const;
+    virtual KRenderingPaintServer *createPaintServer(const KCPaintServerType&) const;
     virtual KCanvasFilterEffect *createFilterEffect(const KCFilterEffectType&) const;
     
     // filters (mostly debugging)
index 8b128ec2b534a25d235ed2fe98d0654b01fbffb9..6b4a34ec803ff6f192897b2a2ccdfd11f491d859 100644 (file)
  */
 
 #include "config.h"
-
 #ifdef SVG_SUPPORT
 #import "KRenderingDeviceQuartz.h"
 
 #import "GraphicsContext.h"
-#import "SVGResourceClipper.h"
-#import "SVGResourceImage.h"
-#import "SVGResourceMarker.h"
+#include "KCanvasMarker.h"
 #import "KCanvasFilterQuartz.h"
-#import "SVGResourceMasker.h"
+#import "KCanvasMaskerQuartz.h"
+#import "KCanvasResourcesQuartz.h"
 #import "KRenderingPaintServerQuartz.h"
 #import "Logging.h"
 #import "QuartzSupport.h"
@@ -119,15 +117,16 @@ CGContextRef KRenderingDeviceQuartz::currentCGContext() const
     return quartzContext()->cgContext();
 }
 
-KRenderingDeviceContext* KRenderingDeviceQuartz::contextForImage(SVGResourceImage *image) const
+KRenderingDeviceContext* KRenderingDeviceQuartz::contextForImage(KCanvasImage *image) const
 {
-    CGLayerRef cgLayer = image->cgLayer();
+    KCanvasImageQuartz* quartzImage = static_cast<KCanvasImageQuartz*>(image);
+    CGLayerRef cgLayer = quartzImage->cgLayer();
     if (!cgLayer) {
         // FIXME: we might not get back a layer if this is a loaded image
-        // maybe this logic should go into SVGResourceImage?
+        // maybe this logic should go into KCanvasImage?
         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);
+        quartzImage->setCGLayer(cgLayer);
         CGLayerRelease(cgLayer);
     }
     return new KRenderingDeviceContextQuartz(CGLayerGetContext(cgLayer));
@@ -136,7 +135,7 @@ KRenderingDeviceContext* KRenderingDeviceQuartz::contextForImage(SVGResourceImag
 #pragma mark -
 #pragma mark Resource Creation
 
-PassRefPtr<KRenderingPaintServer> KRenderingDeviceQuartz::createPaintServer(const KCPaintServerType& type) const
+KRenderingPaintServer *KRenderingDeviceQuartz::createPaintServer(const KCPaintServerType& type) const
 {
     KRenderingPaintServer *newServer = NULL;
     switch(type) {
@@ -156,19 +155,19 @@ PassRefPtr<KRenderingPaintServer> KRenderingDeviceQuartz::createPaintServer(cons
     return newServer;
 }
 
-PassRefPtr<SVGResource> KRenderingDeviceQuartz::createResource(const SVGResourceType& type) const
+KCanvasResource *KRenderingDeviceQuartz::createResource(const KCResourceType& type) const
 {
     switch (type) {
     case RS_CLIPPER:
-        return new SVGResourceClipper();
+        return new KCanvasClipperQuartz();
     case RS_MARKER:
-        return new SVGResourceMarker();
+        return new KCanvasMarker();
     case RS_IMAGE:
-        return new SVGResourceImage();
+        return new KCanvasImageQuartz();
     case RS_FILTER:
         return new KCanvasFilterQuartz();
     case RS_MASKER:
-        return new SVGResourceMasker();
+        return new KCanvasMaskerQuartz();
     }
     LOG_ERROR("Failed to create resource of type: %i", type);
     return 0;
index bc2931f9e12d073a237bfab0ad2e391044850779..93a95888a7f7dc88cebc7b282eb1d8b179bfc2a0 100644 (file)
 
 
 #include "config.h"
-
 #ifdef SVG_SUPPORT
 #import "KRenderingPaintServerQuartz.h"
-#import "SVGResourceImage.h"
+
+#import "KCanvasImage.h"
+#import "KCanvasResourcesQuartz.h"
 #import "KRenderingDeviceQuartz.h"
 #import "KRenderingPaintServer.h"
 #import "QuartzSupport.h"
-#import "RenderPath.h"
+#import "RenderObject.h"
+
 #import <wtf/Assertions.h>
 
 namespace WebCore {
@@ -135,6 +137,7 @@ KRenderingPaintServerGradientQuartz::KRenderingPaintServerGradientQuartz()
     : m_stopsCache(0)
     , m_stopsCount(0)
     , m_shadingCache(0)
+    , m_maskImage(0)
 {
 }
 
@@ -142,6 +145,7 @@ KRenderingPaintServerGradientQuartz::~KRenderingPaintServerGradientQuartz()
 {
     delete m_stopsCache;
     CGShadingRelease(m_shadingCache);
+    delete m_maskImage;
 }
 
 void KRenderingPaintServerGradientQuartz::updateQuartzGradientCache(const KRenderingPaintServerGradient *server)
@@ -216,6 +220,9 @@ bool KRenderingPaintServerGradientQuartz::setup(const KRenderingPaintServerGradi
     if (server->listener()) // this seems like bad design to me, should be in a common baseclass. -- ecs 8/6/05
         server->listener()->resourceNotification();
     
+    delete m_maskImage;
+    m_maskImage = 0;
+
     // FIXME: total const HACK!
     // We need a hook to call this when the gradient gets updated, before drawn.
     if (!m_shadingCache)
@@ -239,12 +246,12 @@ bool KRenderingPaintServerGradientQuartz::setup(const KRenderingPaintServerGradi
         CGContextSaveGState(context);
         applyStrokeStyleToContext(context, renderStyle, renderObject); // FIXME: this seems like the wrong place for this.
         if (server->isPaintingText()) {
-            m_maskImage = new SVGResourceImage();
+            m_maskImage = static_cast<KCanvasImage*>(quartzDevice->createResource(RS_IMAGE));
             int width  = 2048;
             int height = 2048; // FIXME???
             IntSize size = IntSize(width, height);
             m_maskImage->init(size);
-            KRenderingDeviceContext* maskImageContext = quartzDevice->contextForImage(m_maskImage.get());
+            KRenderingDeviceContext* maskImageContext = quartzDevice->contextForImage(m_maskImage);
             quartzDevice->pushContext(maskImageContext);
             CGContextRef maskContext = static_cast<KRenderingDeviceContextQuartz*>(maskImageContext)->cgContext();
             const_cast<RenderObject*>(renderObject)->style()->setColor(Color(255, 255, 255));
@@ -285,6 +292,7 @@ void KRenderingPaintServerGradientQuartz::renderPath(const KRenderingPaintServer
 void KRenderingPaintServerGradientQuartz::teardown(const KRenderingPaintServerGradient *server, KRenderingDeviceContext* renderingContext, const RenderObject* renderObject, KCPaintTargetType type) const
 { 
     CGShadingRef shading = m_shadingCache;
+    KCanvasImage* maskImage = m_maskImage;
     KRenderingDeviceQuartz* quartzDevice = static_cast<KRenderingDeviceQuartz*>(renderingDevice());
     CGContextRef context = quartzDevice->currentCGContext();
     RenderStyle* renderStyle = renderObject->style();
@@ -307,7 +315,8 @@ void KRenderingPaintServerGradientQuartz::teardown(const KRenderingPaintServerGr
             CGColorSpaceRef grayColorSpace = CGColorSpaceCreateDeviceGray();
             CGContextRef grayscaleContext = CGBitmapContextCreate(imageBuffer, width, height, 8, width, grayColorSpace, kCGImageAlphaNone);
             CGColorSpaceRelease(grayColorSpace);
-            CGContextDrawLayerAtPoint(grayscaleContext, CGPointMake(0, 0), m_maskImage->cgLayer());
+            KCanvasImageQuartz* qMaskImage = static_cast<KCanvasImageQuartz*>(maskImage);
+            CGContextDrawLayerAtPoint(grayscaleContext, CGPointMake(0, 0), qMaskImage->cgLayer());
             CGImageRef grayscaleImage = CGBitmapContextCreateImage(grayscaleContext);
             CGContextClipToMask(context, CGRectMake(0, 0, width, height), grayscaleImage);
             CGContextRelease(grayscaleContext);
index 18019904719351660dbec26cf48ae05e6eb811bd..891f40225b12b03bc90f66b3387e6c2d7b64a256 100644 (file)
@@ -31,7 +31,7 @@
 
 namespace WebCore {
 
-class SVGResourceImage;
+class KCanvasImage;
 
 class KRenderingPaintServerQuartzHelper {
 public:
@@ -93,7 +93,7 @@ public:
 protected:
     void invalidateCaches();
     CGShadingRef m_shadingCache;
-    mutable RefPtr<SVGResourceImage> m_maskImage;
+    mutable KCanvasImage *m_maskImage;
 };
 
 class KRenderingPaintServerLinearGradientQuartz : public KRenderingPaintServerGradientQuartz,
index fb6844ab9758c1deb9e4402153c3b09271007ed0..7a2d243c3ccbf6b6df765f0922103f9c5d89c562 100644 (file)
 
 
 #include "config.h"
-
 #ifdef SVG_SUPPORT
-#import "SVGResourceImage.h"
 #import "KRenderingPaintServerQuartz.h"
-#import "RenderPath.h"
 #import "QuartzSupport.h"
+#import "KCanvasResourcesQuartz.h"
 #import "KRenderingDeviceQuartz.h"
 
 #import "KCanvasRenderingStyle.h"
@@ -135,7 +133,7 @@ void KRenderingPaintServerSolidQuartz::teardown(KRenderingDeviceContext* renderi
 
 void patternCallback(void *info, CGContextRef context)
 {
-    CGLayerRef layer = reinterpret_cast<SVGResourceImage*>(info)->cgLayer();
+    CGLayerRef layer = reinterpret_cast<KCanvasImageQuartz*>(info)->cgLayer();
     CGContextDrawLayerAtPoint(context, CGPointZero, layer);
 }
 
@@ -157,7 +155,7 @@ bool KRenderingPaintServerPatternQuartz::setup(KRenderingDeviceContext* renderin
     KRenderingDeviceContextQuartz* quartzContext = static_cast<KRenderingDeviceContextQuartz*>(renderingContext);
     CGContextRef context = quartzContext->cgContext();
 
-    RefPtr<SVGResourceImage> cell = tile();
+    KCanvasImage* cell = tile();
     if (!cell)
         return false;
 
index 55f3673d1cdc55478e4c39c9806addb3cf965526..a9893cc310e1f4d697a984d2eb3190117ce006f7 100644 (file)
@@ -30,8 +30,8 @@
 #import "QuartzSupport.h"
 
 #import "GraphicsContext.h"
+#import "KCanvasResourcesQuartz.h"
 #import "KCanvasRenderingStyle.h"
-#import "RenderStyle.h"
 #import "wtf/Assertions.h"
 
 #import <QuartzCore/CoreImage.h>
index 6c351d45acaf0a8f8d857989ad027e6eb19a25b1..143a526eae36adff9cc43bbeaeef33a597b4a278 100644 (file)
 
 #include "config.h"
 #ifdef SVG_SUPPORT
-#include "KCanvasRenderingStyle.h"
 
 #include "CSSValueList.h"
 #include "Document.h"
+#include "KCanvasRenderingStyle.h"
 #include "KRenderingDevice.h"
 #include "KRenderingPaintServerGradient.h"
 #include "KRenderingPaintServerSolid.h"
 #include "RenderObject.h"
-#include "RenderPath.h"
 #include "SVGLength.h"
 #include "SVGRenderStyle.h"
 #include "SVGStyledElement.h"
 #include "ksvg.h"
 
-#include <wtf/PassRefPtr.h>
-
 namespace WebCore {
 
 static KRenderingPaintServerSolid* sharedSolidPaintServer()
 {
     static KRenderingPaintServerSolid* _sharedSolidPaintServer = 0;
     if (!_sharedSolidPaintServer)
-        _sharedSolidPaintServer = static_cast<KRenderingPaintServerSolid*>(renderingDevice()->createPaintServer(PS_SOLID).releaseRef());
+        _sharedSolidPaintServer = static_cast<KRenderingPaintServerSolid*>(renderingDevice()->createPaintServer(PS_SOLID));
     return _sharedSolidPaintServer;
 }
 
index 530232eaaa7a1b1a5c2e004573b110f960d6b302..18ba6d2ce8f12ea44c5101a50a0a4dbd7bd6598c 100644 (file)
@@ -42,10 +42,12 @@ SVGClipPathElement::SVGClipPathElement(const QualifiedName& tagName, Document* d
     , SVGExternalResourcesRequired()
     , m_clipPathUnits(SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE)
 {
+    m_clipper = 0;
 }
 
 SVGClipPathElement::~SVGClipPathElement()
 {
+    delete m_clipper;
 }
 
 ANIMATED_PROPERTY_DEFINITIONS(SVGClipPathElement, int, Enumeration, enumeration, ClipPathUnits, clipPathUnits, SVGNames::clipPathUnitsAttr.localName(), m_clipPathUnits)
@@ -69,13 +71,12 @@ void SVGClipPathElement::parseMappedAttribute(MappedAttribute* attr)
     }
 }
 
-SVGResource* SVGClipPathElement::canvasResource()
+KCanvasClipper* SVGClipPathElement::canvasResource()
 {
     if (!view())
         return 0;
-
     if (!m_clipper)
-        m_clipper = new SVGResourceClipper();
+        m_clipper = static_cast<KCanvasClipper*>(renderingDevice()->createResource(RS_CLIPPER));
     else
         m_clipper->resetClipData();
 
@@ -96,7 +97,7 @@ SVGResource* SVGClipPathElement::canvasResource()
         }
     }
     clipPathStyle->deref(view()->renderArena());
-    return m_clipper.get();
+    return m_clipper;
 }
 
 }
index 9e46f740e42b166bf0bf6fb63a8e8cd43900160c..bd075ead32dc71c065dd7ee6f300ecf90886d565 100644 (file)
@@ -24,7 +24,7 @@
 #define KSVG_SVGClipPathElementImpl_H
 #ifdef SVG_SUPPORT
 
-#include "SVGResourceClipper.h"
+#include "KCanvasClipper.h"
 #include "SVGExternalResourcesRequired.h"
 #include "SVGLangSpace.h"
 #include "SVGStyledTransformableElement.h"
@@ -43,7 +43,7 @@ namespace WebCore
         
         virtual bool isValid() const { return SVGTests::isValid(); }
 
-        virtual SVGResource* canvasResource();
+        virtual KCanvasClipper* canvasResource();
 
         // 'SVGClipPathElement' functions
         virtual void parseMappedAttribute(MappedAttribute*);
@@ -56,7 +56,7 @@ namespace WebCore
 
         ANIMATED_PROPERTY_DECLARATIONS(SVGClipPathElement, int, int, ClipPathUnits, clipPathUnits)
 
-        RefPtr<SVGResourceClipper> m_clipper;
+        KCanvasClipper* m_clipper;
     };
 
 } // namespace WebCore
index fe548628ed9e607b8bee51d56bcaf06e09d6e5c5..09146d3493f02d95a76765cd577fc5e875f3be4a 100644 (file)
@@ -28,7 +28,7 @@
 #include "CachedImage.h"
 #include "DocLoader.h"
 #include "Document.h"
-#include "SVGResourceImage.h"
+#include "KCanvasImage.h"
 #include "KRenderingDevice.h"
 #include "SVGHelper.h"
 #include "SVGLength.h"
index 832a710794192c1d403d87a54215fc322c1a3295..a50497645b26d867b7f0f5b0231f4a0d1df889c4 100644 (file)
@@ -58,10 +58,13 @@ SVGFilterElement::SVGFilterElement(const QualifiedName& tagName, Document* doc)
     // Spec: If the attribute is not specified, the effect is as if a value of "120%" were specified.
     m_width->setValueAsString("120%");
     m_height->setValueAsString("120%");
+
+    m_filter = 0;
 }
 
 SVGFilterElement::~SVGFilterElement()
 {
+    delete m_filter;
 }
 
 ANIMATED_PROPERTY_DEFINITIONS(SVGFilterElement, int, Enumeration, enumeration, FilterUnits, filterUnits, SVGNames::filterUnitsAttr.localName(), m_filterUnits)
@@ -107,13 +110,13 @@ void SVGFilterElement::parseMappedAttribute(MappedAttribute* attr)
     }
 }
 
-SVGResource* SVGFilterElement::canvasResource()
+KCanvasFilter* SVGFilterElement::canvasResource()
 {
     if (!attached())
         return 0;
 
     if (!m_filter)
-        m_filter = WTF::static_pointer_cast<KCanvasFilter>(renderingDevice()->createResource(RS_FILTER));
+        m_filter = static_cast<KCanvasFilter*>(renderingDevice()->createResource(RS_FILTER));
 
     bool filterBBoxMode = filterUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX;
     m_filter->setFilterBoundingBoxMode(filterBBoxMode);
@@ -138,7 +141,7 @@ SVGResource* SVGFilterElement::canvasResource()
                 m_filter->addFilterEffect(fe->filterEffect());
         }
     }
-    return m_filter.get();
+    return m_filter;
 }
 
 }
index 86b2e0b56588dc44b4fd0ba1b3e6a6d17f1cfd60..4617e8c93e8d88f5a57f003fa86369056f6db590 100644 (file)
@@ -43,7 +43,7 @@ namespace WebCore {
         SVGFilterElement(const QualifiedName&, Document*);
         virtual ~SVGFilterElement();
 
-        virtual SVGResource* canvasResource();
+        virtual KCanvasFilter* canvasResource();
 
         // 'SVGFilterElement' functions
         void setFilterRes(unsigned long filterResX, unsigned long filterResY) const;
@@ -66,7 +66,7 @@ namespace WebCore {
         ANIMATED_PROPERTY_DECLARATIONS(SVGFilterElement, long, long, FilterResX, filterResX)
         ANIMATED_PROPERTY_DECLARATIONS(SVGFilterElement, long, long, FilterResY, filterResY)
 
-        RefPtr<KCanvasFilter> m_filter;
+        KCanvasFilter* m_filter;
     };
 
 } // namespace WebCore
index 2121cb4f7f2fc08c4719d18c1b4f9496e0fd6ff1..1e6a3d352dc70c2108df919daa4ef1d2dc283616 100644 (file)
@@ -25,7 +25,6 @@
 #include "SVGGradientElement.h"
 
 #include "KRenderingDevice.h"
-#include "RenderPath.h"
 #include "RenderView.h"
 #include "SVGHelper.h"
 #include "SVGNames.h"
@@ -45,10 +44,12 @@ SVGGradientElement::SVGGradientElement(const QualifiedName& tagName, Document* d
     , m_gradientUnits(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)
     , m_gradientTransform(new SVGTransformList)
 {
+    m_resource = 0;
 }
 
 SVGGradientElement::~SVGGradientElement()
 {
+    delete m_resource;
 }
 
 ANIMATED_PROPERTY_DEFINITIONS(SVGGradientElement, int, Enumeration, enumeration, GradientUnits, gradientUnits, SVGNames::gradientUnitsAttr.localName(), m_gradientUnits)
@@ -102,20 +103,21 @@ void SVGGradientElement::notifyAttributeChange() const
     }
 }
 
-SVGResource* SVGGradientElement::canvasResource()
+KRenderingPaintServerGradient* SVGGradientElement::canvasResource()
 {
     if (!m_resource) {
-        m_resource = WTF::static_pointer_cast<KRenderingPaintServerGradient>(renderingDevice()->createPaintServer(gradientType()));
+        KRenderingPaintServer* temp = renderingDevice()->createPaintServer(gradientType());
+        m_resource = static_cast<KRenderingPaintServerGradient*>(temp);
         m_resource->setListener(this);
         buildGradient(m_resource);
     }
-    return m_resource.get();
+    return m_resource;
 }
 
 void SVGGradientElement::resourceNotification() const
 {
     // We're referenced by a "client", build the gradient now...
-    buildGradient(static_cast<KRenderingPaintServerGradient*>(const_cast<SVGGradientElement*>(this)->canvasResource()));
+    buildGradient(const_cast<SVGGradientElement*>(this)->canvasResource());
 }
 
 void SVGGradientElement::rebuildStops() const
index 2caf59f4cae93c11516050badf6542cb4ce7ea41..b3ab34e77a6baa34f9892aa3359e54973a9bb015 100644 (file)
@@ -35,7 +35,7 @@ namespace WebCore {
     class SVGGradientElement : public SVGStyledElement,
                                public SVGURIReference,
                                public SVGExternalResourcesRequired,
-                               public SVGResourceListener
+                               public KCanvasResourceListener
     {
     public:
         enum SVGGradientType {
@@ -51,13 +51,12 @@ namespace WebCore {
         // 'SVGGradientElement' functions
         virtual void parseMappedAttribute(MappedAttribute*);
         virtual void notifyAttributeChange() const;
-
-        virtual SVGResource* canvasResource();
-
+        
+        virtual KRenderingPaintServerGradient* canvasResource();
         virtual void resourceNotification() const;
 
     protected:
-        virtual void buildGradient(PassRefPtr<KRenderingPaintServerGradient>) const = 0;
+        virtual void buildGradient(KRenderingPaintServerGradient*) const = 0;
         virtual KCPaintServerType gradientType() const = 0;
         void rebuildStops() const;
 
@@ -69,7 +68,7 @@ namespace WebCore {
         ANIMATED_PROPERTY_DECLARATIONS(SVGGradientElement, int, int, GradientUnits, gradientUnits)
         ANIMATED_PROPERTY_DECLARATIONS(SVGGradientElement, SVGTransformList*, RefPtr<SVGTransformList>, GradientTransform, gradientTransform)
 
-        mutable RefPtr<KRenderingPaintServerGradient> m_resource;
+        mutable KRenderingPaintServerGradient* m_resource;
     };
 
 } // namespace WebCore
index 6fd86209a8a807b6a50c5a431808d5c847e2190b..97f1f267c97f2d8eae6873766abdee555d9e36fb 100644 (file)
@@ -26,7 +26,7 @@
 #include "SVGImageElement.h"
 
 #include "CSSPropertyNames.h"
-#include "SVGResourceImage.h"
+#include "KCanvasImage.h"
 #include "RenderSVGContainer.h"
 #include "RenderSVGImage.h"
 #include "SVGDocument.h"
index 1015d7448230aa580b5fe6970e72a867b8d5d143..7e9be5c3dd59cd8b38a391bb1707cd3c1ca3bff0 100644 (file)
@@ -71,7 +71,7 @@ void SVGLinearGradientElement::parseMappedAttribute(MappedAttribute* attr)
         SVGGradientElement::parseMappedAttribute(attr);
 }
 
-void SVGLinearGradientElement::buildGradient(PassRefPtr<KRenderingPaintServerGradient> _grad) const
+void SVGLinearGradientElement::buildGradient(KRenderingPaintServerGradient* _grad) const
 {
     rebuildStops(); // rebuild stops before possibly importing them from any referenced gradient.
 
@@ -85,23 +85,23 @@ void SVGLinearGradientElement::buildGradient(PassRefPtr<KRenderingPaintServerGra
     float _x1 = x1()->value(), _y1 = y1()->value();
     float _x2 = x2()->value(), _y2 = y2()->value();
 
-    RefPtr<KRenderingPaintServerLinearGradient> grad = WTF::static_pointer_cast<KRenderingPaintServerLinearGradient>(_grad);
+    KRenderingPaintServerLinearGradient* grad = static_cast<KRenderingPaintServerLinearGradient*>(_grad);
     AffineTransform mat;
     if (gradientTransform()->numberOfItems() > 0)
         mat = gradientTransform()->consolidate()->matrix()->matrix();
 
     DeprecatedString ref = href().deprecatedString();
-    RefPtr<KRenderingPaintServer> pserver = getPaintServerById(document(), ref.mid(1));
+    KRenderingPaintServer* pserver = getPaintServerById(document(), ref.mid(1));
     
     if (pserver && (pserver->type() == PS_RADIAL_GRADIENT || pserver->type() == PS_LINEAR_GRADIENT)) {
         bool isLinear = pserver->type() == PS_LINEAR_GRADIENT;
-        KRenderingPaintServerGradient* gradient = static_cast<KRenderingPaintServerGradient*>(pserver.get());
+        KRenderingPaintServerGradient* gradient = static_cast<KRenderingPaintServerGradient*>(pserver);
 
         if (!hasAttribute(SVGNames::gradientUnitsAttr))
             bbox = gradient->boundingBoxMode();
             
         if (isLinear) {
-            KRenderingPaintServerLinearGradient* linear = static_cast<KRenderingPaintServerLinearGradient*>(pserver.get());
+            KRenderingPaintServerLinearGradient* linear = static_cast<KRenderingPaintServerLinearGradient*>(pserver);
             if (!hasAttribute(SVGNames::x1Attr))
                 _x1 = linear->gradientStart().x();
             else if (bbox)
index deb6297f6fc8bcb56c39606fa19c1fbc70f92db8..1a218c9084061ea7e26f87f8d950187270d41b27 100644 (file)
@@ -39,7 +39,7 @@ namespace WebCore
         virtual void parseMappedAttribute(MappedAttribute*);
 
     protected:
-        virtual void buildGradient(PassRefPtr<KRenderingPaintServerGradient>) const;
+        virtual void buildGradient(KRenderingPaintServerGradient*) const;
         virtual KCPaintServerType gradientType() const { return PS_LINEAR_GRADIENT; }
 
     protected:
index d3d2d62b13b13a98ca2c129a36343c9597d65a86..ef95a8f656a3f841c66b28ba819050a13a63b250 100644 (file)
@@ -50,11 +50,13 @@ SVGMarkerElement::SVGMarkerElement(const QualifiedName& tagName, Document* doc)
     , m_markerUnits(SVG_MARKERUNITS_STROKEWIDTH)
     , m_orientType(0)
     , m_orientAngle(new SVGAngle(this))
+    , m_marker(0)
 {
 }
 
 SVGMarkerElement::~SVGMarkerElement()
 {
+    delete m_marker;
 }
 
 void SVGMarkerElement::parseMappedAttribute(MappedAttribute* attr)
@@ -110,10 +112,10 @@ void SVGMarkerElement::setOrientToAngle(SVGAngle* angle)
     setOrientAngleBaseValue(angle);
 }
 
-SVGResource* SVGMarkerElement::canvasResource()
+KCanvasMarker* SVGMarkerElement::canvasResource()
 {
     if (!m_marker)
-        m_marker = new SVGResourceMarker();
+        m_marker = static_cast<KCanvasMarker*>(renderingDevice()->createResource(RS_MARKER));
     
     m_marker->setMarker(static_cast<RenderSVGContainer*>(renderer()));
 
@@ -130,7 +132,7 @@ SVGResource* SVGMarkerElement::canvasResource()
     m_marker->setRef(refX()->value(), refY()->value());
     m_marker->setUseStrokeWidth(markerUnits() == SVG_MARKERUNITS_STROKEWIDTH);
     
-    return m_marker.get();
+    return m_marker;
 }
 
 RenderObject* SVGMarkerElement::createRenderer(RenderArena* arena, RenderStyle* style)
index 2159ef5bf0d994e7d4e5f4f96128f07f14765f55..cc811d03cedbeeca1b5f5615609373bb64ff2802 100644 (file)
@@ -24,7 +24,7 @@
 #define SVGMarkerElement_H
 #ifdef SVG_SUPPORT
 
-#include "SVGResourceMarker.h"
+#include "KCanvasMarker.h"
 #include "SVGExternalResourcesRequired.h"
 #include "SVGFitToViewBox.h"
 #include "SVGLangSpace.h"
@@ -65,7 +65,7 @@ namespace WebCore
     
         virtual bool rendererIsNeeded(RenderStyle* style) { return StyledElement::rendererIsNeeded(style); }
         virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
-        virtual SVGResource* canvasResource();
+        virtual KCanvasMarker* canvasResource();
 
     protected:
         virtual const SVGElement* contextElement() const { return this; }
@@ -83,7 +83,7 @@ namespace WebCore
         ANIMATED_PROPERTY_DECLARATIONS(SVGMarkerElement, int, int, OrientType, orientType)
         ANIMATED_PROPERTY_DECLARATIONS(SVGMarkerElement, SVGAngle*, RefPtr<SVGAngle>, OrientAngle, orientAngle)
 
-        RefPtr<SVGResourceMarker> m_marker;
+        KCanvasMarker* m_marker;
     };
 
 } // namespace WebCore
index af0c730c4d58f01bc279c4b099ebe5befe3bd6ec..72567af28cf65f7bfce0f58dde03406f31c43d12 100644 (file)
@@ -26,7 +26,7 @@
 #include "SVGMaskElement.h"
 
 #include "GraphicsContext.h"
-#include "SVGResourceImage.h"
+#include "KCanvasImage.h"
 #include "KRenderingDevice.h"
 #include "RenderSVGContainer.h"
 #include "SVGHelper.h"
@@ -48,12 +48,14 @@ SVGMaskElement::SVGMaskElement(const QualifiedName& tagName, Document* doc)
     , m_y(new SVGLength(this, LM_HEIGHT, viewportElement()))
     , m_width(new SVGLength(this, LM_WIDTH, viewportElement()))
     , m_height(new SVGLength(this, LM_HEIGHT, viewportElement()))
+    , m_masker(0)
     , m_dirty(true)
 {
 }
 
 SVGMaskElement::~SVGMaskElement()
 {
+    delete m_masker;
 }
 
 ANIMATED_PROPERTY_DEFINITIONS(SVGMaskElement, SVGLength*, Length, length, X, x, SVGNames::xAttr.localName(), m_x.get())
@@ -99,15 +101,14 @@ void SVGMaskElement::parseMappedAttribute(MappedAttribute* attr)
     }
 }
 
-SVGResourceImage* SVGMaskElement::drawMaskerContent()
+KCanvasImage* SVGMaskElement::drawMaskerContent()
 {
     KRenderingDevice* device = renderingDevice();
     if (!device->currentContext()) // FIXME: hack for now until Image::lockFocus exists
         return 0;
     if (!renderer())
         return 0;
-
-    SVGResourceImage* maskImage = new SVGResourceImage();
+    KCanvasImage* maskImage = static_cast<KCanvasImage*>(device->createResource(RS_IMAGE));
 
     IntSize size = IntSize(lroundf(width()->value()), lroundf(height()->value()));
     maskImage->init(size);
@@ -136,18 +137,18 @@ RenderObject* SVGMaskElement::createRenderer(RenderArena* arena, RenderStyle*)
     return maskContainer;
 }
 
-SVGResource* SVGMaskElement::canvasResource()
+KCanvasMasker* SVGMaskElement::canvasResource()
 {
     if (!m_masker) {
-        m_masker = new SVGResourceMasker();
+        m_masker = static_cast<KCanvasMasker*>(renderingDevice()->createResource(RS_MASKER));
         m_dirty = true;
     }
     if (m_dirty) {
-        RefPtr<SVGResourceImage> mask(drawMaskerContent());
-        m_masker->setMask(mask);
-        m_dirty = (mask != 0);
+        KCanvasImage* newMaskImage = drawMaskerContent();
+        m_masker->setMask(newMaskImage);
+        m_dirty = (newMaskImage != 0);
     }
-    return m_masker.get();
+    return m_masker;
 }
 
 }
index 26fcb2fcc2e10a2186d43ca893a773dbf9deab82..687f9437311d77d99320d75c0d4ec442f6a8e192 100644 (file)
@@ -23,7 +23,7 @@
 #define SVGMaskElement_H
 #ifdef SVG_SUPPORT
 
-#include "SVGResourceMasker.h"
+#include "KCanvasMasker.h"
 #include "SVGExternalResourcesRequired.h"
 #include "SVGLangSpace.h"
 #include "SVGStyledLocatableElement.h"
@@ -52,10 +52,10 @@ namespace WebCore
 
         virtual bool rendererIsNeeded(RenderStyle* style) { return StyledElement::rendererIsNeeded(style); }
         virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
-        virtual SVGResource* canvasResource();
+        virtual KCanvasMasker* canvasResource();
 
     protected:
-        SVGResourceImage* drawMaskerContent();
+        KCanvasImage* drawMaskerContent();
 
         ANIMATED_PROPERTY_FORWARD_DECLARATIONS(SVGURIReference, String, Href, href)
         ANIMATED_PROPERTY_FORWARD_DECLARATIONS(SVGExternalResourcesRequired, bool, ExternalResourcesRequired, externalResourcesRequired)
@@ -68,7 +68,7 @@ namespace WebCore
         virtual const SVGElement* contextElement() const { return this; }
 
     private:
-        RefPtr<SVGResourceMasker> m_masker;
+        KCanvasMasker* m_masker;
         bool m_dirty;
     };
 
index 904d747e3a7946af67e75ea2db355e638c3595ee..8a59fa667d4da2339b8dae60bbf99c898458f2d4 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "Document.h"
 #include "GraphicsContext.h"
-#include "SVGResourceImage.h"
+#include "KCanvasImage.h"
 #include "KRenderingDevice.h"
 #include "KRenderingPaintServerPattern.h"
 #include "RenderSVGContainer.h"
@@ -50,7 +50,7 @@ SVGPatternElement::SVGPatternElement(const QualifiedName& tagName, Document* doc
     , SVGLangSpace()
     , SVGExternalResourcesRequired()
     , SVGFitToViewBox()
-    , SVGResourceListener()
+    , KCanvasResourceListener()
     , m_x(new SVGLength(this, LM_WIDTH, viewportElement()))
     , m_y(new SVGLength(this, LM_HEIGHT, viewportElement()))
     , m_width(new SVGLength(this, LM_WIDTH, viewportElement()))
@@ -59,11 +59,14 @@ SVGPatternElement::SVGPatternElement(const QualifiedName& tagName, Document* doc
     , m_patternContentUnits(SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE)
     , m_patternTransform(new SVGTransformList)
 {
+    m_tile = 0;
+    m_paintServer = 0;
     m_ignoreAttributeChanges = false;
 }
 
 SVGPatternElement::~SVGPatternElement()
 {
+    delete m_paintServer;
 }
 
 ANIMATED_PROPERTY_DEFINITIONS(SVGPatternElement, int, Enumeration, enumeration, PatternUnits, patternUnits, SVGNames::patternUnitsAttr.localName(), m_patternUnits)
@@ -136,12 +139,12 @@ void SVGPatternElement::resourceNotification() const
 void SVGPatternElement::fillAttributesFromReferencePattern(const SVGPatternElement* target, AffineTransform& patternTransformMatrix)
 {
     DeprecatedString ref = href().deprecatedString();
-    RefPtr<KRenderingPaintServer> refServer = getPaintServerById(document(), ref.mid(1));
+    KRenderingPaintServer* refServer = getPaintServerById(document(), ref.mid(1));
 
     if (!refServer || refServer->type() != PS_PATTERN)
         return;
     
-    RefPtr<KRenderingPaintServerPattern> refPattern = WTF::static_pointer_cast<KRenderingPaintServerPattern>(refServer);
+    KRenderingPaintServerPattern* refPattern = static_cast<KRenderingPaintServerPattern*>(refServer);
     
     if (!hasAttribute(SVGNames::patternUnitsAttr)) {
         const AtomicString& value = target->getAttribute(SVGNames::patternUnitsAttr);
@@ -181,15 +184,16 @@ void SVGPatternElement::drawPatternContentIntoTile(const SVGPatternElement* targ
             savedContext = const_cast<SVGPatternElement*>(this)->pushAttributeContext(activeElement);
     }
     
-    m_tile = new SVGResourceImage();
+    delete m_tile;
+    m_tile = static_cast<KCanvasImage*>(device->createResource(RS_IMAGE));
     m_tile->init(newSize);
 
-    KRenderingDeviceContext* patternContext = device->contextForImage(m_tile.get());
+    KRenderingDeviceContext* patternContext = device->contextForImage(m_tile);
     device->pushContext(patternContext);
     FloatRect rect(x()->value(), y()->value(), width()->value(), height()->value());
     m_paintServer->setBbox(rect);
     m_paintServer->setPatternTransform(patternTransformMatrix);
-    m_paintServer->setTile(m_tile.get());
+    m_paintServer->setTile(m_tile);
 
     OwnPtr<GraphicsContext> context(patternContext->createGraphicsContext());
 
@@ -324,13 +328,14 @@ RenderObject* SVGPatternElement::createRenderer(RenderArena* arena, RenderStyle*
     return patternContainer;
 }
 
-SVGResource* SVGPatternElement::canvasResource()
+KRenderingPaintServerPattern* SVGPatternElement::canvasResource()
 {
     if (!m_paintServer) {
-        m_paintServer = WTF::static_pointer_cast<KRenderingPaintServerPattern>(renderingDevice()->createPaintServer(KCPaintServerType(PS_PATTERN)));
+        KRenderingPaintServer* pserver = renderingDevice()->createPaintServer(KCPaintServerType(PS_PATTERN));
+        m_paintServer = static_cast<KRenderingPaintServerPattern*>(pserver);
         m_paintServer->setListener(const_cast<SVGPatternElement*>(this));
     }
-    return m_paintServer.get();
+    return m_paintServer;
 }
 
 SVGMatrix* SVGPatternElement::getCTM() const
index d699920e30dd8a5116e91312dbb0895c5cc81ea5..3d54f8ae6b15d14f381f72e1ab1141843c37a09f 100644 (file)
@@ -32,7 +32,7 @@
 #include "SVGTests.h"
 #include "SVGURIReference.h"
 
-class SVGResourceImage;
+class KCanvasImage;
 
 namespace WebCore
 {
@@ -45,7 +45,7 @@ namespace WebCore
                               public SVGLangSpace,
                               public SVGExternalResourcesRequired,
                               public SVGFitToViewBox,
-                              public SVGResourceListener
+                              public KCanvasResourceListener
     {
     public:
         SVGPatternElement(const QualifiedName&, Document*);
@@ -63,7 +63,7 @@ namespace WebCore
 
         virtual bool rendererIsNeeded(RenderStyle* style) { return StyledElement::rendererIsNeeded(style); }
         virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
-        virtual SVGResource* canvasResource();
+        virtual KRenderingPaintServerPattern* canvasResource();
 
         // 'virtual SVGLocatable' functions
         virtual SVGMatrix* getCTM() const;
@@ -82,9 +82,9 @@ namespace WebCore
         ANIMATED_PROPERTY_DECLARATIONS(SVGPatternElement, int, int, PatternContentUnits, patternContentUnits)
         ANIMATED_PROPERTY_DECLARATIONS(SVGPatternElement, SVGTransformList*, RefPtr<SVGTransformList>, PatternTransform, patternTransform)
 
-        mutable RefPtr<SVGResourceImage> m_tile;
+        mutable KCanvasImage* m_tile;
         mutable bool m_ignoreAttributeChanges;
-        mutable RefPtr<KRenderingPaintServerPattern> m_paintServer;
+        mutable KRenderingPaintServerPattern* m_paintServer;
         
         virtual const SVGElement* contextElement() const { return this; }
 
index 6b2ec6f9cc48d1dac71766c353d53fd001bc2d38..608d323a3c3648f48a94f12b7d47d743c161db37 100644 (file)
@@ -77,7 +77,7 @@ void SVGRadialGradientElement::parseMappedAttribute(MappedAttribute* attr)
         SVGGradientElement::parseMappedAttribute(attr);
 }
 
-void SVGRadialGradientElement::buildGradient(PassRefPtr<KRenderingPaintServerGradient> _grad) const
+void SVGRadialGradientElement::buildGradient(KRenderingPaintServerGradient* _grad) const
 {
     rebuildStops(); // rebuild stops before possibly importing them from any referenced gradient.
 
@@ -94,23 +94,23 @@ void SVGRadialGradientElement::buildGradient(PassRefPtr<KRenderingPaintServerGra
     float _fx = fxSet ? fx()->value() : _cx;
     float _fy = fySet ? fy()->value() : _cy;
 
-    RefPtr<KRenderingPaintServerRadialGradient> grad = WTF::static_pointer_cast<KRenderingPaintServerRadialGradient>(_grad);
+    KRenderingPaintServerRadialGradient* grad = static_cast<KRenderingPaintServerRadialGradient*>(_grad);
     AffineTransform mat;
     if (gradientTransform()->numberOfItems() > 0)
         mat = gradientTransform()->consolidate()->matrix()->matrix();
 
     DeprecatedString ref = href().deprecatedString();
-    RefPtr<KRenderingPaintServer> pserver = getPaintServerById(document(), ref.mid(1));
+    KRenderingPaintServer* pserver = getPaintServerById(document(), ref.mid(1));
 
     if (pserver && (pserver->type() == PS_RADIAL_GRADIENT || pserver->type() == PS_LINEAR_GRADIENT)) {
         bool isRadial = pserver->type() == PS_RADIAL_GRADIENT;
-        RefPtr<KRenderingPaintServerGradient> gradient = WTF::static_pointer_cast<KRenderingPaintServerGradient>(pserver);
+        KRenderingPaintServerGradient* gradient = static_cast<KRenderingPaintServerGradient*>(pserver);
 
         if (!hasAttribute(SVGNames::gradientUnitsAttr))
             bbox = gradient->boundingBoxMode();
 
         if (isRadial) {
-            RefPtr<KRenderingPaintServerRadialGradient> radial = WTF::static_pointer_cast<KRenderingPaintServerRadialGradient>(pserver);
+            KRenderingPaintServerRadialGradient* radial = static_cast<KRenderingPaintServerRadialGradient*>(pserver);
             if (!hasAttribute(SVGNames::cxAttr))
                 _cx = radial->gradientCenter().x();
             else if (bbox)
@@ -146,7 +146,7 @@ void SVGRadialGradientElement::buildGradient(PassRefPtr<KRenderingPaintServerGra
 
         // Inherit color stops if empty
         if (grad->gradientStops().isEmpty())
-            grad->setGradientStops(gradient.get());
+            grad->setGradientStops(gradient);
 
         if (!hasAttribute(SVGNames::spreadMethodAttr))
             grad->setGradientSpreadMethod(gradient->spreadMethod());
index fda2d05097049e5c5cecf8df97da402e7680a209..af94a3de77b2800e6266bf4180e2fc1c5eef3a81 100644 (file)
@@ -39,7 +39,7 @@ namespace WebCore
         virtual void parseMappedAttribute(MappedAttribute*);
 
     protected:
-        virtual void buildGradient(PassRefPtr<KRenderingPaintServerGradient>) const;
+        virtual void buildGradient(KRenderingPaintServerGradient*) const;
         virtual KCPaintServerType gradientType() const { return PS_RADIAL_GRADIENT; }
 
     protected:
index 00853000c5dc1f8fc7335da92478abff2739f00c..aa59b80c4c24f971fe6b56a7ccbf47a0b6f58f5a 100644 (file)
 #include "RenderStyle.h"
 #include "SVGElement.h"
 #include "SVGStylable.h"
-#include "SVGResource.h"
 #include "Path.h"
 
 namespace WebCore {
 
     class CSSStyleDeclaration;
+    class KCanvasResource;
     class KRenderingDevice;
     class RenderPath;
     class RenderView;
@@ -50,7 +50,7 @@ namespace WebCore {
         virtual bool rendererIsNeeded(RenderStyle*) { return false; }
         virtual Path toPathData() const { return Path(); }
         virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
-        virtual SVGResource* canvasResource() { return 0; }
+        virtual KCanvasResource* canvasResource() { return 0; }
         
         virtual void parseMappedAttribute(MappedAttribute*);
 
diff --git a/WebCore/platform/GraphicsContext.cpp b/WebCore/platform/GraphicsContext.cpp
new file mode 100644 (file)
index 0000000..c65a422
--- /dev/null
@@ -0,0 +1,296 @@
+/*
+ * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc.  All rights reserved.
+ *
+ * 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"
+#include "GraphicsContext.h"
+
+#include "Font.h"
+#include "TextStyle.h"
+
+using namespace std;
+
+namespace WebCore {
+
+struct GraphicsContextState {
+    GraphicsContextState() : fillColor(Color::black), paintingDisabled(false) { }
+    Font font;
+    Pen pen;
+    Color fillColor;
+    bool paintingDisabled;
+};
+        
+class GraphicsContextPrivate {
+public:
+    GraphicsContextPrivate();
+    
+    GraphicsContextState state;
+    Vector<GraphicsContextState> stack;
+    Vector<IntRect> m_focusRingRects;
+    int m_focusRingWidth;
+    int m_focusRingOffset;
+    bool m_updatingControlTints;
+};
+
+GraphicsContextPrivate::GraphicsContextPrivate()
+    : m_focusRingWidth(0)
+    , m_focusRingOffset(0)
+    , m_updatingControlTints(false)
+{
+}
+
+GraphicsContextPrivate* GraphicsContext::createGraphicsContextPrivate()
+{
+    return new GraphicsContextPrivate;
+}
+
+void GraphicsContext::destroyGraphicsContextPrivate(GraphicsContextPrivate* deleteMe)
+{
+    delete deleteMe;
+}
+
+void GraphicsContext::save()
+{
+    if (paintingDisabled())
+        return;
+
+    m_common->stack.append(m_common->state);
+    
+    savePlatformState();
+}
+
+void GraphicsContext::restore()
+{
+    if (paintingDisabled())
+        return;
+
+    if (m_common->stack.isEmpty()) {
+        LOG_ERROR("ERROR void GraphicsContext::restore() stack is empty");
+        return;
+    }
+    m_common->state = m_common->stack.last();
+    m_common->stack.removeLast();
+    
+    restorePlatformState();
+}
+
+const Font& GraphicsContext::font() const
+{
+    return m_common->state.font;
+}
+
+void GraphicsContext::setFont(const Font& aFont)
+{
+    m_common->state.font = aFont;
+}
+
+const Pen& GraphicsContext::pen() const
+{
+    return m_common->state.pen;
+}
+
+void GraphicsContext::setPen(const Pen& pen)
+{
+    m_common->state.pen = pen;
+}
+
+void GraphicsContext::setPen(Pen::PenStyle style)
+{
+    m_common->state.pen.setStyle(style);
+    m_common->state.pen.setColor(Color::black);
+    m_common->state.pen.setWidth(0);
+}
+
+void GraphicsContext::setPen(RGBA32 rgb)
+{
+    m_common->state.pen.setStyle(Pen::SolidLine);
+    m_common->state.pen.setColor(rgb);
+    m_common->state.pen.setWidth(0);
+}
+
+void GraphicsContext::setFillColor(const Color& color)
+{
+    m_common->state.fillColor = color;
+}
+
+Color GraphicsContext::fillColor() const
+{
+    return m_common->state.fillColor;
+}
+
+bool GraphicsContext::updatingControlTints() const
+{
+    return m_common->m_updatingControlTints;
+}
+
+void GraphicsContext::setUpdatingControlTints(bool b)
+{
+    setPaintingDisabled(b);
+    m_common->m_updatingControlTints = b;
+}
+
+void GraphicsContext::setPaintingDisabled(bool f)
+{
+    m_common->state.paintingDisabled = f;
+}
+
+bool GraphicsContext::paintingDisabled() const
+{
+    return m_common->state.paintingDisabled;
+}
+
+void GraphicsContext::drawImage(Image* image, const IntPoint& p, CompositeOperator op)
+{        
+    drawImage(image, p, IntRect(0, 0, -1, -1), op);
+}
+
+void GraphicsContext::drawImage(Image* image, const IntRect& r, CompositeOperator op)
+{
+    drawImage(image, r, IntRect(0, 0, -1, -1), op);
+}
+
+void GraphicsContext::drawImage(Image* image, const IntPoint& dest, const IntRect& srcRect, CompositeOperator op)
+{
+    drawImage(image, IntRect(dest, srcRect.size()), srcRect, op);
+}
+
+void GraphicsContext::drawImage(Image* image, const IntRect& dest, const IntRect& srcRect, CompositeOperator op)
+{
+    drawImage(image, FloatRect(dest), srcRect, op);
+}
+
+void GraphicsContext::drawText(const TextRun& run, const IntPoint& point)
+{
+    drawText(run, point, TextStyle());
+}
+
+void GraphicsContext::drawText(const TextRun& run, const IntPoint& point, const TextStyle& style)
+{
+    if (paintingDisabled())
+        return;
+    
+    font().drawText(this, run, style, point);
+}
+
+void GraphicsContext::drawHighlightForText(const TextRun& run, const IntPoint& point, int h, const TextStyle& style, const Color& backgroundColor)
+{
+    if (paintingDisabled())
+        return;
+
+    fillRect(font().selectionRectForText(run, style, point, h), backgroundColor);
+}
+
+void GraphicsContext::initFocusRing(int width, int offset)
+{
+    if (paintingDisabled())
+        return;
+    clearFocusRing();
+    
+    m_common->m_focusRingWidth = width;
+    m_common->m_focusRingOffset = offset;
+}
+
+void GraphicsContext::clearFocusRing()
+{
+    m_common->m_focusRingRects.clear();
+}
+
+IntRect GraphicsContext::focusRingBoundingRect()
+{
+    IntRect result = IntRect(0, 0, 0, 0);
+    
+    const Vector<IntRect>& rects = focusRingRects();
+    unsigned rectCount = rects.size();
+    for (unsigned i = 0; i < rectCount; i++)
+        result.unite(rects[i]);
+        
+    return result;
+}
+
+void GraphicsContext::addFocusRingRect(const IntRect& rect)
+{
+    if (paintingDisabled() || rect.isEmpty())
+        return;
+    m_common->m_focusRingRects.append(rect);
+}
+
+int GraphicsContext::focusRingWidth() const
+{
+    return m_common->m_focusRingWidth;
+}
+
+int GraphicsContext::focusRingOffset() const
+{
+    return m_common->m_focusRingOffset;
+}
+
+const Vector<IntRect>& GraphicsContext::focusRingRects() const
+{
+    return m_common->m_focusRingRects;
+}
+
+void GraphicsContext::drawImage(Image* image, const FloatRect& dest, const FloatRect& src, CompositeOperator op)
+{
+    if (paintingDisabled())
+        return;
+
+    float tsw = src.width();
+    float tsh = src.height();
+    float tw = dest.width();
+    float th = dest.height();
+        
+    if (tsw == -1)
+        tsw = image->width();
+    if (tsh == -1)
+        tsh = image->height();
+
+    if (tw == -1)
+        tw = image->width();
+    if (th == -1)
+        th = image->height();
+
+    image->draw(this, FloatRect(dest.location(), FloatSize(tw, th)), FloatRect(src.location(), FloatSize(tsw, tsh)), op);
+}
+
+void GraphicsContext::drawTiledImage(Image* image, const IntRect& rect, const IntPoint& srcPoint, const IntSize& tileSize, CompositeOperator op)
+{
+    if (paintingDisabled())
+        return;
+
+    image->drawTiled(this, rect, srcPoint, tileSize, op);
+}
+
+void GraphicsContext::drawTiledImage(Image* image, const IntRect& dest, const IntRect& srcRect, Image::TileRule hRule, Image::TileRule vRule, CompositeOperator op)
+{
+    if (paintingDisabled())
+        return;
+
+    if (hRule == Image::StretchTile && vRule == Image::StretchTile)
+        // Just do a scale.
+        return drawImage(image, dest, srcRect);
+
+    image->drawTiled(this, dest, srcRect, hRule, vRule, op);
+}
+
+}
diff --git a/WebCore/platform/GraphicsContext.h b/WebCore/platform/GraphicsContext.h
new file mode 100644 (file)
index 0000000..faeeaab
--- /dev/null
@@ -0,0 +1,198 @@
+/*
+ * Copyright (C) 2003, 2006 Apple Computer, Inc.  All rights reserved.
+ *
+ * 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 GraphicsContext_h
+#define GraphicsContext_h
+
+#include "FloatRect.h"
+#include "Image.h"
+#include "IntRect.h"
+#include "Pen.h"
+#include "TextDirection.h"
+#include "UChar.h"
+#include <wtf/Noncopyable.h>
+#include <wtf/Platform.h>
+
+#if PLATFORM(CG)
+typedef struct CGContext PlatformGraphicsContext;
+#elif PLATFORM(CAIRO)
+typedef struct _cairo PlatformGraphicsContext;
+#elif PLATFORM(QT)
+class QPainter;
+typedef QPainter PlatformGraphicsContext;
+#else
+typedef void PlatformGraphicsContext;
+#endif
+
+#if PLATFORM(WIN)
+typedef struct HDC__* HDC;
+#endif
+
+namespace WebCore {
+
+    const int cMisspellingLineThickness = 3;
+    const int cMisspellingLinePatternWidth = 4;
+    const int cMisspellingLinePatternGapWidth = 1;
+
+    class AffineTransform;
+    class Font;
+    class GraphicsContextPrivate;
+    class GraphicsContextPlatformPrivate;
+    class KURL;
+    class Path;
+    class TextRun;
+    class TextStyle;
+
+#ifdef SVG_SUPPORT
+    class KRenderingDeviceContext;
+#endif
+
+    class GraphicsContext : Noncopyable {
+    public:
+        GraphicsContext(PlatformGraphicsContext*);
+        ~GraphicsContext();
+       
+        PlatformGraphicsContext* platformContext() const;
+
+        const Font& font() const;
+        void setFont(const Font&);
+        
+        const Pen& pen() const;
+        void setPen(const Pen&);
+        void setPen(Pen::PenStyle);
+        void setPen(RGBA32);
+        
+        Color fillColor() const;
+        void setFillColor(const Color&);
+
+        void save();
+        void restore();
+        
+        void drawRect(const IntRect&);
+        void drawLine(const IntPoint&, const IntPoint&);
+        void drawEllipse(const IntRect&);
+        void drawArc(const IntRect&, float thickness, int startAngle, int angleSpan);
+        void drawConvexPolygon(size_t numPoints, const FloatPoint*, bool shouldAntialias = false);
+
+        void fillRect(const IntRect&, const Color&);
+        void fillRect(const FloatRect&, const Color&);
+        void clearRect(const FloatRect&);
+        void strokeRect(const FloatRect&, float lineWidth);
+
+        void drawImage(Image*, const IntPoint&, CompositeOperator = CompositeSourceOver);
+        void drawImage(Image*, const IntRect&, CompositeOperator = CompositeSourceOver);
+        void drawImage(Image*, const IntPoint& destPoint, const IntRect& srcRect, CompositeOperator = CompositeSourceOver);
+        void drawImage(Image*, const IntRect& destRect, const IntRect& srcRect, CompositeOperator = CompositeSourceOver);
+        void drawImage(Image*, const FloatRect& destRect, const FloatRect& srcRect = FloatRect(0, 0, -1, -1),
+            CompositeOperator = CompositeSourceOver);
+        void drawTiledImage(Image*, const IntRect& destRect, const IntPoint& srcPoint, const IntSize& tileSize,
+            CompositeOperator = CompositeSourceOver);
+        void drawTiledImage(Image*, const IntRect& destRect, const IntRect& srcRect, 
+            Image::TileRule hRule = Image::StretchTile, Image::TileRule vRule = Image::StretchTile,
+            CompositeOperator = CompositeSourceOver);
+
+        void clip(const IntRect&);
+        void addRoundedRectClip(const IntRect&, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight);
+        void addInnerRoundedRectClip(const IntRect&, int thickness);
+
+        // Functions to work around bugs in focus ring clipping on Mac.
+        void setFocusRingClip(const IntRect&);
+        void clearFocusRingClip();
+
+        void drawText(const TextRun&, const IntPoint&);
+        void drawText(const TextRun&, const IntPoint&, const TextStyle&);
+        void drawHighlightForText(const TextRun&, const IntPoint&, int h, const TextStyle&, const Color& backgroundColor);
+
+        FloatRect roundToDevicePixels(const FloatRect&);
+        
+        void drawLineForText(const IntPoint&, int yOffset, int width, bool printing);
+        void drawLineForMisspellingOrBadGrammar(const IntPoint&, int width, bool grammar);
+        
+        bool paintingDisabled() const;
+        void setPaintingDisabled(bool);
+        
+        bool updatingControlTints() const;
+        void setUpdatingControlTints(bool);
+
+        void beginTransparencyLayer(float opacity);
+        void endTransparencyLayer();
+
+        void setShadow(const IntSize&, int blur, const Color&);
+        void clearShadow();
+
+        void initFocusRing(int width, int offset);
+        void addFocusRingRect(const IntRect&);
+        void drawFocusRing(const Color&);
+        void clearFocusRing();
+        IntRect focusRingBoundingRect();
+
+        void setLineWidth(float);
+        void setLineCap(LineCap);
+        void setLineJoin(LineJoin);
+        void setMiterLimit(float);
+
+        void setAlpha(float);
+
+        void setCompositeOperation(CompositeOperator);
+
+        void clip(const Path&);
+
+        void scale(const FloatSize&);
+        void rotate(float angleInRadians);
+        void translate(float x, float y);
+        IntPoint origin();
+        
+        void setURLForRect(const KURL&, const IntRect&);
+
+        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
+
+    private:
+        void savePlatformState();
+        void restorePlatformState();
+
+        int focusRingWidth() const;
+        int focusRingOffset() const;
+        const Vector<IntRect>& focusRingRects() const;
+
+        static GraphicsContextPrivate* createGraphicsContextPrivate();
+        static void destroyGraphicsContextPrivate(GraphicsContextPrivate*);
+
+        GraphicsContextPrivate* m_common;
+        GraphicsContextPlatformPrivate* m_data;
+    };
+
+} // namespace WebCore
+
+#endif // GraphicsContext_h
diff --git a/WebCore/platform/GraphicsTypes.cpp b/WebCore/platform/GraphicsTypes.cpp
new file mode 100644 (file)
index 0000000..736356f
--- /dev/null
@@ -0,0 +1,119 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+ *
+ * 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"
+#include "GraphicsTypes.h"
+
+#include "PlatformString.h"
+#include <wtf/Assertions.h>
+
+namespace WebCore {
+
+static const char* const compositeOperatorNames[] = {
+    "clear",
+    "copy",
+    "source-over",
+    "source-in",
+    "source-out",
+    "source-atop",
+    "destination-over",
+    "destination-in",
+    "destination-out",
+    "destination-atop",
+    "xor",
+    "darker",
+    "highlight",
+    "lighter"
+};
+const int numCompositeOperatorNames = sizeof(compositeOperatorNames) / sizeof(compositeOperatorNames[0]);
+
+bool parseCompositeOperator(const String& s, CompositeOperator& op)
+{
+    for (int i = 0; i < numCompositeOperatorNames; i++)
+        if (s == compositeOperatorNames[i]) {
+            op = static_cast<CompositeOperator>(i);
+            return true;
+        }
+    return false;
+}
+
+String compositeOperatorName(CompositeOperator op)
+{
+    ASSERT(op >= 0);
+    ASSERT(op < numCompositeOperatorNames);
+    return compositeOperatorNames[op];
+}
+
+bool parseLineCap(const String& s, LineCap& cap)
+{
+    if (s == "butt") {
+        cap = ButtCap;
+        return true;
+    }
+    if (s == "round") {
+        cap = RoundCap;
+        return true;
+    }
+    if (s == "square") {
+        cap = SquareCap;
+        return true;
+    }
+    return false;
+}
+
+String lineCapName(LineCap cap)
+{
+    ASSERT(cap >= 0);
+    ASSERT(cap < 3);
+    const char* const names[3] = { "butt", "round", "square" };
+    return names[cap];
+}
+
+bool parseLineJoin(const String& s, LineJoin& join)
+{
+    if (s == "miter") {
+        join = MiterJoin;
+        return true;
+    }
+    if (s == "round") {
+        join = RoundJoin;
+        return true;
+    }
+    if (s == "bevel") {
+        join = BevelJoin;
+        return true;
+    }
+    return false;
+}
+
+String lineJoinName(LineJoin join)
+{
+    ASSERT(join >= 0);
+    ASSERT(join < 3);
+    const char* const names[3] = { "miter", "round", "bevel" };
+    return names[join];
+}
+
+}
diff --git a/WebCore/platform/GraphicsTypes.h b/WebCore/platform/GraphicsTypes.h
new file mode 100644 (file)
index 0000000..10bbc64
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.  All rights reserved.
+ *
+ * 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 GraphicsTypes_h
+#define GraphicsTypes_h
+
+namespace WebCore {
+
+    class String;
+
+    // Note: These constants exactly match the NSCompositeOperator constants of
+    // AppKit on Mac OS X. If that's ever changed, we'll need to change the Mac
+    // platform code to map one to the other.
+    enum CompositeOperator {
+        CompositeClear,
+        CompositeCopy,
+        CompositeSourceOver,
+        CompositeSourceIn,
+        CompositeSourceOut,
+        CompositeSourceAtop,
+        CompositeDestinationOver,
+        CompositeDestinationIn,
+        CompositeDestinationOut,
+        CompositeDestinationAtop,
+        CompositeXOR,
+        CompositePlusDarker,
+        CompositeHighlight,
+        CompositePlusLighter
+    };
+
+    enum LineCap { ButtCap, RoundCap, SquareCap };
+
+    enum LineJoin { MiterJoin, RoundJoin, BevelJoin };
+
+    enum HorizontalAlignment { AlignLeft, AlignRight, AlignHCenter };
+
+    String compositeOperatorName(CompositeOperator);
+    bool parseCompositeOperator(const String&, CompositeOperator&);
+
+    String lineCapName(LineCap);
+    bool parseLineCap(const String&, LineCap&);
+
+    String lineJoinName(LineJoin);
+    bool parseLineJoin(const String&, LineJoin&);
+
+}
+
+#endif
index c65a42218f449b1024fc076ef1cc085bb81703fc..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,296 +0,0 @@
-/*
- * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc.  All rights reserved.
- *
- * 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"
-#include "GraphicsContext.h"
-
-#include "Font.h"
-#include "TextStyle.h"
-
-using namespace std;
-
-namespace WebCore {
-
-struct GraphicsContextState {
-    GraphicsContextState() : fillColor(Color::black), paintingDisabled(false) { }
-    Font font;
-    Pen pen;
-    Color fillColor;
-    bool paintingDisabled;
-};
-        
-class GraphicsContextPrivate {
-public:
-    GraphicsContextPrivate();
-    
-    GraphicsContextState state;
-    Vector<GraphicsContextState> stack;
-    Vector<IntRect> m_focusRingRects;
-    int m_focusRingWidth;
-    int m_focusRingOffset;
-    bool m_updatingControlTints;
-};
-
-GraphicsContextPrivate::GraphicsContextPrivate()
-    : m_focusRingWidth(0)
-    , m_focusRingOffset(0)
-    , m_updatingControlTints(false)
-{
-}
-
-GraphicsContextPrivate* GraphicsContext::createGraphicsContextPrivate()
-{
-    return new GraphicsContextPrivate;
-}
-
-void GraphicsContext::destroyGraphicsContextPrivate(GraphicsContextPrivate* deleteMe)
-{
-    delete deleteMe;
-}
-
-void GraphicsContext::save()
-{
-    if (paintingDisabled())
-        return;
-
-    m_common->stack.append(m_common->state);
-    
-    savePlatformState();
-}
-
-void GraphicsContext::restore()
-{
-    if (paintingDisabled())
-        return;
-
-    if (m_common->stack.isEmpty()) {
-        LOG_ERROR("ERROR void GraphicsContext::restore() stack is empty");
-        return;
-    }
-    m_common->state = m_common->stack.last();
-    m_common->stack.removeLast();
-    
-    restorePlatformState();
-}
-
-const Font& GraphicsContext::font() const
-{
-    return m_common->state.font;
-}
-
-void GraphicsContext::setFont(const Font& aFont)
-{
-    m_common->state.font = aFont;
-}
-
-const Pen& GraphicsContext::pen() const
-{
-    return m_common->state.pen;
-}
-
-void GraphicsContext::setPen(const Pen& pen)
-{
-    m_common->state.pen = pen;
-}
-
-void GraphicsContext::setPen(Pen::PenStyle style)
-{
-    m_common->state.pen.setStyle(style);
-    m_common->state.pen.setColor(Color::black);
-    m_common->state.pen.setWidth(0);
-}
-
-void GraphicsContext::setPen(RGBA32 rgb)
-{
-    m_common->state.pen.setStyle(Pen::SolidLine);
-    m_common->state.pen.setColor(rgb);
-    m_common->state.pen.setWidth(0);
-}
-
-void GraphicsContext::setFillColor(const Color& color)
-{
-    m_common->state.fillColor = color;
-}
-
-Color GraphicsContext::fillColor() const
-{
-    return m_common->state.fillColor;
-}
-
-bool GraphicsContext::updatingControlTints() const
-{
-    return m_common->m_updatingControlTints;
-}
-
-void GraphicsContext::setUpdatingControlTints(bool b)
-{
-    setPaintingDisabled(b);
-    m_common->m_updatingControlTints = b;
-}
-
-void GraphicsContext::setPaintingDisabled(bool f)
-{
-    m_common->state.paintingDisabled = f;
-}
-
-bool GraphicsContext::paintingDisabled() const
-{
-    return m_common->state.paintingDisabled;
-}
-
-void GraphicsContext::drawImage(Image* image, const IntPoint& p, CompositeOperator op)
-{        
-    drawImage(image, p, IntRect(0, 0, -1, -1), op);
-}
-
-void GraphicsContext::drawImage(Image* image, const IntRect& r, CompositeOperator op)
-{
-    drawImage(image, r, IntRect(0, 0, -1, -1), op);
-}
-
-void GraphicsContext::drawImage(Image* image, const IntPoint& dest, const IntRect& srcRect, CompositeOperator op)
-{
-    drawImage(image, IntRect(dest, srcRect.size()), srcRect, op);
-}
-
-void GraphicsContext::drawImage(Image* image, const IntRect& dest, const IntRect& srcRect, CompositeOperator op)
-{
-    drawImage(image, FloatRect(dest), srcRect, op);
-}
-
-void GraphicsContext::drawText(const TextRun& run, const IntPoint& point)
-{
-    drawText(run, point, TextStyle());
-}
-
-void GraphicsContext::drawText(const TextRun& run, const IntPoint& point, const TextStyle& style)
-{
-    if (paintingDisabled())
-        return;
-    
-    font().drawText(this, run, style, point);
-}
-
-void GraphicsContext::drawHighlightForText(const TextRun& run, const IntPoint& point, int h, const TextStyle& style, const Color& backgroundColor)
-{
-    if (paintingDisabled())
-        return;
-
-    fillRect(font().selectionRectForText(run, style, point, h), backgroundColor);
-}
-
-void GraphicsContext::initFocusRing(int width, int offset)
-{
-    if (paintingDisabled())
-        return;
-    clearFocusRing();
-    
-    m_common->m_focusRingWidth = width;
-    m_common->m_focusRingOffset = offset;
-}
-
-void GraphicsContext::clearFocusRing()
-{
-    m_common->m_focusRingRects.clear();
-}
-
-IntRect GraphicsContext::focusRingBoundingRect()
-{
-    IntRect result = IntRect(0, 0, 0, 0);
-    
-    const Vector<IntRect>& rects = focusRingRects();
-    unsigned rectCount = rects.size();
-    for (unsigned i = 0; i < rectCount; i++)
-        result.unite(rects[i]);
-        
-    return result;
-}
-
-void GraphicsContext::addFocusRingRect(const IntRect& rect)
-{
-    if (paintingDisabled() || rect.isEmpty())
-        return;
-    m_common->m_focusRingRects.append(rect);
-}
-
-int GraphicsContext::focusRingWidth() const
-{
-    return m_common->m_focusRingWidth;
-}
-
-int GraphicsContext::focusRingOffset() const
-{
-    return m_common->m_focusRingOffset;
-}
-
-const Vector<IntRect>& GraphicsContext::focusRingRects() const
-{
-    return m_common->m_focusRingRects;
-}
-
-void GraphicsContext::drawImage(Image* image, const FloatRect& dest, const FloatRect& src, CompositeOperator op)
-{
-    if (paintingDisabled())
-        return;
-
-    float tsw = src.width();
-    float tsh = src.height();
-    float tw = dest.width();
-    float th = dest.height();
-        
-    if (tsw == -1)
-        tsw = image->width();
-    if (tsh == -1)
-        tsh = image->height();
-
-    if (tw == -1)
-        tw = image->width();
-    if (th == -1)
-        th = image->height();
-
-    image->draw(this, FloatRect(dest.location(), FloatSize(tw, th)), FloatRect(src.location(), FloatSize(tsw, tsh)), op);
-}
-
-void GraphicsContext::drawTiledImage(Image* image, const IntRect& rect, const IntPoint& srcPoint, const IntSize& tileSize, CompositeOperator op)
-{
-    if (paintingDisabled())
-        return;
-
-    image->drawTiled(this, rect, srcPoint, tileSize, op);
-}
-
-void GraphicsContext::drawTiledImage(Image* image, const IntRect& dest, const IntRect& srcRect, Image::TileRule hRule, Image::TileRule vRule, CompositeOperator op)
-{
-    if (paintingDisabled())
-        return;
-
-    if (hRule == Image::StretchTile && vRule == Image::StretchTile)
-        // Just do a scale.
-        return drawImage(image, dest, srcRect);
-
-    image->drawTiled(this, dest, srcRect, hRule, vRule, op);
-}
-
-}
index a2025edc993c4fd1c1a14af4421c4a21c2e0546b..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,198 +0,0 @@
-/*
- * Copyright (C) 2003, 2006 Apple Computer, Inc.  All rights reserved.
- *
- * 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 GraphicsContext_h
-#define GraphicsContext_h
-
-#include "FloatRect.h"
-#include "Image.h"
-#include "IntRect.h"
-#include "Pen.h"
-#include "TextDirection.h"
-#include "UChar.h"
-#include <wtf/Noncopyable.h>
-#include <wtf/Platform.h>
-
-#if PLATFORM(CG)
-typedef struct CGContext PlatformGraphicsContext;
-#elif PLATFORM(CAIRO)
-typedef struct _cairo PlatformGraphicsContext;
-#elif PLATFORM(QT)
-class QPainter;
-typedef QPainter PlatformGraphicsContext;
-#else
-typedef void PlatformGraphicsContext;
-#endif
-
-#if PLATFORM(WIN)
-typedef struct HDC__* HDC;
-#endif
-
-namespace WebCore {
-
-    const int cMisspellingLineThickness = 3;
-    const int cMisspellingLinePatternWidth = 4;
-    const int cMisspellingLinePatternGapWidth = 1;
-
-    class AffineTransform;
-    class Font;
-    class GraphicsContextPrivate;
-    class GraphicsContextPlatformPrivate;
-    class KURL;
-    class Path;
-    class TextRun;
-    class TextStyle;
-
-#ifdef SVG_SUPPORT
-    class KRenderingDeviceContext;
-#endif
-
-    class GraphicsContext : Noncopyable {
-    public:
-        GraphicsContext(PlatformGraphicsContext*);
-        ~GraphicsContext();
-       
-        PlatformGraphicsContext* platformContext() const;
-
-        const Font& font() const;
-        void setFont(const Font&);
-        
-        const Pen& pen() const;
-        void setPen(const Pen&);
-        void setPen(Pen::PenStyle);
-        void setPen(RGBA32);
-        
-        Color fillColor() const;
-        void setFillColor(const Color&);
-
-        void save();
-        void restore();
-        
-        void drawRect(const IntRect&);
-        void drawLine(const IntPoint&, const IntPoint&);
-        void drawEllipse(const IntRect&);
-        void drawArc(const IntRect&, float thickness, int startAngle, int angleSpan);
-        void drawConvexPolygon(size_t numPoints, const FloatPoint*, bool shouldAntialias = false);
-
-        void fillRect(const IntRect&, const Color&);
-        void fillRect(const FloatRect&, const Color&);
-        void clearRect(const FloatRect&);
-        void strokeRect(const FloatRect&, float lineWidth);
-
-        void drawImage(Image*, const IntPoint&, CompositeOperator = CompositeSourceOver);
-        void drawImage(Image*, const IntRect&, CompositeOperator = CompositeSourceOver);
-        void drawImage(Image*, const IntPoint& destPoint, const IntRect& srcRect, CompositeOperator = CompositeSourceOver);
-        void drawImage(Image*, const IntRect& destRect, const IntRect& srcRect, CompositeOperator = CompositeSourceOver);
-        void drawImage(Image*, const FloatRect& destRect, const FloatRect& srcRect = FloatRect(0, 0, -1, -1),
-            CompositeOperator = CompositeSourceOver);
-        void drawTiledImage(Image*, const IntRect& destRect, const IntPoint& srcPoint, const IntSize& tileSize,
-            CompositeOperator = CompositeSourceOver);
-        void drawTiledImage(Image*, const IntRect& destRect, const IntRect& srcRect, 
-            Image::TileRule hRule = Image::StretchTile, Image::TileRule vRule = Image::StretchTile,
-            CompositeOperator = CompositeSourceOver);
-
-        void clip(const IntRect&);
-        void addRoundedRectClip(const IntRect&, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight);
-        void addInnerRoundedRectClip(const IntRect&, int thickness);
-
-        // Functions to work around bugs in focus ring clipping on Mac.
-        void setFocusRingClip(const IntRect&);
-        void clearFocusRingClip();
-
-        void drawText(const TextRun&, const IntPoint&);
-        void drawText(const TextRun&, const IntPoint&, const TextStyle&);
-        void drawHighlightForText(const TextRun&, const IntPoint&, int h, const TextStyle&, const Color& backgroundColor);
-
-        FloatRect roundToDevicePixels(const FloatRect&);
-        
-        void drawLineForText(const IntPoint&, int yOffset, int width, bool printing);
-        void drawLineForMisspellingOrBadGrammar(const IntPoint&, int width, bool grammar);
-       
-        bool paintingDisabled() const;
-        void setPaintingDisabled(bool);
-        
-        bool updatingControlTints() const;
-        void setUpdatingControlTints(bool);
-
-        void beginTransparencyLayer(float opacity);
-        void endTransparencyLayer();
-
-        void setShadow(const IntSize&, int blur, const Color&);
-        void clearShadow();
-
-        void initFocusRing(int width, int offset);
-        void addFocusRingRect(const IntRect&);
-        void drawFocusRing(const Color&);
-        void clearFocusRing();
-        IntRect focusRingBoundingRect();
-
-        void setLineWidth(float);
-        void setLineCap(LineCap);
-        void setLineJoin(LineJoin);
-        void setMiterLimit(float);
-
-        void setAlpha(float);
-
-        void setCompositeOperation(CompositeOperator);
-
-        void clip(const Path&);
-
-        void scale(const FloatSize&);
-        void rotate(float angleInRadians);
-        void translate(float x, float y);
-        IntPoint origin();
-        
-        void setURLForRect(const KURL&, const IntRect&);
-
-        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
-
-    private:
-        void savePlatformState();
-        void restorePlatformState();
-
-        int focusRingWidth() const;
-        int focusRingOffset() const;
-        const Vector<IntRect>& focusRingRects() const;
-
-        static GraphicsContextPrivate* createGraphicsContextPrivate();
-        static void destroyGraphicsContextPrivate(GraphicsContextPrivate*);
-
-        GraphicsContextPrivate* m_common;
-        GraphicsContextPlatformPrivate* m_data;
-    };
-
-} // namespace WebCore
-
-#endif // GraphicsContext_h
index 736356f451ef01292015036615e25a947afdfad5..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,119 +0,0 @@
-/*
- * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
- *
- * 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"
-#include "GraphicsTypes.h"
-
-#include "PlatformString.h"
-#include <wtf/Assertions.h>
-
-namespace WebCore {
-
-static const char* const compositeOperatorNames[] = {
-    "clear",
-    "copy",
-    "source-over",
-    "source-in",
-    "source-out",
-    "source-atop",
-    "destination-over",
-    "destination-in",
-    "destination-out",
-    "destination-atop",
-    "xor",
-    "darker",
-    "highlight",
-    "lighter"
-};
-const int numCompositeOperatorNames = sizeof(compositeOperatorNames) / sizeof(compositeOperatorNames[0]);
-
-bool parseCompositeOperator(const String& s, CompositeOperator& op)
-{
-    for (int i = 0; i < numCompositeOperatorNames; i++)
-        if (s == compositeOperatorNames[i]) {
-            op = static_cast<CompositeOperator>(i);
-            return true;
-        }
-    return false;
-}
-
-String compositeOperatorName(CompositeOperator op)
-{
-    ASSERT(op >= 0);
-    ASSERT(op < numCompositeOperatorNames);
-    return compositeOperatorNames[op];
-}
-
-bool parseLineCap(const String& s, LineCap& cap)
-{
-    if (s == "butt") {
-        cap = ButtCap;
-        return true;
-    }
-    if (s == "round") {
-        cap = RoundCap;
-        return true;
-    }
-    if (s == "square") {
-        cap = SquareCap;
-        return true;
-    }
-    return false;
-}
-
-String lineCapName(LineCap cap)
-{
-    ASSERT(cap >= 0);
-    ASSERT(cap < 3);
-    const char* const names[3] = { "butt", "round", "square" };
-    return names[cap];
-}
-
-bool parseLineJoin(const String& s, LineJoin& join)
-{
-    if (s == "miter") {
-        join = MiterJoin;
-        return true;
-    }
-    if (s == "round") {
-        join = RoundJoin;
-        return true;
-    }
-    if (s == "bevel") {
-        join = BevelJoin;
-        return true;
-    }
-    return false;
-}
-
-String lineJoinName(LineJoin join)
-{
-    ASSERT(join >= 0);
-    ASSERT(join < 3);
-    const char* const names[3] = { "miter", "round", "bevel" };
-    return names[join];
-}
-
-}
index 10bbc64c34bf525f6c1567ce713d4acc76af5ee5..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.  All rights reserved.
- *
- * 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 GraphicsTypes_h
-#define GraphicsTypes_h
-
-namespace WebCore {
-
-    class String;
-
-    // Note: These constants exactly match the NSCompositeOperator constants of
-    // AppKit on Mac OS X. If that's ever changed, we'll need to change the Mac
-    // platform code to map one to the other.
-    enum CompositeOperator {
-        CompositeClear,
-        CompositeCopy,
-        CompositeSourceOver,
-        CompositeSourceIn,
-        CompositeSourceOut,
-        CompositeSourceAtop,
-        CompositeDestinationOver,
-        CompositeDestinationIn,
-        CompositeDestinationOut,
-        CompositeDestinationAtop,
-        CompositeXOR,
-        CompositePlusDarker,
-        CompositeHighlight,
-        CompositePlusLighter
-    };
-
-    enum LineCap { ButtCap, RoundCap, SquareCap };
-
-    enum LineJoin { MiterJoin, RoundJoin, BevelJoin };
-
-    enum HorizontalAlignment { AlignLeft, AlignRight, AlignHCenter };
-
-    String compositeOperatorName(CompositeOperator);
-    bool parseCompositeOperator(const String&, CompositeOperator&);
-
-    String lineCapName(LineCap);
-    bool parseLineCap(const String&, LineCap&);
-
-    String lineJoinName(LineJoin);
-    bool parseLineJoin(const String&, LineJoin&);
-
-}
-
-#endif
index 22a91918bf80578f479f0a229290910fce40e4e3..b4c792892888787284190be2ee3ca2a0af645a23 100644 (file)
@@ -32,7 +32,6 @@
 
 #include "config.h"
 
-#include "AffineTransform.h"
 #include "Path.h"
 #include "Color.h"
 #include "GraphicsContext.h"
index 0990ee728027b31bf93201119ebacbaee4a8ff5b..dac936b71fd1c6727f7942e1587e80348b056fcc 100644 (file)
@@ -29,9 +29,9 @@
 
 #include "GraphicsContext.h"
 #include "RenderSVGContainer.h"
-#include "SVGResourceClipper.h"
-#include "SVGResourceMasker.h"
-#include "SVGResourceMarker.h"
+#include "KCanvasClipper.h"
+#include "KCanvasMasker.h"
+#include "KCanvasMarker.h"
 #include "KCanvasRenderingStyle.h"
 #include "KRenderingDevice.h"
 #include "SVGStyledElement.h"
@@ -193,10 +193,10 @@ void RenderPath::paint(PaintInfo &paintInfo, int parentX, int parentY)
         context = device->currentContext();
     }
 
-    if (SVGResourceClipper* clipper = getClipperById(document(), style()->svgStyle()->clipPath().substring(1)))
+    if (KCanvasClipper* clipper = getClipperById(document(), style()->svgStyle()->clipPath().substring(1)))
         clipper->applyClip(relativeBBox(true));
 
-    if (SVGResourceMasker* masker = getMaskerById(document(), style()->svgStyle()->maskElement().substring(1)))
+    if (KCanvasMasker* masker = getMaskerById(document(), style()->svgStyle()->maskElement().substring(1)))
         masker->applyMask(relativeBBox(true));
 
     context->clearPath();
@@ -315,18 +315,18 @@ struct MarkerData {
     FloatPoint inslopePoints[2];
     FloatPoint outslopePoints[2];
     MarkerType type;
-    SVGResourceMarker *marker;
+    KCanvasMarker *marker;
 };
 
 struct DrawMarkersData {
-    DrawMarkersData(GraphicsContext*, SVGResourceMarker* startMarker, SVGResourceMarker* midMarker, double strokeWidth);
+    DrawMarkersData(GraphicsContext*, KCanvasMarker* startMarker, KCanvasMarker* midMarker, double strokeWidth);
     GraphicsContext* context;
     int elementIndex;
     MarkerData previousMarkerData;
-    SVGResourceMarker* midMarker;
+    KCanvasMarker* midMarker;
 };
 
-DrawMarkersData::DrawMarkersData(GraphicsContext* c, SVGResourceMarker *start, SVGResourceMarker *mid, double strokeWidth)
+DrawMarkersData::DrawMarkersData(GraphicsContext* c, KCanvasMarker *start, KCanvasMarker *mid, double strokeWidth)
     : context(c)
     , elementIndex(0)
     , midMarker(mid)
@@ -428,9 +428,9 @@ void RenderPath::drawMarkersIfNeeded(GraphicsContext* context, const FloatRect&
     Document *doc = document();
     const SVGRenderStyle* svgStyle = style()->svgStyle();
 
-    SVGResourceMarker* startMarker = getMarkerById(doc, svgStyle->startMarker().substring(1));
-    SVGResourceMarker* midMarker = getMarkerById(doc, svgStyle->midMarker().substring(1));
-    SVGResourceMarker* endMarker = getMarkerById(doc, svgStyle->endMarker().substring(1));
+    KCanvasMarker* startMarker = getMarkerById(doc, svgStyle->startMarker().substring(1));
+    KCanvasMarker* midMarker = getMarkerById(doc, svgStyle->midMarker().substring(1));
+    KCanvasMarker* endMarker = getMarkerById(doc, svgStyle->endMarker().substring(1));
     
     if (!startMarker && !midMarker && !endMarker)
         return;
index 83698364802771f20865b27905e5b77203fea23c..5f0e23ee1b30970e7c3dbcee922220c6f060e812 100644 (file)
@@ -24,8 +24,8 @@
 #ifdef SVG_SUPPORT
 #include "RenderSVGContainer.h"
 
-#include "SVGResourceClipper.h"
-#include "SVGResourceMasker.h"
+#include "KCanvasClipper.h"
+#include "KCanvasMasker.h"
 #include "KRenderingDevice.h"
 #include "SVGStyledElement.h"
 #include "GraphicsContext.h"
@@ -175,10 +175,10 @@ void RenderSVGContainer::paint(PaintInfo& paintInfo, int parentX, int parentY)
     
     FloatRect strokeBBox = relativeBBox(true);
     
-    if (SVGResourceClipper *clipper = getClipperById(document(), style()->svgStyle()->clipPath().substring(1)))
+    if (KCanvasClipper *clipper = getClipperById(document(), style()->svgStyle()->clipPath().substring(1)))
         clipper->applyClip(strokeBBox);
 
-    if (SVGResourceMasker *masker = getMaskerById(document(), style()->svgStyle()->maskElement().substring(1)))
+    if (KCanvasMasker *masker = getMaskerById(document(), style()->svgStyle()->maskElement().substring(1)))
         masker->applyMask(strokeBBox);
 
     float opacity = style()->opacity();
index 25f058add84f7d6dac3f66b434cd2f4b0f9db6d4..4ab6cf05f006b12aee91f799c5957419cdce2252 100644 (file)
@@ -26,8 +26,8 @@
 
 #include "Attr.h"
 #include "GraphicsContext.h"
-#include "SVGResourceClipper.h"
-#include "SVGResourceMasker.h"
+#include "KCanvasClipper.h"
+#include "KCanvasMasker.h"
 #include "KRenderingDevice.h"
 #include "SVGLength.h"
 #include "SVGPreserveAspectRatio.h"
@@ -146,10 +146,10 @@ void RenderSVGImage::paint(PaintInfo& paintInfo, int parentX, int parentY)
     FloatRect boundingBox = FloatRect(0, 0, width(), height());
     const SVGRenderStyle* svgStyle = style()->svgStyle();
             
-    if (SVGResourceClipper* clipper = getClipperById(document(), svgStyle->clipPath().substring(1)))
+    if (KCanvasClipper* clipper = getClipperById(document(), svgStyle->clipPath().substring(1)))
         clipper->applyClip(boundingBox);
 
-    if (SVGResourceMasker* masker = getMaskerById(document(), svgStyle->maskElement().substring(1)))
+    if (KCanvasMasker* masker = getMaskerById(document(), svgStyle->maskElement().substring(1)))
         masker->applyMask(boundingBox);
 
     KCanvasFilter* filter = getFilterById(document(), svgStyle->filter().substring(1));
index 87af88559b93486b660f0faf1ddd8bf6269e98d6..0a2dc4f1dc86a48235ee0d92f9333091d6fd7be5 100644 (file)
@@ -29,8 +29,8 @@
 
 #include "GraphicsContext.h"
 #include "InlineTextBox.h"
-#include "SVGResourceClipper.h"
-#include "SVGResourceMasker.h"
+#include "KCanvasClipper.h"
+#include "KCanvasMasker.h"
 #include "KCanvasRenderingStyle.h"
 #include "KRenderingDevice.h"
 #include "RootInlineBox.h"
@@ -80,10 +80,10 @@ void paintSVGInlineFlow(InlineFlowBox* flow, RenderObject* object, RenderObject:
     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)))
+    if (KCanvasClipper* clipper = getClipperById(object->document(), svgStyle->clipPath().substring(1)))
         clipper->applyClip(boundingBox);
     
-    if (SVGResourceMasker* masker = getMaskerById(object->document(), svgStyle->maskElement().substring(1)))
+    if (KCanvasMasker* masker = getMaskerById(object->document(), svgStyle->maskElement().substring(1)))
         masker->applyMask(boundingBox);
     
     KCanvasFilter* filter = getFilterById(object->document(), svgStyle->filter().substring(1));