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
${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
${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
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
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
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
platform/FloatSize.cpp
platform/String.cpp
platform/DeprecatedValueListImpl.cpp
+ platform/GraphicsTypes.cpp
platform/IntRect.cpp
platform/Arena.cpp
platform/ArrayImpl.cpp
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
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
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
-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):
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;
};
-/*
- 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
-
-/*
- 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
-
-/*
- 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
-/*
- 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
-
-/*
- 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
-/*
- 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
-
-/*
- 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
-/*
- 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
-
-/*
- 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
--- /dev/null
+/*
+ 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
+
--- /dev/null
+/*
+ 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
return ts;
}
-KCanvasFilter* getFilterById(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;
#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;
namespace WebCore {
-#if PLATFORM(MAC)
class KCanvasFilterQuartz;
-#endif
// Enumerations
typedef enum {
class KCanvasFilterEffect;
class KRenderingDevice;
-class KCanvasFilter : public SVGResource {
+class KCanvasFilter : public KCanvasResource {
public:
KCanvasFilter() { }
virtual ~KCanvasFilter() { }
String result() const;
void setResult(const String&);
-#if PLATFORM(MAC)
+#if __APPLE__
virtual CIFilter* getCIFilter(KCanvasFilterQuartz*) const = 0;
#endif
--- /dev/null
+/*
+ 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
+
--- /dev/null
+/*
+ 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
+
--- /dev/null
+/*
+ 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
--- /dev/null
+/*
+ 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
+
--- /dev/null
+/*
+ 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
--- /dev/null
+/*
+ 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
+
+/*
+ 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
--- /dev/null
+/*
+ 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
#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"
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)));
}
namespace WebCore {
-class AffineTransform;
-class GraphicsContext;
-class Path;
-
// aka where to draw
class KRenderingDeviceContext
{
virtual GraphicsContext* createGraphicsContext() = 0;
};
-class SVGResourceImage;
+class KCanvasImage;
class KCanvasFilterEffect;
class KRenderingDevice
{
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;
#define KRenderingPaintServer_H
#ifdef SVG_SUPPORT
-#include "SVGResource.h"
+#include "KCanvasResource.h"
namespace WebCore {
class KRenderingDeviceContext;
-class RenderObject;
class RenderPath;
class RenderStyle;
class TextStream;
APPLY_TO_STROKE = 2
};
-class KRenderingPaintServer : public SVGResource
+class KRenderingPaintServer : public KCanvasResource
{
public:
KRenderingPaintServer()
- : SVGResource()
+ : KCanvasResource()
, m_activeClient(0)
, m_paintingText(false)
{ }
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
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
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;
}
#define KRenderingPaintServerGradient_H
#ifdef SVG_SUPPORT
-#include "AffineTransform.h"
-#include "Color.h"
-#include "FloatPoint.h"
#include "KRenderingPaintServer.h"
namespace WebCore {
AffineTransform gradientTransform() const;
void setGradientTransform(const AffineTransform&);
- SVGResourceListener* listener() const;
- void setListener(SVGResourceListener*);
+ KCanvasResourceListener* listener() const;
+ void setListener(KCanvasResourceListener*);
TextStream& externalRepresentation(TextStream&) const;
private:
KCGradientSpreadMethod m_spreadMethod;
bool m_boundingBoxMode;
AffineTransform m_gradientTransform;
- SVGResourceListener* m_listener;
+ KCanvasResourceListener* m_listener;
};
class KRenderingPaintServerLinearGradient : public KRenderingPaintServerGradient
#include "config.h"
#ifdef SVG_SUPPORT
-#include "SVGResourceImage.h"
+#include "KCanvasImage.h"
#include "KRenderingPaintServerPattern.h"
#include "AffineTransform.h"
KRenderingPaintServerPattern::KRenderingPaintServerPattern()
: KRenderingPaintServer()
+ , m_tile(0)
, m_useBoundingBoxMode(true)
, m_listener(0)
{
KRenderingPaintServerPattern::~KRenderingPaintServerPattern()
{
+ delete m_tile;
}
void KRenderingPaintServerPattern::setBbox(const FloatRect& rect)
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;
}
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;
}
#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
{
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;
};
#define KRenderingPaintServerSolid_H
#ifdef SVG_SUPPORT
-#include "Color.h"
#include "KRenderingPaintServer.h"
namespace WebCore {
+/*
+ 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
+/*
+ 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
#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"
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:
}
}
-PassRefPtr<KRenderingPaintServer> KRenderingDeviceQt::createPaintServer(const KCPaintServerType& type) const
+KRenderingPaintServer* KRenderingDeviceQt::createPaintServer(const KCPaintServerType& type) const
{
switch (type)
{
// 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;
};
#include <math.h>
#include <QPointF>
-#include "RenderPath.h"
#include "RenderStyle.h"
#include "AffineTransform.h"
#include "KRenderingDeviceQt.h"
#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 {
#include <QPen>
#include <QVector>
-#include "RenderStyle.h"
#include "KCanvasRenderingStyle.h"
#include "KRenderingPaintServerQt.h"
#include <QBrush>
#include <QPainter>
-#include "RenderPath.h"
#include "RenderStyle.h"
#include "KRenderingDeviceQt.h"
#include "KCanvasRenderingStyle.h"
DeprecatedValueListIterator<KCanvasFilterEffect*> end = m_effects.end();
setImageForName(inputImage, "SourceGraphic"); // input
-
for (;it != end; it++) {
CIFilter *filter = (*it)->getCIFilter(this);
if (filter)
#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"
+/*
+ * 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;
+};
+
+}
+/*
+ * 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
+/*
+ * 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
+/*
+ * 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
// 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)
*/
#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"
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));
#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) {
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;
#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 {
: m_stopsCache(0)
, m_stopsCount(0)
, m_shadingCache(0)
+ , m_maskImage(0)
{
}
{
delete m_stopsCache;
CGShadingRelease(m_shadingCache);
+ delete m_maskImage;
}
void KRenderingPaintServerGradientQuartz::updateQuartzGradientCache(const KRenderingPaintServerGradient *server)
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)
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));
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();
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);
namespace WebCore {
-class SVGResourceImage;
+class KCanvasImage;
class KRenderingPaintServerQuartzHelper {
public:
protected:
void invalidateCaches();
CGShadingRef m_shadingCache;
- mutable RefPtr<SVGResourceImage> m_maskImage;
+ mutable KCanvasImage *m_maskImage;
};
class KRenderingPaintServerLinearGradientQuartz : public KRenderingPaintServerGradientQuartz,
#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"
void patternCallback(void *info, CGContextRef context)
{
- CGLayerRef layer = reinterpret_cast<SVGResourceImage*>(info)->cgLayer();
+ CGLayerRef layer = reinterpret_cast<KCanvasImageQuartz*>(info)->cgLayer();
CGContextDrawLayerAtPoint(context, CGPointZero, layer);
}
KRenderingDeviceContextQuartz* quartzContext = static_cast<KRenderingDeviceContextQuartz*>(renderingContext);
CGContextRef context = quartzContext->cgContext();
- RefPtr<SVGResourceImage> cell = tile();
+ KCanvasImage* cell = tile();
if (!cell)
return false;
#import "QuartzSupport.h"
#import "GraphicsContext.h"
+#import "KCanvasResourcesQuartz.h"
#import "KCanvasRenderingStyle.h"
-#import "RenderStyle.h"
#import "wtf/Assertions.h"
#import <QuartzCore/CoreImage.h>
#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;
}
, 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)
}
}
-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();
}
}
clipPathStyle->deref(view()->renderArena());
- return m_clipper.get();
+ return m_clipper;
}
}
#define KSVG_SVGClipPathElementImpl_H
#ifdef SVG_SUPPORT
-#include "SVGResourceClipper.h"
+#include "KCanvasClipper.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
#include "SVGStyledTransformableElement.h"
virtual bool isValid() const { return SVGTests::isValid(); }
- virtual SVGResource* canvasResource();
+ virtual KCanvasClipper* canvasResource();
// 'SVGClipPathElement' functions
virtual void parseMappedAttribute(MappedAttribute*);
ANIMATED_PROPERTY_DECLARATIONS(SVGClipPathElement, int, int, ClipPathUnits, clipPathUnits)
- RefPtr<SVGResourceClipper> m_clipper;
+ KCanvasClipper* m_clipper;
};
} // namespace WebCore
#include "CachedImage.h"
#include "DocLoader.h"
#include "Document.h"
-#include "SVGResourceImage.h"
+#include "KCanvasImage.h"
#include "KRenderingDevice.h"
#include "SVGHelper.h"
#include "SVGLength.h"
// 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)
}
}
-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);
m_filter->addFilterEffect(fe->filterEffect());
}
}
- return m_filter.get();
+ return m_filter;
}
}
SVGFilterElement(const QualifiedName&, Document*);
virtual ~SVGFilterElement();
- virtual SVGResource* canvasResource();
+ virtual KCanvasFilter* canvasResource();
// 'SVGFilterElement' functions
void setFilterRes(unsigned long filterResX, unsigned long filterResY) const;
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
#include "SVGGradientElement.h"
#include "KRenderingDevice.h"
-#include "RenderPath.h"
#include "RenderView.h"
#include "SVGHelper.h"
#include "SVGNames.h"
, 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)
}
}
-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
class SVGGradientElement : public SVGStyledElement,
public SVGURIReference,
public SVGExternalResourcesRequired,
- public SVGResourceListener
+ public KCanvasResourceListener
{
public:
enum SVGGradientType {
// '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;
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
#include "SVGImageElement.h"
#include "CSSPropertyNames.h"
-#include "SVGResourceImage.h"
+#include "KCanvasImage.h"
#include "RenderSVGContainer.h"
#include "RenderSVGImage.h"
#include "SVGDocument.h"
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.
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)
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:
, 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)
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()));
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)
#define SVGMarkerElement_H
#ifdef SVG_SUPPORT
-#include "SVGResourceMarker.h"
+#include "KCanvasMarker.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGFitToViewBox.h"
#include "SVGLangSpace.h"
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; }
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
#include "SVGMaskElement.h"
#include "GraphicsContext.h"
-#include "SVGResourceImage.h"
+#include "KCanvasImage.h"
#include "KRenderingDevice.h"
#include "RenderSVGContainer.h"
#include "SVGHelper.h"
, 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())
}
}
-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);
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;
}
}
#define SVGMaskElement_H
#ifdef SVG_SUPPORT
-#include "SVGResourceMasker.h"
+#include "KCanvasMasker.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
#include "SVGStyledLocatableElement.h"
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)
virtual const SVGElement* contextElement() const { return this; }
private:
- RefPtr<SVGResourceMasker> m_masker;
+ KCanvasMasker* m_masker;
bool m_dirty;
};
#include "Document.h"
#include "GraphicsContext.h"
-#include "SVGResourceImage.h"
+#include "KCanvasImage.h"
#include "KRenderingDevice.h"
#include "KRenderingPaintServerPattern.h"
#include "RenderSVGContainer.h"
, 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()))
, 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)
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);
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());
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
#include "SVGTests.h"
#include "SVGURIReference.h"
-class SVGResourceImage;
+class KCanvasImage;
namespace WebCore
{
public SVGLangSpace,
public SVGExternalResourcesRequired,
public SVGFitToViewBox,
- public SVGResourceListener
+ public KCanvasResourceListener
{
public:
SVGPatternElement(const QualifiedName&, Document*);
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;
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; }
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.
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)
// Inherit color stops if empty
if (grad->gradientStops().isEmpty())
- grad->setGradientStops(gradient.get());
+ grad->setGradientStops(gradient);
if (!hasAttribute(SVGNames::spreadMethodAttr))
grad->setGradientSpreadMethod(gradient->spreadMethod());
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:
#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;
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*);
--- /dev/null
+/*
+ * 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);
+}
+
+}
--- /dev/null
+/*
+ * 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
--- /dev/null
+/*
+ * 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];
+}
+
+}
--- /dev/null
+/*
+ * 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
-/*
- * 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);
-}
-
-}
-/*
- * 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
-/*
- * 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];
-}
-
-}
-/*
- * 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
#include "config.h"
-#include "AffineTransform.h"
#include "Path.h"
#include "Color.h"
#include "GraphicsContext.h"
#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"
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();
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)
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;
#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"
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();
#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"
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));
#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"
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));