${CMAKE_CURRENT_SOURCE_DIR}/editing
${CMAKE_CURRENT_BINARY_DIR}/html
${CMAKE_CURRENT_SOURCE_DIR}/html
- ${CMAKE_CURRENT_SOURCE_DIR}/kcanvas
- ${CMAKE_CURRENT_SOURCE_DIR}/kcanvas/device
- ${CMAKE_CURRENT_SOURCE_DIR}/kcanvas/device/qt
${CMAKE_CURRENT_SOURCE_DIR}/ksvg2
${CMAKE_CURRENT_SOURCE_DIR}/ksvg2/css
${CMAKE_CURRENT_SOURCE_DIR}/ksvg2/events
bindings/js/JSSVGPoint.cpp
bindings/js/JSSVGRect.cpp
- kcanvas/device/KRenderingDevice.cpp
- kcanvas/device/qt/KRenderingDeviceQt.cpp
- kcanvas/device/qt/RenderPathQt.cpp
-
ksvg2/css/SVGCSSParser.cpp
ksvg2/css/SVGCSSStyleSelector.cpp
ksvg2/css/SVGRenderStyle.cpp
platform/graphics/svg/filters/SVGFilterEffect.cpp
platform/graphics/svg/filters/SVGLightSource.cpp
+ platform/graphics/svg/qt/RenderPathQt.cpp
platform/graphics/svg/qt/SVGPaintServerGradientQt.cpp
platform/graphics/svg/qt/SVGPaintServerLinearGradientQt.cpp
platform/graphics/svg/qt/SVGPaintServerPatternQt.cpp
+2006-11-30 Nikolas Zimmermann <zimmermann@kde.org>
+
+ Reviewed by Eric. Rubber stamped by Oliver.
+
+ Fixes: http://bugs.webkit.org/show_bug.cgi?id=10383
+
+ This is the final patch after the long "die kcanvas" journey.
+
+ All old kcanvas code is gone now, and properly integrated within
+ WebCore (stuff like GraphicsContext changes etc.). It shares
+ the platform/ design concept: no subclassing, but instead
+ implementing parts of the classes/methods per-platform.
+
+ This commit removes the last pieces: KRenderingDevice & KRenderingDeviceContext.
+ This layer was just obsolete, given the powerful GraphicsContext API we have
+ since quite a while now. All the ugly pushContext/popContext stuff is gone now.
+
+ LayoutTests affected: svg/W3C-SVG-1.1/pservers-grad-11-b.svg
+ Radial gradients as fill color for texts, work again!
+ Though "Gradient on text stroke" remains broken. Funny thing:
+ With this patch, if you "select" the text using the mouse, as
+ soon as the selection rectangle is drawn, you see the correct
+ gradient on stroke rendering - at least a hint where it breaks!
+
+ All svg layout tests have subtle text rendering changes - with and without this
+ patch, it seems it was forgotton to update svg pixel test baseline, a while ago.
+
+ * CMakeLists.txt:
+ * WebCore.xcodeproj/project.pbxproj:
+ * kcanvas/device/KRenderingDevice.cpp: Removed.
+ * kcanvas/device/KRenderingDevice.h: Removed.
+ * kcanvas/device/qt/KRenderingDeviceQt.cpp: Removed.
+ * kcanvas/device/qt/KRenderingDeviceQt.h: Removed.
+ * kcanvas/device/qt/RenderPathQt.cpp: Moved to platform/graphics/qt
+ * kcanvas/device/quartz/KCanvasItemQuartz.cpp: Moved to platform/graphics/svg/cg/RenderPathCg.cpp
+ * kcanvas/device/quartz/KRenderingDeviceQuartz.cpp: Removed.
+ * kcanvas/device/quartz/KRenderingDeviceQuartz.h: Removed.
+ * kcanvas/device/quartz/QuartzSupport.cpp: Moved to platform/graphics/svg/cg/CgSupport.cpp
+ * kcanvas/device/quartz/QuartzSupport.h: Moved to platform/graphics/svg/cg/CgSupport.h
+ * ksvg2/misc/KCanvasRenderingStyle.cpp:
+ (WebCore::sharedSolidPaintServer):
+ * ksvg2/misc/KCanvasRenderingStyle.h:
+ * ksvg2/svg/SVGAElement.cpp:
+ * ksvg2/svg/SVGClipPathElement.cpp:
+ * ksvg2/svg/SVGFEBlendElement.cpp:
+ (WebCore::SVGFEBlendElement::filterEffect):
+ * ksvg2/svg/SVGFEColorMatrixElement.cpp:
+ (WebCore::SVGFEColorMatrixElement::filterEffect):
+ * ksvg2/svg/SVGFEComponentTransferElement.cpp:
+ (WebCore::SVGFEComponentTransferElement::SVGFEComponentTransferElement):
+ (WebCore::SVGFEComponentTransferElement::parseMappedAttribute):
+ (WebCore::SVGFEComponentTransferElement::filterEffect):
+ * ksvg2/svg/SVGFECompositeElement.cpp:
+ (WebCore::SVGFECompositeElement::SVGFECompositeElement):
+ (WebCore::SVGFECompositeElement::filterEffect):
+ * ksvg2/svg/SVGFEDiffuseLightingElement.cpp:
+ (WebCore::SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement):
+ (WebCore::SVGFEDiffuseLightingElement::filterEffect):
+ (WebCore::SVGFEDiffuseLightingElement::updateLights):
+ * ksvg2/svg/SVGFEDisplacementMapElement.cpp:
+ (WebCore::SVGFEDisplacementMapElement::filterEffect):
+ * ksvg2/svg/SVGFEDistantLightElement.cpp:
+ (WebCore::SVGFEDistantLightElement::SVGFEDistantLightElement):
+ (WebCore::SVGFEDistantLightElement::lightSource):
+ * ksvg2/svg/SVGFEFloodElement.cpp:
+ (WebCore::SVGFEFloodElement::SVGFEFloodElement):
+ (WebCore::SVGFEFloodElement::parseMappedAttribute):
+ (WebCore::SVGFEFloodElement::filterEffect):
+ * ksvg2/svg/SVGFEFuncAElement.cpp:
+ * ksvg2/svg/SVGFEFuncBElement.cpp:
+ * ksvg2/svg/SVGFEFuncGElement.cpp:
+ (WebCore::SVGFEFuncGElement::SVGFEFuncGElement):
+ * ksvg2/svg/SVGFEFuncRElement.cpp:
+ * ksvg2/svg/SVGFEGaussianBlurElement.cpp:
+ (WebCore::SVGFEGaussianBlurElement::filterEffect):
+ * ksvg2/svg/SVGFEImageElement.cpp:
+ (WebCore::SVGFEImageElement::SVGFEImageElement):
+ (WebCore::SVGFEImageElement::parseMappedAttribute):
+ (WebCore::SVGFEImageElement::notifyFinished):
+ (WebCore::SVGFEImageElement::filterEffect):
+ * ksvg2/svg/SVGFELightElement.cpp:
+ * ksvg2/svg/SVGFEMergeElement.cpp:
+ (WebCore::SVGFEMergeElement::filterEffect):
+ * ksvg2/svg/SVGFEMergeNodeElement.cpp:
+ * ksvg2/svg/SVGFEOffsetElement.cpp:
+ (WebCore::SVGFEOffsetElement::SVGFEOffsetElement):
+ (WebCore::SVGFEOffsetElement::parseMappedAttribute):
+ (WebCore::SVGFEOffsetElement::filterEffect):
+ * ksvg2/svg/SVGFEPointLightElement.cpp:
+ (WebCore::SVGFEPointLightElement::lightSource):
+ * ksvg2/svg/SVGFESpecularLightingElement.cpp:
+ (WebCore::SVGFESpecularLightingElement::SVGFESpecularLightingElement):
+ (WebCore::SVGFESpecularLightingElement::filterEffect):
+ (WebCore::SVGFESpecularLightingElement::updateLights):
+ * ksvg2/svg/SVGFESpotLightElement.cpp:
+ (WebCore::SVGFESpotLightElement::SVGFESpotLightElement):
+ (WebCore::SVGFESpotLightElement::lightSource):
+ * ksvg2/svg/SVGFETileElement.cpp:
+ (WebCore::SVGFETileElement::SVGFETileElement):
+ (WebCore::SVGFETileElement::parseMappedAttribute):
+ (WebCore::SVGFETileElement::filterEffect):
+ * ksvg2/svg/SVGFETurbulenceElement.cpp:
+ (WebCore::SVGFETurbulenceElement::filterEffect):
+ * ksvg2/svg/SVGFilterElement.cpp:
+ (WebCore::SVGFilterElement::canvasResource):
+ * ksvg2/svg/SVGGradientElement.cpp:
+ (WebCore::SVGGradientElement::canvasResource):
+ * ksvg2/svg/SVGLinearGradientElement.cpp:
+ * ksvg2/svg/SVGMarkerElement.cpp:
+ * ksvg2/svg/SVGMaskElement.cpp:
+ (WebCore::SVGMaskElement::parseMappedAttribute):
+ (WebCore::SVGMaskElement::drawMaskerContent):
+ (WebCore::SVGMaskElement::canvasResource):
+ * ksvg2/svg/SVGPatternElement.cpp:
+ (WebCore::SVGPatternElement::drawPatternContentIntoTile):
+ (WebCore::SVGPatternElement::canvasResource):
+ * ksvg2/svg/SVGStyledElement.cpp:
+ * ksvg2/svg/SVGStyledElement.h:
+ * platform/graphics/GraphicsContext.h:
+ * platform/graphics/svg/SVGPaintServer.h:
+ * platform/graphics/svg/SVGPaintServerGradient.cpp:
+ (WebCore::SVGPaintServerGradient::SVGPaintServerGradient):
+ * platform/graphics/svg/SVGPaintServerGradient.h:
+ * platform/graphics/svg/SVGPaintServerLinearGradient.h:
+ * platform/graphics/svg/SVGPaintServerPattern.h:
+ * platform/graphics/svg/SVGPaintServerRadialGradient.h:
+ * platform/graphics/svg/SVGPaintServerSolid.h:
+ * platform/graphics/svg/SVGResource.cpp:
+ * platform/graphics/svg/SVGResource.h:
+ * platform/graphics/svg/SVGResourceClipper.h:
+ * platform/graphics/svg/SVGResourceFilter.h:
+ * platform/graphics/svg/SVGResourceMasker.h:
+ * platform/graphics/svg/cg/RenderPathCg.cpp: Added.
+ * platform/graphics/svg/cg/SVGPaintServerCg.cpp:
+ (WebCore::SVGPaintServer::draw):
+ (WebCore::SVGPaintServer::teardown):
+ (WebCore::SVGPaintServer::renderPath):
+ * platform/graphics/svg/cg/SVGPaintServerGradientCg.cpp:
+ (WebCore::SVGPaintServerGradient::teardown):
+ (WebCore::SVGPaintServerGradient::renderPath):
+ (WebCore::SVGPaintServerGradient::setup):
+ * platform/graphics/svg/cg/SVGPaintServerPatternCg.cpp:
+ (WebCore::SVGPaintServerPattern::setup):
+ (WebCore::SVGPaintServerPattern::teardown):
+ * platform/graphics/svg/cg/SVGPaintServerSolidCg.cpp:
+ (WebCore::SVGPaintServerSolid::setup):
+ * platform/graphics/svg/cg/SVGResourceClipperCg.cpp:
+ (WebCore::SVGResourceClipper::applyClip):
+ * platform/graphics/svg/cg/SVGResourceFilterCg.mm:
+ (WebCore::SVGResourceFilter::SVGResourceFilter):
+ (WebCore::SVGResourceFilter::createFilterEffect):
+ (WebCore::SVGResourceFilter::prepareFilter):
+ (WebCore::SVGResourceFilter::applyFilter):
+ * platform/graphics/svg/cg/SVGResourceMaskerCg.mm:
+ (WebCore::SVGResourceMasker::applyMask):
+ * platform/graphics/svg/filters/cg/SVGFEImageCg.mm:
+ * platform/graphics/svg/qt/SVGPaintServerLinearGradientQt.cpp:
+ (WebCore::SVGPaintServerLinearGradient::setup):
+ * platform/graphics/svg/qt/SVGPaintServerPatternQt.cpp:
+ (WebCore::SVGPaintServerPattern::setup):
+ * platform/graphics/svg/qt/SVGPaintServerQt.cpp:
+ (WebCore::SVGPaintServer::draw):
+ (WebCore::SVGPaintServer::teardown):
+ (WebCore::SVGPaintServer::renderPath):
+ * platform/graphics/svg/qt/SVGPaintServerRadialGradientQt.cpp:
+ (WebCore::setup):
+ * platform/graphics/svg/qt/SVGPaintServerSolidQt.cpp:
+ (WebCore::SVGPaintServerSolid::setup):
+ * platform/graphics/svg/qt/SVGResourceClipperQt.cpp:
+ (WebCore::SVGResourceClipper::applyClip):
+ * platform/graphics/svg/qt/SVGResourceFilterQt.cpp:
+ (WebCore::SVGResourceFilter::createFilterEffect):
+ (WebCore::SVGResourceFilter::prepareFilter):
+ (WebCore::SVGResourceFilter::applyFilter):
+ * platform/graphics/svg/qt/SVGResourceMaskerQt.cpp:
+ (WebCore::SVGResourceMasker::applyMask):
+ * platform/qt/GraphicsContextQt.cpp:
+ (WebCore::GraphicsContext::beginPath):
+ (WebCore::GraphicsContext::addPath):
+ (WebCore::GraphicsContext::setFillRule):
+ (WebCore::GraphicsContext::currentPath):
+ (WebCore::GraphicsContext::strokeRect):
+ (WebCore::contextForImage):
+ * rendering/RenderForeignObject.cpp:
+ (WebCore::RenderForeignObject::paint):
+ * rendering/RenderPath.cpp:
+ (WebCore::RenderPath::paint):
+ * rendering/RenderSVGContainer.cpp:
+ (WebCore::RenderSVGContainer::paint):
+ * rendering/RenderSVGImage.cpp:
+ (WebCore::RenderSVGImage::paint):
+ * rendering/RenderSVGImage.h:
+ * rendering/RenderSVGInline.cpp:
+ (WebCore::RenderSVGInline::RenderSVGInline):
+ (WebCore::RenderSVGInline::createInlineBox):
+ * rendering/RenderSVGInlineText.cpp:
+ (WebCore::RenderSVGInlineText::RenderSVGInlineText):
+ * rendering/RenderSVGTSpan.cpp:
+ (WebCore::RenderSVGTSpan::RenderSVGTSpan):
+ * rendering/RenderSVGText.cpp:
+ (WebCore::RenderSVGText::paint):
+ * rendering/SVGInlineFlowBox.cpp:
+ (WebCore::paintSVGInlineFlow):
+ * rendering/SVGRenderTreeAsText.cpp:
+ (WebCore::writeStyle):
+
2006-11-30 Geoffrey Garen <ggaren@apple.com>
Reviewed by Beth Dakin.
A871DFE30A15376B00B12A68 /* RenderReplaced.h in Headers */ = {isa = PBXBuildFile; fileRef = A871DFDF0A15376B00B12A68 /* RenderReplaced.h */; settings = {ATTRIBUTES = (Private, ); }; };
A871DFE40A15376B00B12A68 /* RenderWidget.h in Headers */ = {isa = PBXBuildFile; fileRef = A871DFE00A15376B00B12A68 /* RenderWidget.h */; };
A871DFE50A15376B00B12A68 /* RenderWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A871DFE10A15376B00B12A68 /* RenderWidget.cpp */; };
- A88AD3860952486D001DD196 /* KRenderingDevice.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0FB54089701F700BA5114 /* KRenderingDevice.cpp */; };
- A88AD3870952486D001DD196 /* KRenderingDevice.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0FB55089701F700BA5114 /* KRenderingDevice.h */; };
- A88AD3AD0952486D001DD196 /* KCanvasItemQuartz.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0FB6C089701F800BA5114 /* KCanvasItemQuartz.cpp */; };
- A88AD3B00952486E001DD196 /* KRenderingDeviceQuartz.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0FB71089701F800BA5114 /* KRenderingDeviceQuartz.h */; };
- A88AD3B10952486E001DD196 /* KRenderingDeviceQuartz.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0FB72089701F800BA5114 /* KRenderingDeviceQuartz.cpp */; };
- A88AD3B50952486E001DD196 /* QuartzSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0FB76089701F800BA5114 /* QuartzSupport.h */; };
- A88AD3B60952486E001DD196 /* QuartzSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0FB77089701F800BA5114 /* QuartzSupport.cpp */; };
A88AD401095248F0001DD196 /* SVGRenderStyle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0F6FF089701F100BA5114 /* SVGRenderStyle.cpp */; };
A88AD402095248F0001DD196 /* SVGRenderStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0F700089701F100BA5114 /* SVGRenderStyle.h */; settings = {ATTRIBUTES = (Private, ); }; };
A88AD403095248F0001DD196 /* SVGRenderStyleDefs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0F701089701F100BA5114 /* SVGRenderStyleDefs.cpp */; };
B222F6990AB771950022EFAD /* JSSVGAngle.h in Headers */ = {isa = PBXBuildFile; fileRef = B222F6970AB771950022EFAD /* JSSVGAngle.h */; };
B222F69C0AB771B80022EFAD /* JSSVGElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B222F69A0AB771B80022EFAD /* JSSVGElement.cpp */; };
B222F69D0AB771B80022EFAD /* JSSVGElement.h in Headers */ = {isa = PBXBuildFile; fileRef = B222F69B0AB771B80022EFAD /* JSSVGElement.h */; };
+ B2310B760B1F46A200D55D87 /* CgSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2310B730B1F46A200D55D87 /* CgSupport.cpp */; };
+ B2310B770B1F46A200D55D87 /* CgSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = B2310B740B1F46A200D55D87 /* CgSupport.h */; };
+ B2310B780B1F46A300D55D87 /* RenderPathCg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2310B750B1F46A200D55D87 /* RenderPathCg.cpp */; };
B27535560B053814002CE64F /* AffineTransform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B27535270B053814002CE64F /* AffineTransform.cpp */; };
B27535570B053814002CE64F /* AffineTransform.h in Headers */ = {isa = PBXBuildFile; fileRef = B27535280B053814002CE64F /* AffineTransform.h */; };
B27535580B053814002CE64F /* AffineTransformCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B275352A0B053814002CE64F /* AffineTransformCG.cpp */; };
B27535590B053814002CE64F /* FloatPointCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B275352B0B053814002CE64F /* FloatPointCG.cpp */; };
B275355A0B053814002CE64F /* FloatRectCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B275352C0B053814002CE64F /* FloatRectCG.cpp */; };
B275355B0B053814002CE64F /* FloatSizeCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B275352D0B053814002CE64F /* FloatSizeCG.cpp */; };
- B275355C0B053814002CE64F /* GraphicsContextCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B275352E0B053814002CE64F /* GraphicsContextCG.cpp */; };
B275355D0B053814002CE64F /* GraphicsContextPlatformPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = B275352F0B053814002CE64F /* GraphicsContextPlatformPrivate.h */; };
B275355E0B053814002CE64F /* ImageCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B27535300B053814002CE64F /* ImageCG.cpp */; };
B275355F0B053814002CE64F /* ImageSourceCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B27535310B053814002CE64F /* ImageSourceCG.cpp */; };
B2E27CA00B0F2B0900F17C7B /* FloatPoint3D.h in Headers */ = {isa = PBXBuildFile; fileRef = B2E27C9E0B0F2B0900F17C7B /* FloatPoint3D.h */; };
B2EBDC9C0AF77E3400AE4A68 /* SVGRenderTreeAsText.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2EBDC9A0AF77E3400AE4A68 /* SVGRenderTreeAsText.cpp */; };
B2EBDC9D0AF77E3400AE4A68 /* SVGRenderTreeAsText.h in Headers */ = {isa = PBXBuildFile; fileRef = B2EBDC9B0AF77E3400AE4A68 /* SVGRenderTreeAsText.h */; };
+ B2ED97710B1F55CE00257D0F /* GraphicsContextCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2ED97700B1F55CE00257D0F /* GraphicsContextCG.cpp */; };
B2FA3D360AB75A6F000E5AC4 /* JSSVGAnimateColorElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2FA3C4E0AB75A6E000E5AC4 /* JSSVGAnimateColorElement.cpp */; };
B2FA3D370AB75A6F000E5AC4 /* JSSVGAnimateColorElement.h in Headers */ = {isa = PBXBuildFile; fileRef = B2FA3C4F0AB75A6E000E5AC4 /* JSSVGAnimateColorElement.h */; };
B2FA3D380AB75A6F000E5AC4 /* JSSVGAnimatedAngle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2FA3C500AB75A6E000E5AC4 /* JSSVGAnimatedAngle.cpp */; };
A8C0F8EA089701F400BA5114 /* SVGViewElement.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = SVGViewElement.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
A8C0F8EB089701F400BA5114 /* SVGZoomAndPan.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGZoomAndPan.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
A8C0F8EC089701F400BA5114 /* SVGZoomAndPan.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = SVGZoomAndPan.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- A8C0FB54089701F700BA5114 /* KRenderingDevice.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KRenderingDevice.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- A8C0FB55089701F700BA5114 /* KRenderingDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KRenderingDevice.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- A8C0FB6C089701F800BA5114 /* KCanvasItemQuartz.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KCanvasItemQuartz.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- A8C0FB71089701F800BA5114 /* KRenderingDeviceQuartz.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KRenderingDeviceQuartz.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- A8C0FB72089701F800BA5114 /* KRenderingDeviceQuartz.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KRenderingDeviceQuartz.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- A8C0FB76089701F800BA5114 /* QuartzSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = QuartzSupport.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- A8C0FB77089701F800BA5114 /* QuartzSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = QuartzSupport.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
A8C3295C093BB7B2000B9CAC /* SVGFELightElement.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = SVGFELightElement.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
A8C3295D093BB7B2000B9CAC /* SVGFELightElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFELightElement.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
A8C3295E093BB7B2000B9CAC /* SVGFEDistantLightElement.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = SVGFEDistantLightElement.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
B222F6970AB771950022EFAD /* JSSVGAngle.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSSVGAngle.h; sourceTree = "<group>"; };
B222F69A0AB771B80022EFAD /* JSSVGElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGElement.cpp; sourceTree = "<group>"; };
B222F69B0AB771B80022EFAD /* JSSVGElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSSVGElement.h; sourceTree = "<group>"; };
+ B2310B730B1F46A200D55D87 /* CgSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CgSupport.cpp; sourceTree = "<group>"; };
+ B2310B740B1F46A200D55D87 /* CgSupport.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CgSupport.h; sourceTree = "<group>"; };
+ B2310B750B1F46A200D55D87 /* RenderPathCg.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderPathCg.cpp; sourceTree = "<group>"; };
B27535270B053814002CE64F /* AffineTransform.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AffineTransform.cpp; sourceTree = "<group>"; };
B27535280B053814002CE64F /* AffineTransform.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AffineTransform.h; sourceTree = "<group>"; };
B275352A0B053814002CE64F /* AffineTransformCG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AffineTransformCG.cpp; sourceTree = "<group>"; };
B275352B0B053814002CE64F /* FloatPointCG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FloatPointCG.cpp; sourceTree = "<group>"; };
B275352C0B053814002CE64F /* FloatRectCG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FloatRectCG.cpp; sourceTree = "<group>"; };
B275352D0B053814002CE64F /* FloatSizeCG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FloatSizeCG.cpp; sourceTree = "<group>"; };
- B275352E0B053814002CE64F /* GraphicsContextCG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContextCG.cpp; sourceTree = "<group>"; };
B275352F0B053814002CE64F /* GraphicsContextPlatformPrivate.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = GraphicsContextPlatformPrivate.h; sourceTree = "<group>"; };
B27535300B053814002CE64F /* ImageCG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ImageCG.cpp; sourceTree = "<group>"; };
B27535310B053814002CE64F /* ImageSourceCG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ImageSourceCG.cpp; sourceTree = "<group>"; };
B2E9548E0AB5FBA30076DE37 /* SVGPreserveAspectRatio.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGPreserveAspectRatio.idl; sourceTree = "<group>"; };
B2EBDC9A0AF77E3400AE4A68 /* SVGRenderTreeAsText.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGRenderTreeAsText.cpp; sourceTree = "<group>"; };
B2EBDC9B0AF77E3400AE4A68 /* SVGRenderTreeAsText.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGRenderTreeAsText.h; sourceTree = "<group>"; };
+ B2ED97700B1F55CE00257D0F /* GraphicsContextCG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContextCG.cpp; sourceTree = "<group>"; };
B2FA3C4E0AB75A6E000E5AC4 /* JSSVGAnimateColorElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGAnimateColorElement.cpp; sourceTree = "<group>"; };
B2FA3C4F0AB75A6E000E5AC4 /* JSSVGAnimateColorElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSSVGAnimateColorElement.h; sourceTree = "<group>"; };
B2FA3C500AB75A6E000E5AC4 /* JSSVGAnimatedAngle.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGAnimatedAngle.cpp; sourceTree = "<group>"; };
F523D32402DE4478018635CA /* dom */,
93309D86099E64910056E581 /* editing */,
93EEC1EC09C2877700C515D1 /* html */,
- A8C0FB51089701F700BA5114 /* kcanvas */,
A8C0F6E9089701F100BA5114 /* ksvg2 */,
BCB16BFB0979C38700467741 /* loader */,
65BF02180974806300C43196 /* page */,
path = svg;
sourceTree = "<group>";
};
- A8C0FB51089701F700BA5114 /* kcanvas */ = {
- isa = PBXGroup;
- children = (
- A8C0FB53089701F700BA5114 /* device */,
- );
- path = kcanvas;
- sourceTree = "<group>";
- };
- A8C0FB53089701F700BA5114 /* device */ = {
- isa = PBXGroup;
- children = (
- A8C0FB54089701F700BA5114 /* KRenderingDevice.cpp */,
- A8C0FB55089701F700BA5114 /* KRenderingDevice.h */,
- A8C0FB68089701F800BA5114 /* quartz */,
- );
- path = device;
- sourceTree = "<group>";
- };
- A8C0FB68089701F800BA5114 /* quartz */ = {
- isa = PBXGroup;
- children = (
- A8C0FB6C089701F800BA5114 /* KCanvasItemQuartz.cpp */,
- A8C0FB71089701F800BA5114 /* KRenderingDeviceQuartz.h */,
- A8C0FB72089701F800BA5114 /* KRenderingDeviceQuartz.cpp */,
- A8C0FB76089701F800BA5114 /* QuartzSupport.h */,
- A8C0FB77089701F800BA5114 /* QuartzSupport.cpp */,
- );
- path = quartz;
- sourceTree = "<group>";
- };
B27535290B053814002CE64F /* cg */ = {
isa = PBXGroup;
children = (
B275352B0B053814002CE64F /* FloatPointCG.cpp */,
B275352C0B053814002CE64F /* FloatRectCG.cpp */,
B275352D0B053814002CE64F /* FloatSizeCG.cpp */,
- B275352E0B053814002CE64F /* GraphicsContextCG.cpp */,
+ B2ED97700B1F55CE00257D0F /* GraphicsContextCG.cpp */,
B275352F0B053814002CE64F /* GraphicsContextPlatformPrivate.h */,
B27535300B053814002CE64F /* ImageCG.cpp */,
B27535310B053814002CE64F /* ImageSourceCG.cpp */,
B2A015970AF6CD53006BCE0E /* cg */ = {
isa = PBXGroup;
children = (
+ B2310B730B1F46A200D55D87 /* CgSupport.cpp */,
+ B2310B740B1F46A200D55D87 /* CgSupport.h */,
+ B2310B750B1F46A200D55D87 /* RenderPathCg.cpp */,
B2D87C830B124E9500B0DE1E /* SVGPaintServerCg.cpp */,
B2D87C840B124E9500B0DE1E /* SVGPaintServerGradientCg.cpp */,
B2D87C850B124E9500B0DE1E /* SVGPaintServerPatternCg.cpp */,
7E6FEED80898582300C44C3F /* WebCoreScriptDebugger.h in Headers */,
939885C408B7E3D100E707C4 /* EventNames.h in Headers */,
65C97AF308EA908800ACD273 /* config.h in Headers */,
- A88AD3870952486D001DD196 /* KRenderingDevice.h in Headers */,
- A88AD3B00952486E001DD196 /* KRenderingDeviceQuartz.h in Headers */,
- A88AD3B50952486E001DD196 /* QuartzSupport.h in Headers */,
A88AD402095248F0001DD196 /* SVGRenderStyle.h in Headers */,
A88AD404095248F0001DD196 /* SVGRenderStyleDefs.h in Headers */,
A88AD40B095248F0001DD196 /* SVGZoomEvent.h in Headers */,
A7352C1A0B1BB89D00A986D0 /* RenderSVGBlock.h in Headers */,
4B8AF4AA0B1CE02B00687690 /* ClipboardAccessPolicy.h in Headers */,
06027CAD0B1CBFC000884B2D /* ContextMenuItem.h in Headers */,
+ B2310B770B1F46A200D55D87 /* CgSupport.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
BCEF3434087B563E00BBF833 /* HTMLElementFactory.cpp in Sources */,
7E6FEED90898582300C44C3F /* WebCoreScriptDebugger.mm in Sources */,
939885C308B7E3D100E707C4 /* EventNames.cpp in Sources */,
- A88AD3860952486D001DD196 /* KRenderingDevice.cpp in Sources */,
- A88AD3AD0952486D001DD196 /* KCanvasItemQuartz.cpp in Sources */,
- A88AD3B10952486E001DD196 /* KRenderingDeviceQuartz.cpp in Sources */,
- A88AD3B60952486E001DD196 /* QuartzSupport.cpp in Sources */,
A88AD401095248F0001DD196 /* SVGRenderStyle.cpp in Sources */,
A88AD403095248F0001DD196 /* SVGRenderStyleDefs.cpp in Sources */,
A88AD40A095248F0001DD196 /* SVGZoomEvent.cpp in Sources */,
B27535590B053814002CE64F /* FloatPointCG.cpp in Sources */,
B275355A0B053814002CE64F /* FloatRectCG.cpp in Sources */,
B275355B0B053814002CE64F /* FloatSizeCG.cpp in Sources */,
- B275355C0B053814002CE64F /* GraphicsContextCG.cpp in Sources */,
B275355E0B053814002CE64F /* ImageCG.cpp in Sources */,
B275355F0B053814002CE64F /* ImageSourceCG.cpp in Sources */,
B27535600B053814002CE64F /* IntPointCG.cpp in Sources */,
1AD8CFCE0B1CED8900696DE0 /* ResourceRequest.cpp in Sources */,
06027CB30B1CC03D00884B2D /* ContextMenuItemMac.mm in Sources */,
1A8180A50B1D4E4300CE46C4 /* ResourceResponse.cpp in Sources */,
+ B2310B760B1F46A200D55D87 /* CgSupport.cpp in Sources */,
+ B2310B780B1F46A300D55D87 /* RenderPathCg.cpp in Sources */,
+ B2ED97710B1F55CE00257D0F /* GraphicsContextCG.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
+++ /dev/null
-/*
- Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
- 2006 Alexander Kellett <lypanov@kde.org>
-
- This file is part of the KDE project
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- aint with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
-*/
-
-#include "config.h"
-#ifdef SVG_SUPPORT
-#include "KRenderingDevice.h"
-
-namespace WebCore {
-
-KRenderingDevice::KRenderingDevice()
-{
-}
-
-KRenderingDevice::~KRenderingDevice()
-{
-}
-
-KRenderingDeviceContext* KRenderingDevice::currentContext() const
-{
- if (m_contextStack.isEmpty())
- return 0;
- return m_contextStack.last();
-}
-
-KRenderingDeviceContext* KRenderingDevice::popContext()
-{
- KRenderingDeviceContext* result = m_contextStack.last();
- m_contextStack.removeLast();
- return result;
-}
-
-void KRenderingDevice::pushContext(KRenderingDeviceContext* context)
-{
- m_contextStack.append(context);
-}
-
-}
-
-// vim:ts=4:noet
-#endif // SVG_SUPPORT
-
+++ /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 KRenderingDevice_H
-#define KRenderingDevice_H
-
-#ifdef SVG_SUPPORT
-
-#include "SVGFilterEffect.h"
-#include "SVGPaintServer.h"
-
-namespace WebCore {
-
-class AffineTransform;
-class GraphicsContext;
-class Path;
-
-// aka where to draw
-class KRenderingDeviceContext
-{
-public:
- KRenderingDeviceContext() { }
- virtual ~KRenderingDeviceContext() { }
-
- virtual AffineTransform concatCTM(const AffineTransform&) = 0;
- virtual AffineTransform ctm() const = 0;
-
- virtual void clearPath() = 0;
- virtual void addPath(const Path&) = 0;
-
- virtual GraphicsContext* createGraphicsContext() = 0;
-};
-
-class SVGResourceImage;
-class SVGResourceFilterEffect;
-class KRenderingDevice
-{
-public:
- KRenderingDevice();
- virtual ~KRenderingDevice();
-
- // The rendering device will be directly inited
- // after the canvas target, it may be overwritten.
- virtual bool isBuffered() const = 0;
-
- // Global rendering device context
- KRenderingDeviceContext* currentContext() const;
-
- virtual KRenderingDeviceContext* popContext();
- virtual void pushContext(KRenderingDeviceContext*);
-
- virtual KRenderingDeviceContext* contextForImage(SVGResourceImage*) const = 0;
-
- // Creation tools
- virtual PassRefPtr<SVGResource> createResource(const SVGResourceType&) const = 0;
- virtual SVGFilterEffect* createFilterEffect(const SVGFilterEffectType&) const = 0;
- virtual PassRefPtr<SVGPaintServer> createPaintServer(const SVGPaintServerType&) const = 0;
-
-private:
- Vector<KRenderingDeviceContext*> m_contextStack;
-};
-
-KRenderingDevice* renderingDevice(); /* returns the single global rendering device */
-
-}
-
-#endif // SVG_SUPPORT
-#endif
-
-// vim:ts=4:noet
+++ /dev/null
-/*
- Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <wildfox@kde.org>
- 2004, 2005, 2006 Rob Buis <buis@kde.org>
-
- This file is part of the KDE project
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "config.h"
-
-#include "IntRect.h"
-#include "RenderPath.h"
-#include "AffineTransform.h"
-#include "GraphicsContext.h"
-#include "SVGResourceClipper.h"
-#include "SVGResourceMarker.h"
-#include "KRenderingDeviceQt.h"
-#include "SVGPaintServerSolid.h"
-#include "SVGPaintServerLinearGradient.h"
-#include "SVGPaintServerRadialGradient.h"
-#include "SVGPaintServerPattern.h"
-
-namespace WebCore {
-
-KRenderingDeviceContextQt::KRenderingDeviceContextQt(QPainter* painter)
- : m_painter(painter)
- , m_path()
-{
- Q_ASSERT(m_painter != 0);
-}
-
-KRenderingDeviceContextQt::~KRenderingDeviceContextQt()
-{
-}
-
-AffineTransform KRenderingDeviceContextQt::concatCTM(const AffineTransform& worldMatrix)
-{
- AffineTransform ret = ctm();
- m_painter->setMatrix(worldMatrix, true);
- return ret;
-}
-
-AffineTransform KRenderingDeviceContextQt::ctm() const
-{
- return AffineTransform(m_painter->matrix());
-}
-
-IntRect KRenderingDeviceContextQt::mapFromVisual(const IntRect& rect)
-{
- return IntRect();
-}
-
-IntRect KRenderingDeviceContextQt::mapToVisual(const IntRect& rect)
-{
- return IntRect();
-}
-
-void KRenderingDeviceContextQt::clearPath()
-{
- m_path = QPainterPath();
-}
-
-void KRenderingDeviceContextQt::addPath(const Path& path)
-{
- m_path.addPath(*(path.platformPath()));
-}
-
-GraphicsContext* KRenderingDeviceContextQt::createGraphicsContext()
-{
- return new GraphicsContext(m_painter);
-}
-
-QPainter& KRenderingDeviceContextQt::painter()
-{
- return *m_painter;
-}
-
-QRectF KRenderingDeviceContextQt::pathBBox() const
-{
- return m_path.boundingRect();
-}
-
-void KRenderingDeviceContextQt::setFillRule(WindRule rule)
-{
- m_path.setFillRule(rule == RULE_EVENODD ? Qt::OddEvenFill : Qt::WindingFill);
-}
-
-void KRenderingDeviceContextQt::fillPath()
-{
- m_painter->fillPath(m_path, m_painter->brush());
-}
-
-void KRenderingDeviceContextQt::strokePath()
-{
- m_painter->strokePath(m_path, m_painter->pen());
-}
-
-// KRenderingDeviceQt
-KRenderingDeviceQt::KRenderingDeviceQt() : KRenderingDevice()
-{
-}
-
-KRenderingDeviceQt::~KRenderingDeviceQt()
-{
-}
-
-KRenderingDeviceContext* KRenderingDeviceQt::popContext()
-{
- // Any special things needed?
- return KRenderingDevice::popContext();
-}
-
-void KRenderingDeviceQt::pushContext(KRenderingDeviceContext* context)
-{
- // Any special things needed?
- KRenderingDevice::pushContext(context);
-}
-
-// context management.
-KRenderingDeviceContextQt* KRenderingDeviceQt::qtContext() const
-{
- return static_cast<KRenderingDeviceContextQt*>(currentContext());
-}
-
-KRenderingDeviceContext* KRenderingDeviceQt::contextForImage(SVGResourceImage* image) const
-{
- qDebug("KRenderingDeviceQt::contextForImage() TODO!");
- return 0;
-}
-
-// Resource creation
-PassRefPtr<SVGResource> KRenderingDeviceQt::createResource(const SVGResourceType& type) const
-{
- switch (type)
- {
- case ClipperResourceType:
- return new SVGResourceClipper();
- case MarkerResourceType:
- return new SVGResourceMarker(); // Use default implementation...
- case ImageResourceType:
- // return new SVGResourceImageQt();
- case FilterResourceType:
- // return new KCanvasFilterQt();
- case MaskerResourceType:
- // return new KCanvasMaskerQt();
- default:
- return 0;
- }
-}
-
-PassRefPtr<SVGPaintServer> KRenderingDeviceQt::createPaintServer(const SVGPaintServerType& type) const
-{
- switch (type)
- {
- case SolidPaintServer:
- return new SVGPaintServerSolid();
- case PatternPaintServer:
- return new SVGPaintServerPattern();
- case LinearGradientPaintServer:
- return new SVGPaintServerLinearGradient();
- case RadialGradientPaintServer:
- return new SVGPaintServerRadialGradient();
- default:
- return 0;
- }
-}
-
-SVGFilterEffect* KRenderingDeviceQt::createFilterEffect(const SVGFilterEffectType& type) const
-{
- qDebug("KRenderingDeviceQt::createFilterEffect() TODO!");
- return 0;
-}
-
-KRenderingDevice* renderingDevice()
-{
- static KRenderingDevice *sharedRenderingDevice = new KRenderingDeviceQt();
- return sharedRenderingDevice;
-}
-
-}
-
-// vim:ts=4:noet
+++ /dev/null
-/*
- Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <wildfox@kde.org>
- 2004, 2005, 2006 Rob Buis <buis@kde.org>
-
- This file is part of the KDE project
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#ifndef KRenderingDeviceQt_H
-#define KRenderingDeviceQt_H
-
-#include <QPainter>
-#include <QPainterPath>
-
-#include "Path.h"
-#include "KRenderingDevice.h"
-
-namespace WebCore {
-
-class KRenderingDeviceContextQt : public KRenderingDeviceContext
-{
-public:
- KRenderingDeviceContextQt(QPainter*);
- virtual ~KRenderingDeviceContextQt();
-
- virtual AffineTransform concatCTM(const AffineTransform&);
- virtual AffineTransform ctm() const;
-
- virtual IntRect mapFromVisual(const IntRect&);
- virtual IntRect mapToVisual(const IntRect&);
-
- virtual void clearPath();
- virtual void addPath(const Path&);
-
- virtual GraphicsContext* createGraphicsContext();
-
- // Qt specific stuff
- QPainter& painter();
- QRectF pathBBox() const;
-
- void setFillRule(WindRule);
-
- void fillPath();
- void strokePath();
-
-private:
- QPainter* m_painter;
- QPainterPath m_path;
-};
-
-class KRenderingDeviceQt : public KRenderingDevice
-{
-public:
- KRenderingDeviceQt();
- virtual ~KRenderingDeviceQt();
-
- virtual bool isBuffered() const { return false; }
-
- virtual KRenderingDeviceContext* popContext();
- virtual void pushContext(KRenderingDeviceContext*);
-
- // context management.
- KRenderingDeviceContextQt* qtContext() const;
- virtual KRenderingDeviceContext* contextForImage(SVGResourceImage*) const;
-
- // Resource creation
- virtual PassRefPtr<SVGResource> createResource(const SVGResourceType&) const;
- virtual PassRefPtr<SVGPaintServer> createPaintServer(const SVGPaintServerType&) const;
- virtual SVGFilterEffect* createFilterEffect(const SVGFilterEffectType&) const;
-};
-
-}
-
-#endif
-
-// vim:ts=4:noet
+++ /dev/null
-/*
- * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
- * 2006 Rob Buis <buis@kde.org>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#ifdef SVG_SUPPORT
-#include "KRenderingDeviceQuartz.h"
-#include "GraphicsContext.h"
-#include "SVGFEBlend.h"
-#include "SVGFEColorMatrix.h"
-#include "SVGFEComponentTransfer.h"
-#include "SVGFEComposite.h"
-#include "SVGFEDiffuseLighting.h"
-#include "SVGFEDisplacementMap.h"
-#include "SVGFEFlood.h"
-#include "SVGFEGaussianBlur.h"
-#include "SVGFEImage.h"
-#include "SVGFEMerge.h"
-#include "SVGFEOffset.h"
-#include "SVGFESpecularLighting.h"
-#include "SVGFETile.h"
-#include "SVGResourceClipper.h"
-#include "SVGResourceFilter.h"
-#include "SVGResourceImage.h"
-#include "SVGResourceMarker.h"
-#include "SVGResourceMasker.h"
-#include "SVGPaintServerSolid.h"
-#include "SVGPaintServerLinearGradient.h"
-#include "SVGPaintServerRadialGradient.h"
-#include "SVGPaintServerPattern.h"
-#include "Logging.h"
-#include "QuartzSupport.h"
-#include "RenderView.h"
-
-namespace WebCore {
-
-KRenderingDeviceContextQuartz::KRenderingDeviceContextQuartz(CGContextRef context)
- : m_cgContext(CGContextRetain(context))
-{
- ASSERT(m_cgContext);
-}
-
-KRenderingDeviceContextQuartz::~KRenderingDeviceContextQuartz()
-{
- CGContextRelease(m_cgContext);
-}
-
-AffineTransform KRenderingDeviceContextQuartz::concatCTM(const AffineTransform& worldMatrix)
-{
- AffineTransform ret = ctm();
- CGAffineTransform wMatrix = worldMatrix;
- CGContextConcatCTM(m_cgContext, wMatrix);
- return ret;
-}
-
-AffineTransform KRenderingDeviceContextQuartz::ctm() const
-{
- return CGContextGetCTM(m_cgContext);
-}
-
-void KRenderingDeviceContextQuartz::clearPath()
-{
- CGContextBeginPath(m_cgContext);
-}
-
-void KRenderingDeviceContextQuartz::addPath(const Path& path)
-{
- CGContextAddPath(m_cgContext, path.platformPath());
-}
-
-GraphicsContext* KRenderingDeviceContextQuartz::createGraphicsContext()
-{
- return new GraphicsContext(m_cgContext);
-}
-
-static bool __useFilters = true;
-
-bool KRenderingDeviceQuartz::filtersEnabled()
-{
- return __useFilters;
-}
-
-void KRenderingDeviceQuartz::setFiltersEnabled(bool enabled)
-{
- __useFilters = enabled;
-}
-
-static bool __useHardwareRendering = true;
-
-bool KRenderingDeviceQuartz::hardwareRenderingEnabled()
-{
- return __useHardwareRendering;
-}
-
-void KRenderingDeviceQuartz::setHardwareRenderingEnabled(bool enabled)
-{
- __useHardwareRendering = enabled;
-}
-
-#pragma mark -
-#pragma mark Context Management
-
-KRenderingDeviceContextQuartz* KRenderingDeviceQuartz::quartzContext() const
-{
- return static_cast<KRenderingDeviceContextQuartz*>(currentContext());
-}
-
-CGContextRef KRenderingDeviceQuartz::currentCGContext() const
-{
- ASSERT(quartzContext());
- return quartzContext()->cgContext();
-}
-
-KRenderingDeviceContext* KRenderingDeviceQuartz::contextForImage(SVGResourceImage *image) const
-{
- CGLayerRef cgLayer = image->cgLayer();
- if (!cgLayer) {
- // FIXME: we might not get back a layer if this is a loaded image
- // maybe this logic should go into SVGResourceImage?
- cgLayer = CGLayerCreateWithContext(currentCGContext(), CGSize(image->size() + IntSize(1,1)), NULL); // FIXME + 1 is a hack
- // FIXME: we should composite the original image onto the layer...
- image->setCGLayer(cgLayer);
- CGLayerRelease(cgLayer);
- }
- return new KRenderingDeviceContextQuartz(CGLayerGetContext(cgLayer));
-}
-
-#pragma mark -
-#pragma mark Resource Creation
-
-PassRefPtr<SVGPaintServer> KRenderingDeviceQuartz::createPaintServer(const SVGPaintServerType& type) const
-{
- SVGPaintServer* newServer = NULL;
- switch(type) {
- case SolidPaintServer:
- newServer = new SVGPaintServerSolid();
- break;
- case PatternPaintServer:
- newServer = new SVGPaintServerPattern();
- break;
- case LinearGradientPaintServer:
- newServer = new SVGPaintServerLinearGradient();
- break;
- case RadialGradientPaintServer:
- newServer = new SVGPaintServerRadialGradient();
- break;
- }
- return newServer;
-}
-
-PassRefPtr<SVGResource> KRenderingDeviceQuartz::createResource(const SVGResourceType& type) const
-{
- switch (type) {
- case ClipperResourceType:
- return new SVGResourceClipper();
- case MarkerResourceType:
- return new SVGResourceMarker();
- case ImageResourceType:
- return new SVGResourceImage();
- case FilterResourceType:
- return new SVGResourceFilter();
- case MaskerResourceType:
- return new SVGResourceMasker();
- }
- LOG_ERROR("Failed to create resource of type: %i", type);
- return 0;
-}
-
-SVGFilterEffect* KRenderingDeviceQuartz::createFilterEffect(const SVGFilterEffectType& type) const
-{
- switch(type)
- {
- /* Light sources are contained by the diffuse/specular light blocks
- case FE_DISTANT_LIGHT:
- case FE_POINT_LIGHT:
- case FE_SPOT_LIGHT:
- */
- case FE_BLEND: return new SVGFEBlend();
- case FE_COLOR_MATRIX: return new SVGFEColorMatrix();
- case FE_COMPONENT_TRANSFER: return new SVGFEComponentTransfer();
- case FE_COMPOSITE: return new SVGFEComposite();
-// case FE_CONVOLVE_MATRIX:
- case FE_DIFFUSE_LIGHTING: return new SVGFEDiffuseLighting();
- case FE_DISPLACEMENT_MAP: return new SVGFEDisplacementMap();
- case FE_FLOOD: return new SVGFEFlood();
- case FE_GAUSSIAN_BLUR: return new SVGFEGaussianBlur();
- case FE_IMAGE: return new SVGFEImage();
- case FE_MERGE: return new SVGFEMerge();
-// case FE_MORPHOLOGY:
- case FE_OFFSET: return new SVGFEOffset();
- case FE_SPECULAR_LIGHTING: return new SVGFESpecularLighting();
- case FE_TILE: return new SVGFETile();
-// case FE_TURBULENCE:
- default:
- return 0;
- }
-}
-
-KRenderingDevice* renderingDevice()
-{
- static KRenderingDevice* sharedRenderingDevice = new KRenderingDeviceQuartz();
- return sharedRenderingDevice;
-}
-
-}
-
-#endif // SVG_SUPPORT
+++ /dev/null
-/*
- * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
- * 2006 Rob Buis <buis@kde.org>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-
-#ifndef KRenderingDeviceQuartz_H
-#define KRenderingDeviceQuartz_H
-#ifdef SVG_SUPPORT
-
-#include "KRenderingDevice.h"
-
-typedef struct CGRect CGRect;
-typedef struct CGContext *CGContextRef;
-
-namespace WebCore {
-
-class KRenderingDeviceContextQuartz : public KRenderingDeviceContext {
-public:
- KRenderingDeviceContextQuartz(CGContextRef);
- virtual ~KRenderingDeviceContextQuartz();
-
- virtual AffineTransform concatCTM(const AffineTransform&);
- virtual AffineTransform ctm() const;
-
- virtual void clearPath();
- virtual void addPath(const Path&);
-
- virtual GraphicsContext* createGraphicsContext();
-
- CGContextRef cgContext() const { return m_cgContext; };
-
-private:
- CGContextRef m_cgContext;
-};
-
-class KRenderingDeviceQuartz : public KRenderingDevice {
-public:
- KRenderingDeviceQuartz() { }
- virtual ~KRenderingDeviceQuartz() { }
-
- virtual bool isBuffered() const { return false; }
-
- // context management.
- KRenderingDeviceContextQuartz* quartzContext() const;
- CGContextRef currentCGContext() const;
- virtual KRenderingDeviceContext* contextForImage(SVGResourceImage*) const;
-
- // Resource creation
- virtual PassRefPtr<SVGResource> createResource(const SVGResourceType&) const;
- virtual PassRefPtr<SVGPaintServer> createPaintServer(const SVGPaintServerType&) const;
- virtual SVGFilterEffect *createFilterEffect(const SVGFilterEffectType&) const;
-
- // filters (mostly debugging)
- static bool filtersEnabled();
- static void setFiltersEnabled(bool);
- static bool hardwareRenderingEnabled();
- static void setHardwareRenderingEnabled(bool);
-};
-
-} // namespace WebCore
-
-#endif // SVG_SUPPORT
-#endif // KRenderingDeviceQuartz_H
#include "CSSValueList.h"
#include "Document.h"
-#include "KRenderingDevice.h"
#include "SVGPaintServerGradient.h"
#include "SVGPaintServerSolid.h"
#include "RenderObject.h"
{
static SVGPaintServerSolid* _sharedSolidPaintServer = 0;
if (!_sharedSolidPaintServer)
- _sharedSolidPaintServer = static_cast<SVGPaintServerSolid*>(renderingDevice()->createPaintServer(SolidPaintServer).releaseRef());
+ _sharedSolidPaintServer = new SVGPaintServerSolid();
return _sharedSolidPaintServer;
}
#include <wtf/Vector.h>
#if PLATFORM(CG)
-#include "QuartzSupport.h"
+#include "CgSupport.h"
#endif
namespace WebCore {
#include "EventNames.h"
#include "Frame.h"
#include "FrameLoader.h"
-#include "KRenderingDevice.h"
-#include "MouseEvent.h"
#include "MouseEvent.h"
#include "RenderSVGContainer.h"
#include "ResourceRequest.h"
#include "SVGClipPathElement.h"
#include "Document.h"
-#include "KRenderingDevice.h"
#include "RenderView.h"
#include "SVGHelper.h"
#include "SVGMatrix.h"
#ifdef SVG_SUPPORT
#include "SVGFEBlendElement.h"
-#include "KRenderingDevice.h"
#include "SVGHelper.h"
+#include "SVGResourceFilter.h"
namespace WebCore {
SVGFEBlend* SVGFEBlendElement::filterEffect() const
{
if (!m_filterEffect)
- m_filterEffect = static_cast<SVGFEBlend*>(renderingDevice()->createFilterEffect(FE_BLEND));
+ m_filterEffect = static_cast<SVGFEBlend*>(SVGResourceFilter::createFilterEffect(FE_BLEND));
if (!m_filterEffect)
return 0;
m_filterEffect->setBlendMode((SVGBlendModeType) mode());
*/
#include "config.h"
+
#ifdef SVG_SUPPORT
#include "SVGFEColorMatrixElement.h"
-#include "KRenderingDevice.h"
#include "SVGHelper.h"
#include "SVGNames.h"
#include "SVGNumberList.h"
+#include "SVGResourceFilter.h"
namespace WebCore {
SVGFEColorMatrix* SVGFEColorMatrixElement::filterEffect() const
{
if (!m_filterEffect)
- m_filterEffect = static_cast<SVGFEColorMatrix*>(renderingDevice()->createFilterEffect(FE_COLOR_MATRIX));
+ m_filterEffect = static_cast<SVGFEColorMatrix*>(SVGResourceFilter::createFilterEffect(FE_COLOR_MATRIX));
if (!m_filterEffect)
return 0;
}
-// vim:ts=4:noet
#endif // SVG_SUPPORT
+// vim:ts=4:noet
*/
#include "config.h"
-#ifdef SVG_SUPPORT
-#include "Attr.h"
-#include "KRenderingDevice.h"
+#ifdef SVG_SUPPORT
+#include "SVGFEComponentTransferElement.h"
+#include "Attr.h"
#include "SVGNames.h"
#include "SVGHelper.h"
#include "SVGRenderStyle.h"
-#include "SVGFEComponentTransferElement.h"
#include "SVGFEFuncRElement.h"
#include "SVGFEFuncGElement.h"
#include "SVGFEFuncBElement.h"
#include "SVGFEFuncAElement.h"
+#include "SVGResourceFilter.h"
namespace WebCore {
-SVGFEComponentTransferElement::SVGFEComponentTransferElement(const QualifiedName& tagName, Document *doc)
+SVGFEComponentTransferElement::SVGFEComponentTransferElement(const QualifiedName& tagName, Document* doc)
: SVGFilterPrimitiveStandardAttributes(tagName, doc)
, m_filterEffect(0)
{
ANIMATED_PROPERTY_DEFINITIONS(SVGFEComponentTransferElement, String, String, string, In1, in1, SVGNames::inAttr.localName(), m_in1)
-void SVGFEComponentTransferElement::parseMappedAttribute(MappedAttribute *attr)
+void SVGFEComponentTransferElement::parseMappedAttribute(MappedAttribute* attr)
{
const String& value = attr->value();
if (attr->name() == SVGNames::inAttr)
SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr);
}
-SVGFEComponentTransfer *SVGFEComponentTransferElement::filterEffect() const
+SVGFEComponentTransfer* SVGFEComponentTransferElement::filterEffect() const
{
if (!m_filterEffect)
- m_filterEffect = static_cast<SVGFEComponentTransfer *>(renderingDevice()->createFilterEffect(FE_COMPONENT_TRANSFER));
+ m_filterEffect = static_cast<SVGFEComponentTransfer*>(SVGResourceFilter::createFilterEffect(FE_COMPONENT_TRANSFER));
if (!m_filterEffect)
return 0;
for (Node *n = firstChild(); n != 0; n = n->nextSibling()) {
if (n->hasTagName(SVGNames::feFuncRTag))
- m_filterEffect->setRedFunction(static_cast<SVGFEFuncRElement *>(n)->transferFunction());
+ m_filterEffect->setRedFunction(static_cast<SVGFEFuncRElement*>(n)->transferFunction());
else if (n->hasTagName(SVGNames::feFuncGTag))
- m_filterEffect->setGreenFunction(static_cast<SVGFEFuncGElement *>(n)->transferFunction());
+ m_filterEffect->setGreenFunction(static_cast<SVGFEFuncGElement*>(n)->transferFunction());
else if (n->hasTagName(SVGNames::feFuncBTag))
- m_filterEffect->setBlueFunction(static_cast<SVGFEFuncBElement *>(n)->transferFunction());
+ m_filterEffect->setBlueFunction(static_cast<SVGFEFuncBElement*>(n)->transferFunction());
else if (n->hasTagName(SVGNames::feFuncATag))
- m_filterEffect->setAlphaFunction(static_cast<SVGFEFuncAElement *>(n)->transferFunction());
+ m_filterEffect->setAlphaFunction(static_cast<SVGFEFuncAElement*>(n)->transferFunction());
}
return m_filterEffect;
}
-// vim:ts=4:noet
#endif // SVG_SUPPORT
+// vim:ts=4:noet
*/
#include "config.h"
+
#ifdef SVG_SUPPORT
#include "SVGFECompositeElement.h"
-#include "KRenderingDevice.h"
#include "SVGHelper.h"
#include "SVGNames.h"
+#include "SVGResourceFilter.h"
namespace WebCore {
-SVGFECompositeElement::SVGFECompositeElement(const QualifiedName& tagName, Document *doc)
+SVGFECompositeElement::SVGFECompositeElement(const QualifiedName& tagName, Document* doc)
: SVGFilterPrimitiveStandardAttributes(tagName, doc)
, m__operator(0)
, m_k1(0.0)
SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr);
}
-SVGFEComposite *SVGFECompositeElement::filterEffect() const
+SVGFEComposite* SVGFECompositeElement::filterEffect() const
{
if (!m_filterEffect)
- m_filterEffect = static_cast<SVGFEComposite *>(renderingDevice()->createFilterEffect(FE_COMPOSITE));
+ m_filterEffect = static_cast<SVGFEComposite*>(SVGResourceFilter::createFilterEffect(FE_COMPOSITE));
if (!m_filterEffect)
return 0;
m_filterEffect->setOperation((SVGCompositeOperationType) _operator());
}
-// vim:ts=4:noet
#endif // SVG_SUPPORT
+// vim:ts=4:noet
#include "config.h"
#ifdef SVG_SUPPORT
-
#include "SVGFEDiffuseLightingElement.h"
#include "Attr.h"
-#include "KRenderingDevice.h"
#include "SVGColor.h"
#include "SVGFELightElement.h"
#include "SVGHelper.h"
#include "SVGNames.h"
#include "SVGRenderStyle.h"
#include "SVGFEDiffuseLighting.h"
+#include "SVGResourceFilter.h"
namespace WebCore {
-SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement(const QualifiedName& tagName, Document *doc)
+SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement(const QualifiedName& tagName, Document* doc)
: SVGFilterPrimitiveStandardAttributes(tagName, doc)
, m_diffuseConstant(0.0)
, m_surfaceScale(0.0)
SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr);
}
-SVGFilterEffect *SVGFEDiffuseLightingElement::filterEffect() const
+SVGFilterEffect* SVGFEDiffuseLightingElement::filterEffect() const
{
if (!m_filterEffect)
- m_filterEffect = static_cast<SVGFEDiffuseLighting *>(renderingDevice()->createFilterEffect(FE_DIFFUSE_LIGHTING));
+ m_filterEffect = static_cast<SVGFEDiffuseLighting*>(SVGResourceFilter::createFilterEffect(FE_DIFFUSE_LIGHTING));
+ if (!m_filterEffect)
+ return 0;
+
m_filterEffect->setIn(in1());
setStandardAttributes(m_filterEffect);
- m_filterEffect->setDiffuseConstant((diffuseConstant()));
- m_filterEffect->setSurfaceScale((surfaceScale()));
- m_filterEffect->setKernelUnitLengthX((kernelUnitLengthX()));
- m_filterEffect->setKernelUnitLengthY((kernelUnitLengthY()));
+ m_filterEffect->setDiffuseConstant(diffuseConstant());
+ m_filterEffect->setSurfaceScale(surfaceScale());
+ m_filterEffect->setKernelUnitLengthX(kernelUnitLengthX());
+ m_filterEffect->setKernelUnitLengthY(kernelUnitLengthY());
m_filterEffect->setLightingColor(lightingColor()->color());
updateLights();
return m_filterEffect;
if (!m_filterEffect)
return;
- SVGLightSource *light = 0;
- for (Node *n = firstChild(); n; n = n->nextSibling()) {
- if (n->hasTagName(SVGNames::feDistantLightTag)||n->hasTagName(SVGNames::fePointLightTag)||n->hasTagName(SVGNames::feSpotLightTag)) {
- SVGFELightElement *lightNode = static_cast<SVGFELightElement *>(n);
+ SVGLightSource* light = 0;
+ for (Node* n = firstChild(); n; n = n->nextSibling()) {
+ if (n->hasTagName(SVGNames::feDistantLightTag) ||
+ n->hasTagName(SVGNames::fePointLightTag) ||
+ n->hasTagName(SVGNames::feSpotLightTag)) {
+ SVGFELightElement* lightNode = static_cast<SVGFELightElement*>(n);
light = lightNode->lightSource();
break;
}
}
+
m_filterEffect->setLightSource(light);
}
#endif // SVG_SUPPORT
+// vim:ts=4:noet
#include "config.h"
+
#ifdef SVG_SUPPORT
#include "SVGFEDisplacementMapElement.h"
-#include "KRenderingDevice.h"
#include "SVGHelper.h"
+#include "SVGResourceFilter.h"
namespace WebCore {
SVGFEDisplacementMap* SVGFEDisplacementMapElement::filterEffect() const
{
if (!m_filterEffect)
- m_filterEffect = static_cast<SVGFEDisplacementMap *>(renderingDevice()->createFilterEffect(FE_DISPLACEMENT_MAP));
+ m_filterEffect = static_cast<SVGFEDisplacementMap*>(SVGResourceFilter::createFilterEffect(FE_DISPLACEMENT_MAP));
if (!m_filterEffect)
return 0;
- m_filterEffect->setXChannelSelector((SVGChannelSelectorType)(xChannelSelector()));
- m_filterEffect->setYChannelSelector((SVGChannelSelectorType)(yChannelSelector()));
+ m_filterEffect->setXChannelSelector((SVGChannelSelectorType) xChannelSelector());
+ m_filterEffect->setYChannelSelector((SVGChannelSelectorType) yChannelSelector());
m_filterEffect->setIn(in1());
m_filterEffect->setIn2(in2());
m_filterEffect->setScale(scale());
}
}
+
#endif // SVG_SUPPORT
+
+// vim:ts=4:noet
*/
#include "config.h"
+
#ifdef SVG_SUPPORT
#include "SVGFEDistantLightElement.h"
#include "SVGDistantLightSource.h"
namespace WebCore {
-SVGFEDistantLightElement::SVGFEDistantLightElement(const QualifiedName& tagName, Document *doc) :
-SVGFELightElement(tagName, doc)
+SVGFEDistantLightElement::SVGFEDistantLightElement(const QualifiedName& tagName, Document* doc) :
+ SVGFELightElement(tagName, doc)
{
}
{
}
-SVGLightSource *SVGFEDistantLightElement::lightSource() const
+SVGLightSource* SVGFEDistantLightElement::lightSource() const
{
return new SVGDistantLightSource(azimuth(), elevation());
}
*/
#include "config.h"
+
#ifdef SVG_SUPPORT
#include "SVGFEFloodElement.h"
#include "SVGHelper.h"
#include "SVGNames.h"
#include "SVGRenderStyle.h"
-#include "KRenderingDevice.h"
+#include "SVGResourceFilter.h"
namespace WebCore {
-SVGFEFloodElement::SVGFEFloodElement(const QualifiedName& tagName, Document *doc)
+SVGFEFloodElement::SVGFEFloodElement(const QualifiedName& tagName, Document* doc)
: SVGFilterPrimitiveStandardAttributes(tagName, doc)
, m_filterEffect(0)
{
ANIMATED_PROPERTY_DEFINITIONS(SVGFEFloodElement, String, String, string, In1, in1, SVGNames::inAttr.localName(), m_in1)
-void SVGFEFloodElement::parseMappedAttribute(MappedAttribute *attr)
+void SVGFEFloodElement::parseMappedAttribute(MappedAttribute* attr)
{
const String& value = attr->value();
if (attr->name() == SVGNames::inAttr)
SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr);
}
-SVGFEFlood *SVGFEFloodElement::filterEffect() const
+SVGFEFlood* SVGFEFloodElement::filterEffect() const
{
if (!m_filterEffect)
- m_filterEffect = static_cast<SVGFEFlood *>(renderingDevice()->createFilterEffect(FE_FLOOD));
+ m_filterEffect = static_cast<SVGFEFlood*>(SVGResourceFilter::createFilterEffect(FE_FLOOD));
if (!m_filterEffect)
return 0;
m_filterEffect->setIn(in1());
setStandardAttributes(m_filterEffect);
- RenderStyle *filterStyle = const_cast<SVGFEFloodElement *>(this)->styleForRenderer(parentNode()->renderer());
- const SVGRenderStyle *svgStyle = filterStyle->svgStyle();
+ RenderStyle* filterStyle = const_cast<SVGFEFloodElement *>(this)->styleForRenderer(parentNode()->renderer());
+ const SVGRenderStyle* svgStyle = filterStyle->svgStyle();
m_filterEffect->setFloodColor(svgStyle->floodColor());
m_filterEffect->setFloodOpacity(svgStyle->floodOpacity());
filterStyle->deref(view()->renderArena());
}
-// vim:ts=4:noet
#endif // SVG_SUPPORT
+// vim:ts=4:noet
*/
#include "config.h"
+
#ifdef SVG_SUPPORT
#include "SVGFEFuncAElement.h"
}
-// vim:ts=4:noet
#endif // SVG_SUPPORT
+// vim:ts=4:noet
*/
#include "config.h"
+
#ifdef SVG_SUPPORT
#include "SVGFEFuncBElement.h"
}
-// vim:ts=4:noet
#endif // SVG_SUPPORT
+// vim:ts=4:noet
*/
#include "config.h"
+
#ifdef SVG_SUPPORT
#include "SVGFEFuncGElement.h"
namespace WebCore {
SVGFEFuncGElement::SVGFEFuncGElement(const QualifiedName& tagName, Document* doc) :
-SVGComponentTransferFunctionElement(tagName, doc)
+ SVGComponentTransferFunctionElement(tagName, doc)
{
}
}
-// vim:ts=4:noet
#endif // SVG_SUPPORT
+// vim:ts=4:noet
*/
#include "config.h"
+
#ifdef SVG_SUPPORT
#include "SVGFEFuncRElement.h"
}
-// vim:ts=4:noet
#endif // SVG_SUPPORT
+// vim:ts=4:noet
*/
#include "config.h"
+
#ifdef SVG_SUPPORT
#include "SVGFEGaussianBlurElement.h"
-#include "KRenderingDevice.h"
#include "SVGHelper.h"
#include "SVGNames.h"
+#include "SVGResourceFilter.h"
namespace WebCore {
SVGFEGaussianBlur* SVGFEGaussianBlurElement::filterEffect() const
{
if (!m_filterEffect)
- m_filterEffect = static_cast<SVGFEGaussianBlur*>(renderingDevice()->createFilterEffect(FE_GAUSSIAN_BLUR));
+ m_filterEffect = static_cast<SVGFEGaussianBlur*>(SVGResourceFilter::createFilterEffect(FE_GAUSSIAN_BLUR));
if (!m_filterEffect)
return 0;
m_filterEffect->setIn(in1());
}
-// vim:ts=4:noet
#endif // SVG_SUPPORT
+// vim:ts=4:noet
*/
#include "config.h"
+
#ifdef SVG_SUPPORT
#include "SVGFEImageElement.h"
#include "DocLoader.h"
#include "Document.h"
#include "SVGResourceImage.h"
-#include "KRenderingDevice.h"
#include "SVGHelper.h"
#include "SVGLength.h"
#include "SVGNames.h"
#include "SVGPreserveAspectRatio.h"
+#include "SVGResourceFilter.h"
namespace WebCore {
-SVGFEImageElement::SVGFEImageElement(const QualifiedName& tagName, Document *doc)
+SVGFEImageElement::SVGFEImageElement(const QualifiedName& tagName, Document* doc)
: SVGFilterPrimitiveStandardAttributes(tagName, doc)
, SVGURIReference()
, SVGLangSpace()
ANIMATED_PROPERTY_DEFINITIONS(SVGFEImageElement, SVGPreserveAspectRatio*, PreserveAspectRatio, preserveAspectRatio, PreserveAspectRatio, preserveAspectRatio, SVGNames::preserveAspectRatioAttr.localName(), m_preserveAspectRatio.get())
-void SVGFEImageElement::parseMappedAttribute(MappedAttribute *attr)
+void SVGFEImageElement::parseMappedAttribute(MappedAttribute* attr)
{
const String& value = attr->value();
if (attr->name() == SVGNames::preserveAspectRatioAttr)
}
}
-void SVGFEImageElement::notifyFinished(CachedResource *finishedObj)
+void SVGFEImageElement::notifyFinished(CachedResource* finishedObj)
{
if (finishedObj == m_cachedImage && filterEffect())
filterEffect()->setCachedImage(m_cachedImage);
}
-SVGFEImage *SVGFEImageElement::filterEffect() const
+SVGFEImage* SVGFEImageElement::filterEffect() const
{
if (!m_filterEffect)
- m_filterEffect = static_cast<SVGFEImage *>(renderingDevice()->createFilterEffect(FE_IMAGE));
+ m_filterEffect = static_cast<SVGFEImage*>(SVGResourceFilter::createFilterEffect(FE_IMAGE));
if (!m_filterEffect)
return 0;
setStandardAttributes(m_filterEffect);
}
-// vim:ts=4:noet
#endif // SVG_SUPPORT
+// vim:ts=4:noet
*/
#include "config.h"
+
#ifdef SVG_SUPPORT
#include "SVGFELightElement.h"
#endif // SVG_SUPPORT
+// vim:ts=4:noet
*/
#include "config.h"
+
#ifdef SVG_SUPPORT
#include "SVGFEMergeElement.h"
-#include "KRenderingDevice.h"
#include "SVGFEMergeNodeElement.h"
#include "SVGHelper.h"
+#include "SVGResourceFilter.h"
namespace WebCore {
SVGFEMerge* SVGFEMergeElement::filterEffect() const
{
if (!m_filterEffect)
- m_filterEffect = static_cast<SVGFEMerge*>(renderingDevice()->createFilterEffect(FE_MERGE));
+ m_filterEffect = static_cast<SVGFEMerge*>(SVGResourceFilter::createFilterEffect(FE_MERGE));
if (!m_filterEffect)
return 0;
setStandardAttributes(m_filterEffect);
}
m_filterEffect->setMergeInputs(mergeInputs);
-
return m_filterEffect;
}
}
-// vim:ts=4:noet
+
#endif // SVG_SUPPORT
+// vim:ts=4:noet
*/
#include "config.h"
+
#ifdef SVG_SUPPORT
#include "SVGFEMergeNodeElement.h"
}
-// vim:ts=4:noet
#endif // SVG_SUPPORT
+// vim:ts=4:noet
*/
#include "config.h"
-#ifdef SVG_SUPPORT
-#include "Attr.h"
-#include "KRenderingDevice.h"
+#ifdef SVG_SUPPORT
+#include "SVGFEOffsetElement.h"
+#include "Attr.h"
#include "SVGHelper.h"
#include "SVGRenderStyle.h"
-#include "SVGFEOffsetElement.h"
+#include "SVGResourceFilter.h"
namespace WebCore {
-SVGFEOffsetElement::SVGFEOffsetElement(const QualifiedName& tagName, Document *doc)
+SVGFEOffsetElement::SVGFEOffsetElement(const QualifiedName& tagName, Document* doc)
: SVGFilterPrimitiveStandardAttributes(tagName, doc)
, m_dx(0.0)
, m_dy(0.0)
ANIMATED_PROPERTY_DEFINITIONS(SVGFEOffsetElement, double, Number, number, Dx, dx, SVGNames::dxAttr.localName(), m_dx)
ANIMATED_PROPERTY_DEFINITIONS(SVGFEOffsetElement, double, Number, number, Dy, dy, SVGNames::dyAttr.localName(), m_dy)
-void SVGFEOffsetElement::parseMappedAttribute(MappedAttribute *attr)
+void SVGFEOffsetElement::parseMappedAttribute(MappedAttribute* attr)
{
const String& value = attr->value();
if (attr->name() == SVGNames::dxAttr)
SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr);
}
-SVGFEOffset *SVGFEOffsetElement::filterEffect() const
+SVGFEOffset* SVGFEOffsetElement::filterEffect() const
{
if (!m_filterEffect)
- m_filterEffect = static_cast<SVGFEOffset *>(renderingDevice()->createFilterEffect(FE_OFFSET));
+ m_filterEffect = static_cast<SVGFEOffset*>(SVGResourceFilter::createFilterEffect(FE_OFFSET));
if (!m_filterEffect)
return 0;
m_filterEffect->setIn(in1());
}
-// vim:ts=4:noet
#endif // SVG_SUPPORT
+// vim:ts=4:noet
*/
#include "config.h"
+
#ifdef SVG_SUPPORT
#include "SVGFEPointLightElement.h"
#include "SVGPointLightSource.h"
{
}
-SVGLightSource *SVGFEPointLightElement::lightSource() const
+SVGLightSource* SVGFEPointLightElement::lightSource() const
{
FloatPoint3D pos(x(), y(), z());
return new SVGPointLightSource(pos);
}
}
+
#endif // SVG_SUPPORT
+// vim:ts=4:noet
*/
#include "config.h"
+
#ifdef SVG_SUPPORT
#include "SVGFESpecularLightingElement.h"
-#include "KRenderingDevice.h"
#include "SVGColor.h"
#include "SVGHelper.h"
#include "SVGNames.h"
#include "SVGFELightElement.h"
+#include "SVGResourceFilter.h"
namespace WebCore {
, m_specularConstant(0.0)
, m_specularExponent(0.0)
, m_surfaceScale(0.0)
- , m_lightingColor(new SVGColor())
+ , m_lightingColor(new SVGColor)
, m_kernelUnitLengthX(0.0)
, m_kernelUnitLengthY(0.0)
, m_filterEffect(0)
SVGFESpecularLighting* SVGFESpecularLightingElement::filterEffect() const
{
if (!m_filterEffect)
- m_filterEffect = static_cast<SVGFESpecularLighting*>(renderingDevice()->createFilterEffect(FE_SPECULAR_LIGHTING));
+ m_filterEffect = static_cast<SVGFESpecularLighting*>(SVGResourceFilter::createFilterEffect(FE_SPECULAR_LIGHTING));
+ if (!m_filterEffect)
+ return 0;
m_filterEffect->setIn(in1());
setStandardAttributes(m_filterEffect);
m_filterEffect->setSpecularConstant((specularConstant()));
SVGLightSource* light = 0;
for (Node* n = firstChild(); n; n = n->nextSibling()) {
- if (n->hasTagName(SVGNames::feDistantLightTag)||n->hasTagName(SVGNames::fePointLightTag)||n->hasTagName(SVGNames::feSpotLightTag)) {
+ if (n->hasTagName(SVGNames::feDistantLightTag) ||
+ n->hasTagName(SVGNames::fePointLightTag) ||
+ n->hasTagName(SVGNames::feSpotLightTag)) {
SVGFELightElement* lightNode = static_cast<SVGFELightElement*>(n);
light = lightNode->lightSource();
break;
#endif // SVG_SUPPORT
+// vim:ts=4:noet
*/
#include "config.h"
+
#ifdef SVG_SUPPORT
#include "SVGFESpotLightElement.h"
#include "SVGSpotLightSource.h"
namespace WebCore {
-SVGFESpotLightElement::SVGFESpotLightElement(const QualifiedName& tagName, Document *doc) :
-SVGFELightElement(tagName, doc)
+SVGFESpotLightElement::SVGFESpotLightElement(const QualifiedName& tagName, Document* doc)
+ : SVGFELightElement(tagName, doc)
{
}
{
}
-SVGLightSource *SVGFESpotLightElement::lightSource() const
+SVGLightSource* SVGFESpotLightElement::lightSource() const
{
FloatPoint3D pos(x(), y(), z());
- //convert lookAt to a direction
+
+ // convert lookAt to a direction
FloatPoint3D direction(pointsAtX() - pos.x(),
pointsAtY() - pos.y(),
pointsAtZ() - pos.z());
}
}
+
#endif // SVG_SUPPORT
+// vim:ts=4:noet
#include "config.h"
#ifdef SVG_SUPPORT
-
#include "SVGFETileElement.h"
#include "Attr.h"
-#include "KRenderingDevice.h"
#include "SVGHelper.h"
#include "SVGRenderStyle.h"
+#include "SVGResourceFilter.h"
namespace WebCore {
-SVGFETileElement::SVGFETileElement(const QualifiedName& tagName, Document *doc)
+SVGFETileElement::SVGFETileElement(const QualifiedName& tagName, Document* doc)
: SVGFilterPrimitiveStandardAttributes(tagName, doc)
, m_filterEffect(0)
{
ANIMATED_PROPERTY_DEFINITIONS(SVGFETileElement, String, String, string, In1, in1, SVGNames::inAttr.localName(), m_in1)
-void SVGFETileElement::parseMappedAttribute(MappedAttribute *attr)
+void SVGFETileElement::parseMappedAttribute(MappedAttribute* attr)
{
const String& value = attr->value();
if (attr->name() == SVGNames::inAttr)
SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr);
}
-SVGFETile *SVGFETileElement::filterEffect() const
+SVGFETile* SVGFETileElement::filterEffect() const
{
if (!m_filterEffect)
- m_filterEffect = static_cast<SVGFETile *>(renderingDevice()->createFilterEffect(FE_TILE));
+ m_filterEffect = static_cast<SVGFETile*>(SVGResourceFilter::createFilterEffect(FE_TILE));
if (!m_filterEffect)
return 0;
m_filterEffect->setIn(in1());
}
-// vim:ts=4:noet
#endif // SVG_SUPPORT
+// vim:ts=4:noet
*/
#include "config.h"
+
#ifdef SVG_SUPPORT
#include "SVGFETurbulenceElement.h"
-
-#include "KRenderingDevice.h"
+#include "SVGResourceFilter.h"
namespace WebCore {
SVGFETurbulence* SVGFETurbulenceElement::filterEffect() const
{
if (!m_filterEffect)
- m_filterEffect = static_cast<SVGFETurbulence*>(renderingDevice()->createFilterEffect(FE_TURBULENCE));
+ m_filterEffect = static_cast<SVGFETurbulence*>(SVGResourceFilter::createFilterEffect(FE_TURBULENCE));
if (!m_filterEffect)
return 0;
}
-// vim:ts=4:noet
#endif // SVG_SUPPORT
+// vim:ts=4:noet
*/
#include "config.h"
+
#ifdef SVG_SUPPORT
#include "SVGFilterElement.h"
#include "Attr.h"
-#include "KRenderingDevice.h"
#include "SVGResourceFilter.h"
#include "SVGFilterPrimitiveStandardAttributes.h"
#include "SVGHelper.h"
return 0;
if (!m_filter)
- m_filter = WTF::static_pointer_cast<SVGResourceFilter>(renderingDevice()->createResource(FilterResourceType));
+ m_filter = new SVGResourceFilter();
bool filterBBoxMode = filterUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX;
m_filter->setFilterBoundingBoxMode(filterBBoxMode);
*/
#include "config.h"
+
#ifdef SVG_SUPPORT
#include "SVGGradientElement.h"
-#include "KRenderingDevice.h"
+#include "cssstyleselector.h"
#include "RenderPath.h"
#include "RenderView.h"
#include "SVGHelper.h"
#include "SVGTransformList.h"
#include "SVGTransformable.h"
#include "SVGUnitTypes.h"
-#include "cssstyleselector.h"
+#include "SVGPaintServerLinearGradient.h"
+#include "SVGPaintServerRadialGradient.h"
namespace WebCore {
SVGResource* SVGGradientElement::canvasResource()
{
if (!m_resource) {
- m_resource = WTF::static_pointer_cast<SVGPaintServerGradient>(renderingDevice()->createPaintServer(gradientType()));
+ if (gradientType() == LinearGradientPaintServer)
+ m_resource = new SVGPaintServerLinearGradient();
+ else
+ m_resource = new SVGPaintServerRadialGradient();
+
m_resource->setListener(this);
buildGradient(m_resource);
}
*/
#include "config.h"
+
#ifdef SVG_SUPPORT
#include "SVGLinearGradientElement.h"
-#include "KRenderingDevice.h"
#include "SVGPaintServerLinearGradient.h"
#include "SVGHelper.h"
#include "SVGLength.h"
*/
#include "config.h"
+
#ifdef SVG_SUPPORT
#include "SVGMarkerElement.h"
-#include "KRenderingDevice.h"
#include "PlatformString.h"
#include "RenderSVGContainer.h"
#include "SVGAngle.h"
*/
#include "config.h"
+
#ifdef SVG_SUPPORT
#include "SVGMaskElement.h"
#include "GraphicsContext.h"
#include "SVGResourceImage.h"
-#include "KRenderingDevice.h"
#include "RenderSVGContainer.h"
#include "SVGHelper.h"
#include "SVGLength.h"
SVGStyledElement::parseMappedAttribute(attr);
}
}
-
SVGResourceImage* SVGMaskElement::drawMaskerContent()
{
- KRenderingDevice* device = renderingDevice();
- if (!device->currentContext()) // FIXME: hack for now until Image::lockFocus exists
- return 0;
- if (!renderer())
- return 0;
-
+ // FIXME: Masks are broken! This way it can NOT work!
+ // We need a image->createContext() function - as Eric suggested -
+ // to finally fix the problem in one function, and share it with patterns...
+ return 0;
SVGResourceImage* maskImage = new SVGResourceImage();
IntSize size = IntSize(lroundf(width()->value()), lroundf(height()->value()));
maskImage->init(size);
- KRenderingDeviceContext* patternContext = device->contextForImage(maskImage);
- device->pushContext(patternContext);
-
- OwnPtr<GraphicsContext> context(patternContext->createGraphicsContext());
+ OwnPtr<GraphicsContext> context(contextForImage(maskImage));
RenderSVGContainer* maskContainer = static_cast<RenderSVGContainer*>(renderer());
RenderObject::PaintInfo info(context.get(), IntRect(), PaintPhaseForeground, 0, 0, 0);
maskContainer->setDrawsContents(true);
maskContainer->paint(info, 0, 0);
maskContainer->setDrawsContents(false);
-
- device->popContext();
- delete patternContext;
return maskImage;
}
if (m_dirty) {
RefPtr<SVGResourceImage> mask(drawMaskerContent());
m_masker->setMask(mask);
- m_dirty = (mask != 0);
+ m_dirty = (mask == 0);
}
return m_masker.get();
}
*/
#include "config.h"
+
#ifdef SVG_SUPPORT
#include "SVGPatternElement.h"
#include "Document.h"
#include "GraphicsContext.h"
#include "SVGResourceImage.h"
-#include "KRenderingDevice.h"
#include "SVGPaintServerPattern.h"
#include "RenderSVGContainer.h"
#include "SVGHelper.h"
void SVGPatternElement::drawPatternContentIntoTile(const SVGPatternElement* target, const IntSize& newSize, AffineTransform patternTransformMatrix)
{
- KRenderingDevice* device = renderingDevice();
-
SVGStyledElement* activeElement = static_cast<SVGStyledElement*>(m_paintServer->activeClient()->element());
bool bbox = (patternUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX);
m_tile = new SVGResourceImage();
m_tile->init(newSize);
- KRenderingDeviceContext* patternContext = device->contextForImage(m_tile.get());
- device->pushContext(patternContext);
+ OwnPtr<GraphicsContext> patternContext(contextForImage(m_tile.get()));
+
FloatRect rect(x()->value(), y()->value(), width()->value(), height()->value());
m_paintServer->setBbox(rect);
m_paintServer->setPatternTransform(patternTransformMatrix);
m_paintServer->setTile(m_tile.get());
- OwnPtr<GraphicsContext> context(patternContext->createGraphicsContext());
-
for (Node* n = target->firstChild(); n; n = n->nextSibling()) {
SVGElement* elem = svg_dynamic_cast(n);
if (!elem || !elem->isStyled())
item->setLocalTransform(newMatrix.matrix());
}
#endif
-
- RenderObject::PaintInfo info(context.get(), IntRect(), PaintPhaseForeground, 0, 0, 0);
+
+ RenderObject::PaintInfo info(patternContext.get(), IntRect(), PaintPhaseForeground, 0, 0, 0);
item->paint(info, 0, 0);
#if 0
if (savedContext)
const_cast<SVGPatternElement*>(this)->pushAttributeContext(savedContext);
-
- device->popContext();
- delete patternContext;
}
void SVGPatternElement::notifyClientsToRepaint() const
SVGResource* SVGPatternElement::canvasResource()
{
if (!m_paintServer) {
- m_paintServer = WTF::static_pointer_cast<SVGPaintServerPattern>(renderingDevice()->createPaintServer(SVGPaintServerType(PatternPaintServer)));
+ m_paintServer = new SVGPaintServerPattern();
m_paintServer->setListener(const_cast<SVGPatternElement*>(this));
}
return m_paintServer.get();
*/
#include "config.h"
+
#ifdef SVG_SUPPORT
#include "SVGStyledElement.h"
#include "Attr.h"
#include "HTMLNames.h"
#include "Document.h"
-#include "KRenderingDevice.h"
#include "PlatformString.h"
#include "RenderView.h"
#include "RenderPath.h"
namespace WebCore {
class CSSStyleDeclaration;
- class KRenderingDevice;
class RenderPath;
class RenderView;
#include "FloatRect.h"
#include "Image.h"
#include "IntRect.h"
+#include "Path.h"
#include "Pen.h"
#include "TextDirection.h"
#include "UChar.h"
class GraphicsContextPlatformPrivate;
class KURL;
class Path;
+ class SVGResourceImage;
class TextRun;
class TextStyle;
-#ifdef SVG_SUPPORT
- class KRenderingDeviceContext;
-#endif
-
class GraphicsContext : Noncopyable {
public:
GraphicsContext(PlatformGraphicsContext*);
void setCompositeOperation(CompositeOperator);
+ void beginPath();
+ void addPath(const Path& path);
+
void clip(const Path&);
void scale(const FloatSize&);
void concatCTM(const AffineTransform&);
-#ifdef SVG_SUPPORT
- KRenderingDeviceContext* createRenderingDeviceContext();
-#endif
-
#if PLATFORM(WIN)
GraphicsContext(HDC); // FIXME: To be removed.
HDC getWindowsContext(bool supportAlphaBlend = false, const IntRect* = 0); // The passed in rect is used to create a bitmap for compositing inside transparency layers.
void releaseWindowsContext(HDC, bool supportAlphaBlend = false, const IntRect* = 0); // The passed in HDC should be the one handed back by getWindowsContext.
#endif
+#if PLATFORM(QT)
+ void setFillRule(WindRule);
+ PlatformPath* currentPath();
+#endif
+
private:
void savePlatformState();
void restorePlatformState();
GraphicsContextPlatformPrivate* m_data;
};
+#ifdef SVG_SUPPORT
+ GraphicsContext* contextForImage(SVGResourceImage*);
+#endif
+
} // namespace WebCore
#endif // GraphicsContext_h
#include "Path.h"
#include <wtf/MathExtras.h>
-#ifdef SVG_SUPPORT
-#include "KRenderingDeviceQuartz.h"
-#endif
-
#include <GraphicsContextPlatformPrivate.h> // FIXME: Temporary.
using namespace std;
CGContextEOClip(context);
}
-#ifdef SVG_SUPPORT
-KRenderingDeviceContext* GraphicsContext::createRenderingDeviceContext()
-{
- return new KRenderingDeviceContextQuartz(platformContext());
-}
-#endif
-
void GraphicsContext::beginTransparencyLayer(float opacity)
{
if (paintingDisabled())
break;
}
}
+
+void GraphicsContext::beginPath()
+{
+ CGContextBeginPath(platformContext());
+}
+
+void GraphicsContext::addPath(const Path& path)
+{
+ CGContextAddPath(platformContext(), path.platformPath());
+}
void GraphicsContext::clip(const Path& path)
{
ApplyToStrokeTargetType = 2
};
+ class GraphicsContext;
class RenderObject;
class RenderPath;
class RenderStyle;
- class KRenderingDeviceContext; // FIXME: This is gone soon!
class SVGPaintServer : public SVGResource {
public:
virtual TextStream& externalRepresentation(TextStream&) const = 0;
// To be implemented in platform specific code.
- virtual void draw(KRenderingDeviceContext*, const RenderPath*, SVGPaintTargetType) const;
- virtual void teardown(KRenderingDeviceContext*, const RenderObject*, SVGPaintTargetType) const;
- virtual void renderPath(KRenderingDeviceContext*, const RenderPath*, SVGPaintTargetType) const;
+ virtual void draw(GraphicsContext*&, const RenderPath*, SVGPaintTargetType) const;
+ virtual void teardown(GraphicsContext*&, const RenderObject*, SVGPaintTargetType) const;
+ virtual void renderPath(GraphicsContext*&, const RenderPath*, SVGPaintTargetType) const;
- virtual bool setup(KRenderingDeviceContext*, const RenderObject*, SVGPaintTargetType) const = 0;
+ virtual bool setup(GraphicsContext*&, const RenderObject*, SVGPaintTargetType) const = 0;
protected:
#if PLATFORM(CG)
, m_stopsCache(0)
, m_stopsCount(0)
, m_shadingCache(0)
+ , m_savedContext(0)
#endif
{
}
virtual TextStream& externalRepresentation(TextStream&) const;
#if PLATFORM(CG)
- virtual void teardown(KRenderingDeviceContext*, const RenderObject*, SVGPaintTargetType) const;
- virtual void renderPath(KRenderingDeviceContext*, const RenderPath*, SVGPaintTargetType) const;
+ virtual void teardown(GraphicsContext*&, const RenderObject*, SVGPaintTargetType) const;
+ virtual void renderPath(GraphicsContext*&, const RenderPath*, SVGPaintTargetType) const;
- virtual bool setup(KRenderingDeviceContext*, const RenderObject*, SVGPaintTargetType) const;
+ virtual bool setup(GraphicsContext*&, const RenderObject*, SVGPaintTargetType) const;
virtual void invalidate();
CGShadingRef m_shadingCache;
mutable RefPtr<SVGResourceImage> m_maskImage;
+
+ mutable GraphicsContext* m_savedContext;
#endif
};
virtual TextStream& externalRepresentation(TextStream&) const;
#if PLATFORM(QT)
- virtual bool setup(KRenderingDeviceContext*, const RenderObject*, SVGPaintTargetType) const;
+ virtual bool setup(GraphicsContext*&, const RenderObject*, SVGPaintTargetType) const;
#endif
private:
virtual TextStream& externalRepresentation(TextStream&) const;
#if PLATFORM(CG)
- virtual bool setup(KRenderingDeviceContext*, const RenderObject*, SVGPaintTargetType) const;
- virtual void teardown(KRenderingDeviceContext*, const RenderObject*, SVGPaintTargetType) const;
+ virtual bool setup(GraphicsContext*&, const RenderObject*, SVGPaintTargetType) const;
+ virtual void teardown(GraphicsContext*&, const RenderObject*, SVGPaintTargetType) const;
#endif
#if PLATFORM(QT)
- virtual bool setup(KRenderingDeviceContext*, const RenderObject*, SVGPaintTargetType) const;
+ virtual bool setup(GraphicsContext*&, const RenderObject*, SVGPaintTargetType) const;
#endif
private:
virtual TextStream& externalRepresentation(TextStream&) const;
#if PLATFORM(QT)
- virtual bool setup(KRenderingDeviceContext*, const RenderObject*, SVGPaintTargetType) const;
+ virtual bool setup(GraphicsContext*&, const RenderObject*, SVGPaintTargetType) const;
#endif
private:
virtual TextStream& externalRepresentation(TextStream&) const;
#if PLATFORM(CG) || PLATFORM(QT)
- virtual bool setup(KRenderingDeviceContext*, const RenderObject*, SVGPaintTargetType) const;
+ virtual bool setup(GraphicsContext*&, const RenderObject*, SVGPaintTargetType) const;
#endif
private:
return m_clients;
}
-String SVGResource::idInRegistry() const
-{
- return m_registryId;
-}
-
-void SVGResource::setIdInRegistry(const String& id)
-{
- m_registryId = id;
-}
-
TextStream& SVGResource::externalRepresentation(TextStream& ts) const
{
return ts;
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 TextStream& externalRepresentation(TextStream&) const;
private:
- String m_registryId;
RenderPathList m_clients;
};
Vector<ClipData> m_clipData;
};
+ class GraphicsContext;
+
class SVGResourceClipper : public SVGResource {
public:
SVGResourceClipper();
virtual TextStream& externalRepresentation(TextStream&) const;
// To be implemented by the specific rendering devices
- void applyClip(const FloatRect& boundingBox) const;
+ void applyClip(GraphicsContext*, const FloatRect& boundingBox) const;
private:
ClipDataList m_clipData;
#ifdef SVG_SUPPORT
#include "SVGResource.h"
+#include "SVGFilterEffect.h"
#include "FloatRect.h"
namespace WebCore {
+class GraphicsContext;
class SVGFilterEffect;
class SVGResourceFilter : public SVGResource {
SVGResourceFilter();
virtual ~SVGResourceFilter();
+ static SVGFilterEffect* createFilterEffect(const SVGFilterEffectType&);
+
virtual bool isFilter() const { return true; }
bool filterBoundingBoxMode() const { return m_filterBBoxMode; }
virtual TextStream& externalRepresentation(TextStream&) const;
// To be implemented in platform specific code.
- void prepareFilter(const FloatRect& bbox);
- void applyFilter(const FloatRect& bbox);
+ void prepareFilter(GraphicsContext*&, const FloatRect& bbox);
+ void applyFilter(GraphicsContext*&, const FloatRect& bbox);
#if PLATFORM(CI)
CIImage* imageForName(const String&) const;
CIContext* m_filterCIContext;
CGLayerRef m_filterCGLayer;
+ GraphicsContext* m_savedContext;
NSMutableDictionary* m_imagesByName;
#endif
namespace WebCore {
class FloatRect;
+ class GraphicsContext;
class SVGResourceImage;
class SVGResourceMasker : public SVGResource {
virtual TextStream& externalRepresentation(TextStream&) const;
// To be implemented by the specific rendering devices
- void applyMask(const FloatRect& boundingBox) const;
+ void applyMask(GraphicsContext*, const FloatRect& boundingBox) const;
private:
RefPtr<SVGResourceImage> m_mask;
#include "config.h"
#ifdef SVG_SUPPORT
#include <ApplicationServices/ApplicationServices.h>
-#include "QuartzSupport.h"
+#include "CgSupport.h"
#include "GraphicsContext.h"
#include "KCanvasRenderingStyle.h"
#include "RenderStyle.h"
-#include "wtf/Assertions.h"
+#include <wtf/Assertions.h>
#include "SVGRenderStyle.h"
namespace WebCore {
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef QuartzSupport_H
-#define QuartzSupport_H
+#ifndef CgSupport_H
+#define CgSupport_H
#ifdef SVG_SUPPORT
}
#endif // SVG_SUPPORT
-#endif // !QuartzSupport_H
+#endif // !CgSupport_H
#include <ApplicationServices/ApplicationServices.h>
#include "KCanvasRenderingStyle.h"
-#include "KRenderingDeviceQuartz.h"
-#include "QuartzSupport.h"
+#include "CgSupport.h"
#include "RenderPath.h"
#include "SVGRenderStyle.h"
#include "SVGStyledElement.h"
#ifdef SVG_SUPPORT
#include "SVGPaintServer.h"
-#include "KRenderingDeviceQuartz.h"
+#include "GraphicsContext.h"
#include "RenderPath.h"
namespace WebCore {
-void SVGPaintServer::draw(KRenderingDeviceContext* context, const RenderPath* path, SVGPaintTargetType type) const
+void SVGPaintServer::draw(GraphicsContext*& context, const RenderPath* path, SVGPaintTargetType type) const
{
if (!setup(context, path, type))
return;
teardown(context, path, type);
}
-void SVGPaintServer::teardown(KRenderingDeviceContext*, const RenderObject*, SVGPaintTargetType) const
+void SVGPaintServer::teardown(GraphicsContext*&, const RenderObject*, SVGPaintTargetType) const
{
// no-op
}
-void SVGPaintServer::renderPath(KRenderingDeviceContext* context, const RenderPath* path, SVGPaintTargetType type) const
+void SVGPaintServer::renderPath(GraphicsContext*& context, const RenderPath* path, SVGPaintTargetType type) const
{
RenderStyle* style = path->style();
-
- KRenderingDeviceContextQuartz* quartzContext = static_cast<KRenderingDeviceContextQuartz*>(context);
- CGContextRef contextRef = quartzContext->cgContext();
+ CGContextRef contextRef = context->platformContext();
if ((type & ApplyToFillTargetType) && style->svgStyle()->hasFill())
fillPath(contextRef, path);
#ifdef SVG_SUPPORT
#include "SVGPaintServerGradient.h"
-#include "KRenderingDeviceQuartz.h"
+#include "GraphicsContext.h"
#include "SVGPaintServerLinearGradient.h"
#include "SVGPaintServerRadialGradient.h"
#include "RenderPath.h"
-#include "QuartzSupport.h"
+#include "CgSupport.h"
namespace WebCore {
}
}
-void SVGPaintServerGradient::teardown(KRenderingDeviceContext* context, const RenderObject* object, SVGPaintTargetType type) const
+void SVGPaintServerGradient::teardown(GraphicsContext*& context, const RenderObject* object, SVGPaintTargetType type) const
{
CGShadingRef shading = m_shadingCache;
- KRenderingDeviceQuartz* quartzDevice = static_cast<KRenderingDeviceQuartz*>(renderingDevice());
- CGContextRef contextRef = quartzDevice->currentCGContext();
+ CGContextRef contextRef = context->platformContext();
RenderStyle* style = object->style();
ASSERT(contextRef != NULL);
// workaround for filling the entire screen with the shading in the case that no text was intersected with the clip
if (!isPaintingText() || (object->width() > 0 && object->height() > 0))
CGContextDrawShading(contextRef, shading);
- CGContextRestoreGState(contextRef);
+ CGContextRestoreGState(contextRef);
}
if ((type & ApplyToStrokeTargetType) && style->svgStyle()->hasStroke()) {
if (isPaintingText()) {
int width = 2048;
int height = 2048; // FIXME??? SEE ABOVE
- delete quartzDevice->popContext();
- contextRef = quartzDevice->currentCGContext();
+
+ delete context;
+ context = m_savedContext;
+ contextRef = context->platformContext();
+ m_savedContext = 0;
+
void* imageBuffer = fastMalloc(width * height);
CGColorSpaceRef grayColorSpace = CGColorSpaceCreateDeviceGray();
CGContextRef grayscaleContext = CGBitmapContextCreate(imageBuffer, width, height, 8, width, grayColorSpace, kCGImageAlphaNone);
CGImageRelease(grayscaleImage);
}
CGContextDrawShading(contextRef, shading);
- CGContextRestoreGState(contextRef);
+ CGContextRestoreGState(contextRef);
}
CGContextRestoreGState(contextRef);
}
-void SVGPaintServerGradient::renderPath(KRenderingDeviceContext* context, const RenderPath* path, SVGPaintTargetType type) const
+void SVGPaintServerGradient::renderPath(GraphicsContext*& context, const RenderPath* path, SVGPaintTargetType type) const
{
- KRenderingDeviceQuartz* quartzDevice = static_cast<KRenderingDeviceQuartz*>(renderingDevice());
- CGContextRef contextRef = quartzDevice->currentCGContext();
+ CGContextRef contextRef = context->platformContext();
RenderStyle* style = path->style();
ASSERT(contextRef != NULL);
CGContextConcatCTM(contextRef, transform);
}
-bool SVGPaintServerGradient::setup(KRenderingDeviceContext* context, const RenderObject* object, SVGPaintTargetType type) const
+bool SVGPaintServerGradient::setup(GraphicsContext*& context, const RenderObject* object, SVGPaintTargetType type) const
{
if (listener()) // this seems like bad design to me, should be in a common baseclass. -- ecs 8/6/05
listener()->resourceNotification();
if (!m_shadingCache)
const_cast<SVGPaintServerGradient*>(this)->updateQuartzGradientCache(this);
- KRenderingDeviceQuartz* quartzDevice = static_cast<KRenderingDeviceQuartz*>(renderingDevice());
- CGContextRef contextRef = quartzDevice->currentCGContext();
+ CGContextRef contextRef = context->platformContext();
RenderStyle* style = object->style();
ASSERT(contextRef != NULL);
CGContextSetAlpha(contextRef, style->opacity());
if ((type & ApplyToFillTargetType) && style->svgStyle()->hasFill()) {
- CGContextSaveGState(contextRef);
+ CGContextSaveGState(contextRef);
if (isPaintingText())
CGContextSetTextDrawingMode(contextRef, kCGTextClip);
}
if ((type & ApplyToStrokeTargetType) && style->svgStyle()->hasStroke()) {
- CGContextSaveGState(contextRef);
+ CGContextSaveGState(contextRef);
applyStrokeStyleToContext(contextRef, style, object); // FIXME: this seems like the wrong place for this.
if (isPaintingText()) {
m_maskImage = new SVGResourceImage();
int height = 2048; // FIXME???
IntSize size = IntSize(width, height);
m_maskImage->init(size);
- KRenderingDeviceContext* maskImageContext = quartzDevice->contextForImage(m_maskImage.get());
- quartzDevice->pushContext(maskImageContext);
- CGContextRef maskContext = static_cast<KRenderingDeviceContextQuartz*>(maskImageContext)->cgContext();
+
+ GraphicsContext* maskImageContext = contextForImage(m_maskImage.get());
+ CGContextRef maskContext = maskImageContext->platformContext();
const_cast<RenderObject*>(object)->style()->setColor(Color(255, 255, 255));
CGContextSetTextDrawingMode(maskContext, kCGTextStroke);
+
+ m_savedContext = context;
+ context = maskImageContext;
}
}
#ifdef SVG_SUPPORT
#include "SVGPaintServerPattern.h"
-#include "KRenderingDeviceQuartz.h"
+#include "GraphicsContext.h"
#include "RenderObject.h"
#include "SVGResourceImage.h"
-#include "QuartzSupport.h"
+#include "CgSupport.h"
namespace WebCore {
CGContextDrawLayerAtPoint(context, CGPointZero, layer);
}
-bool SVGPaintServerPattern::setup(KRenderingDeviceContext* context, const RenderObject* object, SVGPaintTargetType type) const
+bool SVGPaintServerPattern::setup(GraphicsContext*& context, const RenderObject* object, SVGPaintTargetType type) const
{
if(listener()) // this seems like bad design to me, should be in a common baseclass. -- ecs 8/6/05
listener()->resourceNotification();
RenderStyle* style = object->style();
- KRenderingDeviceContextQuartz* quartzContext = static_cast<KRenderingDeviceContextQuartz*>(context);
- CGContextRef contextRef = quartzContext->cgContext();
+ CGContextRef contextRef = context->platformContext();
RefPtr<SVGResourceImage> cell = tile();
if (!cell)
return true;
}
-void SVGPaintServerPattern::teardown(KRenderingDeviceContext* context, const RenderObject* object, SVGPaintTargetType type) const
+void SVGPaintServerPattern::teardown(GraphicsContext*& context, const RenderObject* object, SVGPaintTargetType type) const
{
- KRenderingDeviceContextQuartz* quartzContext = static_cast<KRenderingDeviceContextQuartz*>(context);
- CGContextRef contextRef = quartzContext->cgContext();
+ CGContextRef contextRef = context->platformContext();
CGPatternRelease(m_pattern);
CGColorSpaceRelease(m_patternSpace);
CGContextRestoreGState(contextRef);
#ifdef SVG_SUPPORT
#include "SVGPaintServerSolid.h"
+#include "GraphicsContext.h"
#include "RenderObject.h"
-#include "KRenderingDeviceQuartz.h"
-#include "QuartzSupport.h"
+#include "CgSupport.h"
namespace WebCore {
-bool SVGPaintServerSolid::setup(KRenderingDeviceContext* context, const RenderObject* object, SVGPaintTargetType type) const
+bool SVGPaintServerSolid::setup(GraphicsContext*& context, const RenderObject* object, SVGPaintTargetType type) const
{
- KRenderingDeviceContextQuartz* quartzContext = static_cast<KRenderingDeviceContextQuartz*>(context);
- CGContextRef contextRef = quartzContext->cgContext();
+ CGContextRef contextRef = context->platformContext();
RenderStyle* style = object->style();
CGContextSetAlpha(contextRef, style->opacity());
#include "SVGResourceClipper.h"
#include "GraphicsContext.h"
-#include "KRenderingDeviceQuartz.h"
-#include "QuartzSupport.h"
+#include "CgSupport.h"
namespace WebCore {
-void SVGResourceClipper::applyClip(const FloatRect& boundingBox) const
+void SVGResourceClipper::applyClip(GraphicsContext* context, const FloatRect& boundingBox) const
{
- KRenderingDeviceContext* context = renderingDevice()->currentContext();
- CGContextRef cgContext = static_cast<KRenderingDeviceContextQuartz*>(context)->cgContext();
+ CGContextRef cgContext = context->platformContext();
if (m_clipData.clipData().size() < 1)
return;
bool heterogenousClipRules = false;
WindRule clipRule = m_clipData.clipData()[0].windRule;
- context->clearPath();
+ context->beginPath();
CGAffineTransform bboxTransform = CGAffineTransformMakeMapBetweenRects(CGRectMake(0,0,1,1), CGRect(boundingBox));
#ifdef SVG_SUPPORT
#include "AffineTransform.h"
#include "FoundationExtras.h"
-#include "KRenderingDeviceQuartz.h"
+#include "GraphicsContext.h"
#include "SVGResourceFilter.h"
+#include "SVGFEBlend.h"
+#include "SVGFEColorMatrix.h"
+#include "SVGFEComponentTransfer.h"
+#include "SVGFEComposite.h"
+#include "SVGFEDiffuseLighting.h"
+#include "SVGFEDisplacementMap.h"
+#include "SVGFEFlood.h"
+#include "SVGFEGaussianBlur.h"
+#include "SVGFEImage.h"
+#include "SVGFEMerge.h"
+#include "SVGFEOffset.h"
+#include "SVGFESpecularLighting.h"
+#include "SVGFETile.h"
+
#include <QuartzCore/CoreImage.h>
namespace WebCore {
SVGResourceFilter::SVGResourceFilter()
: m_filterCIContext(0)
, m_filterCGLayer(0)
+ , m_savedContext(0)
{
m_imagesByName = HardRetainWithNSRelease([[NSMutableDictionary alloc] init]);
}
HardRelease(m_imagesByName);
}
-void SVGResourceFilter::prepareFilter(const FloatRect &bbox)
+SVGFilterEffect* SVGResourceFilter::createFilterEffect(const SVGFilterEffectType& type)
{
- if (bbox.isEmpty() || !KRenderingDeviceQuartz::filtersEnabled() || m_effects.isEmpty())
- return;
-
- CGContextRef cgContext = static_cast<KRenderingDeviceQuartz*>(renderingDevice())->currentCGContext();
+ switch(type)
+ {
+ /* Light sources are contained by the diffuse/specular light blocks
+ case FE_DISTANT_LIGHT:
+ case FE_POINT_LIGHT:
+ case FE_SPOT_LIGHT:
+ */
+ case FE_BLEND: return new SVGFEBlend();
+ case FE_COLOR_MATRIX: return new SVGFEColorMatrix();
+ case FE_COMPONENT_TRANSFER: return new SVGFEComponentTransfer();
+ case FE_COMPOSITE: return new SVGFEComposite();
+// case FE_CONVOLVE_MATRIX:
+ case FE_DIFFUSE_LIGHTING: return new SVGFEDiffuseLighting();
+ case FE_DISPLACEMENT_MAP: return new SVGFEDisplacementMap();
+ case FE_FLOOD: return new SVGFEFlood();
+ case FE_GAUSSIAN_BLUR: return new SVGFEGaussianBlur();
+ case FE_IMAGE: return new SVGFEImage();
+ case FE_MERGE: return new SVGFEMerge();
+// case FE_MORPHOLOGY:
+ case FE_OFFSET: return new SVGFEOffset();
+ case FE_SPECULAR_LIGHTING: return new SVGFESpecularLighting();
+ case FE_TILE: return new SVGFETile();
+// case FE_TURBULENCE:
+ default:
+ return 0;
+ }
+}
- // get a CIContext, and CGLayer for drawing in.
- bool useSoftware = ! KRenderingDeviceQuartz::hardwareRenderingEnabled();
- NSDictionary *contextOptions = nil;
+void SVGResourceFilter::prepareFilter(GraphicsContext*& context, const FloatRect& bbox)
+{
+ if (bbox.isEmpty() || m_effects.isEmpty())
+ return;
- if (useSoftware)
- contextOptions = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], kCIContextUseSoftwareRenderer, nil];
+ CGContextRef cgContext = context->platformContext();
// Use of CGBegin/EndTransparencyLayer around this call causes over release
// of cgContext due to it being created on an autorelease pool, and released
// <http://bugs.webkit.org/show_bug.cgi?id=8425>
// <http://bugs.webkit.org/show_bug.cgi?id=6947>
// <rdar://problem/4647735>
- NSAutoreleasePool *filterContextPool = [[NSAutoreleasePool alloc] init];
- m_filterCIContext = HardRetain([CIContext contextWithCGContext:cgContext options:contextOptions]);
+ NSAutoreleasePool* filterContextPool = [[NSAutoreleasePool alloc] init];
+ m_filterCIContext = HardRetain([CIContext contextWithCGContext:cgContext options:nil]);
[filterContextPool drain];
m_filterCGLayer = [m_filterCIContext createCGLayerWithSize:CGRect(bbox).size info:NULL];
+ m_savedContext = context;
- KRenderingDeviceContext* filterContext = new KRenderingDeviceContextQuartz(CGLayerGetContext(m_filterCGLayer));
- renderingDevice()->pushContext(filterContext);
-
- filterContext->concatCTM(AffineTransform().translate(-1.0f * bbox.x(), -1.0f * bbox.y()));
+ context = new GraphicsContext(CGLayerGetContext(m_filterCGLayer));
+ context->save();
+ context->concatCTM(AffineTransform().translate(-1.0f * bbox.x(), -1.0f * bbox.y()));
}
-void SVGResourceFilter::applyFilter(const FloatRect &bbox)
+void SVGResourceFilter::applyFilter(GraphicsContext*& context, const FloatRect& bbox)
{
- if (bbox.isEmpty() || !KRenderingDeviceQuartz::filtersEnabled() || m_effects.isEmpty())
+ if (bbox.isEmpty() || m_effects.isEmpty())
return;
- // restore the previous context, delete the filter context.
- delete (renderingDevice()->popContext());
-
// actually apply the filter effects
- CIImage *inputImage = [CIImage imageWithCGLayer:m_filterCGLayer];
- NSArray *filterStack = getCIFilterStack(inputImage);
+ CIImage* inputImage = [CIImage imageWithCGLayer:m_filterCGLayer];
+ NSArray* filterStack = getCIFilterStack(inputImage);
if ([filterStack count]) {
- CIImage *outputImage = [[filterStack lastObject] valueForKey:@"outputImage"];
+ CIImage* outputImage = [[filterStack lastObject] valueForKey:@"outputImage"];
if (outputImage) {
CGRect filterRect = CGRect(filterBBoxForItemBBox(bbox));
CGRect translated = filterRect;
HardRelease(m_filterCIContext);
m_filterCIContext = 0;
+
+ delete context;
+ context = m_savedContext;
+ m_savedContext = 0;
}
NSArray* SVGResourceFilter::getCIFilterStack(CIImage* inputImage)
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
#include "config.h"
#ifdef SVG_SUPPORT
#import "SVGResourceImage.h"
#import "SVGRenderStyle.h"
-#import "KRenderingDeviceQuartz.h"
-#import "QuartzSupport.h"
+#import "GraphicsContext.h"
+#import "CgSupport.h"
#import <QuartzCore/CoreImage.h>
#import <QuartzCore/CIFilter.h>
return [multipliedGrayscale valueForKey:@"outputImage"];
}
-void SVGResourceMasker::applyMask(const FloatRect& boundingBox) const
+void SVGResourceMasker::applyMask(GraphicsContext* context, const FloatRect& boundingBox) const
{
if (!m_mask)
return;
[ciGrayscaleContext drawImage:grayscaleMask atPoint:CGPointZero fromRect:CGRectMake(0, 0, width, height)];
CGImageRef grayscaleImage = CGBitmapContextCreateImage(grayscaleContext);
- CGContextRef cgContext = static_cast<KRenderingDeviceQuartz*>(renderingDevice())->currentCGContext();
+ CGContextRef cgContext = context->platformContext();
CGContextClipToMask(cgContext, CGRectMake(0, 0, width, height), grayscaleImage);
-
+
CGImageRelease(grayscaleImage);
CGContextRelease(grayscaleContext);
fastFree(imageBuffer);
#include "Image.h"
#include "SVGFEHelpersCg.h"
-#include "QuartzSupport.h"
+#include "CgSupport.h"
namespace WebCore {
#ifdef SVG_SUPPORT
#include "SVGPaintServerLinearGradient.h"
-#include "KRenderingDeviceQt.h"
+#include "GraphicsContext.h"
#include "RenderPath.h"
#include <QLinearGradient>
+#include <QPainter>
+#include <QPainterPath>
namespace WebCore {
-bool SVGPaintServerLinearGradient::setup(KRenderingDeviceContext* context, const RenderObject* object, SVGPaintTargetType type) const
+bool SVGPaintServerLinearGradient::setup(GraphicsContext*& context, const RenderObject* object, SVGPaintTargetType type) const
{
- KRenderingDeviceContextQt* qtContext = static_cast<KRenderingDeviceContextQt*>(context);
- Q_ASSERT(qtContext != 0);
+ QPainter* painter(context ? context->platformContext() : 0);
+ Q_ASSERT(painter);
+
+ QPainterPath* path(context ? context->currentPath() : 0);
+ Q_ASSERT(path);
if (listener())
listener()->resourceNotification();
double x1, x2, y1, y2;
if (boundingBoxMode()) {
- QRectF bbox = qtContext->pathBBox();
+ QRectF bbox = path->boundingRect();
x1 = double(bbox.left()) + (double(gradientStart().x() / 100.0) * double(bbox.width()));
y1 = double(bbox.top()) + (double(gradientStart().y() / 100.0) * double(bbox.height()));
x2 = double(bbox.left()) + (double(gradientEnd().x() / 100.0) * double(bbox.width()));
y2 = gradientEnd().y();
}
- qtContext->painter().setPen(Qt::NoPen);
- qtContext->painter().setBrush(Qt::NoBrush);
+ painter->setPen(Qt::NoPen);
+ painter->setBrush(Qt::NoBrush);
QLinearGradient gradient(QPointF(x1, y1), QPointF(x2, y2));
if (spreadMethod() == SPREADMETHOD_REPEAT)
QBrush brush(gradient);
- qtContext->painter().setBrush(brush);
- qtContext->setFillRule(renderStyle->svgStyle()->fillRule());
+ painter->setBrush(brush);
+ context->setFillRule(renderStyle->svgStyle()->fillRule());
}
if ((type & ApplyToStrokeTargetType) && renderStyle->svgStyle()->hasStroke()) {
setPenProperties(object, renderStyle, pen);
pen.setBrush(brush);
- qtContext->painter().setPen(pen);
+ painter->setPen(pen);
}
return true;
namespace WebCore {
-bool SVGPaintServerPattern::setup(KRenderingDeviceContext* context, const RenderObject* object, SVGPaintTargetType type) const
+bool SVGPaintServerPattern::setup(GraphicsContext*& context, const RenderObject* object, SVGPaintTargetType type) const
{
// FIXME: Reactivate old pattern code
/*
- KRenderingDeviceContextQt* qtContext = static_cast<KRenderingDeviceContextQt*>(context);
- Q_ASSERT(qtContext != 0);
+ QPainter* painter(context ? context->platformContext() : 0);
+ Q_ASSERT(painter);
QPainterPath* _path = static_cast<QPainterPath*>(qtContext->path());
Q_ASSERT(_path != 0);
RenderStyle* renderStyle = object->style();
- qtContext->painter().setPen(Qt::NoPen);
- qtContext->painter().setBrush(Qt::NoBrush);
+ painter->setPen(Qt::NoPen);
+ painter->setBrush(Qt::NoBrush);
QImage* patternimage = new QImage(tile()->bits(), tile()->width(), tile()->height(), QImage::Format_ARGB32_Premultiplied);
patternimage->setAlphaBuffer(true);
if (type & APPLY_TO_FILL) {
KRenderingFillPainter fillPainter = KSVGPainterFactory::fillPainter(renderStyle, object);
QBrush brush(QPixmap::fromImage(*patternimage));
_path->setFillRule(fillPainter.fillRule() == RULE_EVENODD ? Qt::OddEvenFill : Qt::WindingFill);
- qtContext->painter().setBrush(brush);
+ painter->setBrush(brush);
}
if (type & APPLY_TO_STROKE) {
//QColor c = color();
setPenProperties(strokePainter, pen);
pen.setBrush(brush);
- qtContext->painter().setPen(pen);
+ painter->setPen(pen);
}
- qtContext->painter().drawPath(*_path);
+ painter->drawPath(*_path);
delete patternimage;
*/
#ifdef SVG_SUPPORT
#include "SVGPaintServer.h"
+#include "GraphicsContext.h"
#include "KCanvasRenderingStyle.h"
-#include "KRenderingDeviceQt.h"
#include "RenderPath.h"
-#include <QPen>
+#include <QPainter>
#include <QVector>
namespace WebCore {
}
}
-void SVGPaintServer::draw(KRenderingDeviceContext* context, const RenderPath* path, SVGPaintTargetType type) const
+void SVGPaintServer::draw(GraphicsContext*& context, const RenderPath* path, SVGPaintTargetType type) const
{
if (!setup(context, path, type))
return;
teardown(context, path, type);
}
-void SVGPaintServer::teardown(KRenderingDeviceContext*, const RenderObject*, SVGPaintTargetType) const
+void SVGPaintServer::teardown(GraphicsContext*&, const RenderObject*, SVGPaintTargetType) const
{
// no-op
}
-void SVGPaintServer::renderPath(KRenderingDeviceContext* context, const RenderPath* path, SVGPaintTargetType type) const
+void SVGPaintServer::renderPath(GraphicsContext*& context, const RenderPath* path, SVGPaintTargetType type) const
{
RenderStyle* renderStyle = path->style();
- KRenderingDeviceContextQt* qtContext = static_cast<KRenderingDeviceContextQt*>(context);
+
+ QPainter* painter(context ? context->platformContext() : 0);
+ Q_ASSERT(painter);
+
+ QPainterPath* painterPath(context ? context->currentPath() : 0);
+ Q_ASSERT(painterPath);
if ((type & ApplyToFillTargetType) && renderStyle->svgStyle()->hasFill())
- qtContext->fillPath();
+ painter->fillPath(*painterPath, painter->brush());
if ((type & ApplyToStrokeTargetType) && renderStyle->svgStyle()->hasStroke())
- qtContext->strokePath();
+ painter->strokePath(*painterPath, painter->pen());
}
} // namespace WebCore
#ifdef SVG_SUPPORT
#include "SVGPaintServerRadialGradient.h"
-#include "KRenderingDeviceQt.h"
+#include "GraphicsContext.h"
#include "RenderPath.h"
#include <math.h>
+#include <QPainter>
+#include <QPainterPath>
#include <QRadialGradient>
namespace WebCore {
-bool SVGPaintServerRadialGradient:: setup(KRenderingDeviceContext* context, const RenderObject* object, SVGPaintTargetType type) const
+bool SVGPaintServerRadialGradient:: setup(GraphicsContext*& context, const RenderObject* object, SVGPaintTargetType type) const
{
- KRenderingDeviceContextQt* qtContext = static_cast<KRenderingDeviceContextQt*>(context);
- Q_ASSERT(qtContext != 0);
+ QPainter* painter(context ? context->platformContext() : 0);
+ Q_ASSERT(painter);
+
+ QPainterPath* path(context ? context->currentPath() : 0);
+ Q_ASSERT(path);
if (listener())
listener()->resourceNotification();
RenderStyle* renderStyle = object->style();
- qtContext->painter().setPen(Qt::NoPen);
- qtContext->painter().setBrush(Qt::NoBrush);
- QMatrix mat = qtContext->ctm();
+ painter->setPen(Qt::NoPen);
+ painter->setBrush(Qt::NoBrush);
+ QMatrix mat = painter->matrix();
double cx, fx, cy, fy, r;
if (boundingBoxMode()) {
- QRectF bbox = qtContext->pathBBox();
+ QRectF bbox = path->boundingRect();
cx = double(bbox.left()) + (double(gradientCenter().x() / 100.0) * double(bbox.width()));
cy = double(bbox.top()) + (double(gradientCenter().y() / 100.0) * double(bbox.height()));
fx = double(bbox.left()) + (double(gradientFocal().x() / 100.0) * double(bbox.width())) - cx;
// AffineTransform gradientTrans = gradientTransform();
// gradientTrans.map(cx, cy, &cx, &cy);
- // qtContext->painter().setMatrix(mat);
+ // painter->setMatrix(mat);
if ((type & ApplyToFillTargetType) && renderStyle->svgStyle()->hasFill()) {
fillColorArray(gradient, gradientStops(), opacity);
QBrush brush(gradient);
- qtContext->painter().setBrush(brush);
- qtContext->setFillRule(renderStyle->svgStyle()->fillRule());
+ painter->setBrush(brush);
+ context->setFillRule(renderStyle->svgStyle()->fillRule());
}
if ((type & ApplyToStrokeTargetType) && renderStyle->svgStyle()->hasStroke()) {
setPenProperties(object, renderStyle, pen);
pen.setBrush(brush);
- qtContext->painter().setPen(pen);
+ painter->setPen(pen);
}
return true;
#ifdef SVG_SUPPORT
#include "SVGPaintServerSolid.h"
-#include "KRenderingDeviceQt.h"
+#include "GraphicsContext.h"
#include "RenderPath.h"
+#include <QPainter>
+
namespace WebCore {
-bool SVGPaintServerSolid::setup(KRenderingDeviceContext* context, const RenderObject* object, SVGPaintTargetType type) const
+bool SVGPaintServerSolid::setup(GraphicsContext*& context, const RenderObject* object, SVGPaintTargetType type) const
{
- KRenderingDeviceContextQt* qtContext = static_cast<KRenderingDeviceContextQt*>(context);
+ QPainter* painter(context ? context->platformContext() : 0);
+ Q_ASSERT(painter);
RenderStyle* renderStyle = object->style();
- // TODO? qtContext->painter().setOpacity(renderStyle->opacity());
+ // TODO? painter->setOpacity(renderStyle->opacity());
QColor c = color();
c.setAlphaF(renderStyle->svgStyle()->fillOpacity());
QBrush brush(c);
- qtContext->painter().setBrush(brush);
- qtContext->setFillRule(renderStyle->svgStyle()->fillRule());
+ painter->setBrush(brush);
+ context->setFillRule(renderStyle->svgStyle()->fillRule());
/* if(isPaintingText()) ... */
}
QPen pen(c);
setPenProperties(object, renderStyle, pen);
- qtContext->painter().setPen(pen);
+ painter->setPen(pen);
/* if(isPaintingText()) ... */
}
*/
#include "config.h"
-#include "SVGResourceClipper.h"
#ifdef SVG_SUPPORT
+#include "SVGResourceClipper.h"
-#include "KRenderingDeviceQt.h"
+#include "GraphicsContext.h"
+
+#include <QPainter>
+#include <QPainterPath>
namespace WebCore {
-void SVGResourceClipper::applyClip(const FloatRect& boundingBox) const
+void SVGResourceClipper::applyClip(GraphicsContext* context, const FloatRect& boundingBox) const
{
- KRenderingDeviceContext* context = renderingDevice()->currentContext();
- KRenderingDeviceContextQt* qtContext = static_cast<KRenderingDeviceContextQt*>(context);
if (m_clipData.clipData().size() < 1)
return;
- context->clearPath();
+ context->beginPath();
QPainterPath newPath;
// }
}
- qtContext->painter().setClipPath(newPath);
+ QPainter* painter(context ? context->platformContext() : 0);
+ Q_ASSERT(painter);
+
+ painter->setClipPath(newPath);
}
} // namespace WebCore
*/
#include "config.h"
-#include "SVGResourceFilter.h"
#ifdef SVG_SUPPORT
+#include "SVGResourceFilter.h"
namespace WebCore {
{
}
-void SVGResourceFilter::prepareFilter(const FloatRect& bbox)
+SVGFilterEffect* SVGResourceFilter::createFilterEffect(const SVGFilterEffectType&)
+{
+ // FIXME: implement me :-)
+ return 0;
+}
+
+void SVGResourceFilter::prepareFilter(GraphicsContext*&, const FloatRect&)
{
// FIXME: implement me :-)
}
-void SVGResourceFilter::applyFilter(const FloatRect& bbox)
+void SVGResourceFilter::applyFilter(GraphicsContext*&, const FloatRect&)
{
// FIXME: implement me :-)
}
*/
#include "config.h"
-#include "SVGResourceMasker.h"
#ifdef SVG_SUPPORT
+#include "SVGResourceMasker.h"
namespace WebCore {
-void SVGResourceMasker::applyMask(const FloatRect& boundingBox) const
+void SVGResourceMasker::applyMask(GraphicsContext*, const FloatRect&) const
{
// FIXME: implement me :-)
}
#import "config.h"
#import "GraphicsContext.h"
+#import "SVGResourceImage.h"
#import "../graphics/cg/GraphicsContextPlatformPrivate.h"
CGContextRestoreGState(context);
}
+GraphicsContext* contextForImage(SVGResourceImage* image)
+{
+ CGLayerRef cgLayer = image->cgLayer();
+
+ // FIXME: Using currentContext / graphicsPort here is a TOTAL hack. See SVGMaskElement comment for a possible solution!
+ CGContextRef currentContext = (CGContextRef) [[NSGraphicsContext currentContext] graphicsPort];
+
+ if (!cgLayer) {
+ ASSERT(currentContext);
+
+ // FIXME: we might not get back a layer if this is a loaded image
+ // maybe this logic should go into SVGResourceImage?
+ cgLayer = CGLayerCreateWithContext(currentContext, CGSize(image->size() + IntSize(1,1)), NULL); // FIXME + 1 is a hack
+ // FIXME: we should composite the original image onto the layer...
+ image->setCGLayer(cgLayer);
+ CGLayerRelease(cgLayer);
+ }
+ return new GraphicsContext(CGLayerGetContext(cgLayer));
+}
+
}
#define M_PI 3.14159265358979323846
#endif
-#ifdef SVG_SUPPORT
-#include "KRenderingDeviceQt.h"
-#endif
-
#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d\n", __FILE__, __LINE__); } while(0)
namespace WebCore {
IntRect focusRingClip;
TextShadow shadow;
+ // Only used by SVG for now.
+ QPainterPath currentPath;
+
private:
QPainter* painter;
};
m_data->p().fillRect(rect, QColor(c));
}
+void GraphicsContext::beginPath()
+{
+ m_data->currentPath = QPainterPath();
+}
+
+void GraphicsContext::addPath(const Path& path)
+{
+ m_data->currentPath = *(path.platformPath());
+}
+
+void GraphicsContext::setFillRule(WindRule rule)
+{
+ m_data->currentPath.setFillRule(rule == RULE_EVENODD ? Qt::OddEvenFill : Qt::WindingFill);
+}
+
+PlatformPath* GraphicsContext::currentPath()
+{
+ return &m_data->currentPath;
+}
+
void GraphicsContext::clip(const IntRect& rect)
{
if (paintingDisabled())
if (paintingDisabled())
return;
- QPainterPath path; path.addRect(rect);
+ QPainterPath path;
+ path.addRect(rect);
QPen nPen = m_data->p().pen();
nPen.setWidthF(width);
m_data->p().strokePath(path, nPen);
m_data->p().setBrush(QBrush(color));
}
-#ifdef SVG_SUPPORT
-KRenderingDeviceContext* GraphicsContext::createRenderingDeviceContext()
+GraphicsContext* contextForImage(SVGResourceImage*)
{
- return new KRenderingDeviceContextQt(platformContext());
-}
-#endif
-
+ // FIXME!
+ return 0;
}
// vim: ts=4 sw=4 et
#include "RenderForeignObject.h"
#include "GraphicsContext.h"
-#include "KRenderingDevice.h"
#include "SVGForeignObjectElement.h"
#include "SVGLength.h"
if (paintInfo.context->paintingDisabled())
return;
- KRenderingDevice* device = renderingDevice();
- KRenderingDeviceContext* context = device->currentContext();
- bool shouldPopContext = false;
- if (!context) {
- // Only need to setup for KCanvas rendering if it hasn't already been done.
- context = paintInfo.context->createRenderingDeviceContext();
- device->pushContext(context);
- shouldPopContext = true;
- }
-
paintInfo.context->save();
-
- context->concatCTM(AffineTransform().translate(parentX, parentY));
- context->concatCTM(localTransform());
- context->concatCTM(translationForAttributes());
-
+ paintInfo.context->concatCTM(AffineTransform().translate(parentX, parentY));
+ paintInfo.context->concatCTM(localTransform());
+ paintInfo.context->concatCTM(translationForAttributes());
paintInfo.context->clip(getClipRect(parentX, parentY));
float opacity = style()->opacity();
if (opacity < 1.0f)
paintInfo.context->endTransparencyLayer();
- if (shouldPopContext) {
- device->popContext();
- delete context;
- }
-
paintInfo.context->restore();
}
#include "GraphicsContext.h"
#include "RenderSVGContainer.h"
+#include "SVGPaintServer.h"
#include "SVGResourceClipper.h"
#include "SVGResourceFilter.h"
#include "SVGResourceMasker.h"
#include "SVGResourceMarker.h"
#include "KCanvasRenderingStyle.h"
-#include "KRenderingDevice.h"
#include "SVGStyledElement.h"
-#include <wtf/OwnPtr.h>
#include <wtf/MathExtras.h>
namespace WebCore {
if (paintInfo.context->paintingDisabled() || (paintInfo.phase != PaintPhaseForeground) || style()->visibility() == HIDDEN || path().isEmpty())
return;
-
- KRenderingDevice* device = renderingDevice();
- KRenderingDeviceContext* context = device->currentContext();
- bool shouldPopContext = false;
- if (context)
- paintInfo.context->save();
- else {
- // Need to set up KCanvas rendering if it hasn't already been done.
- context = paintInfo.context->createRenderingDeviceContext();
- device->pushContext(context);
- shouldPopContext = true;
- }
- context->concatCTM(localTransform());
+ paintInfo.context->save();
+ paintInfo.context->concatCTM(localTransform());
// setup to apply filters
SVGResourceFilter* filter = getFilterById(document(), style()->svgStyle()->filter().substring(1));
- if (filter) {
- filter->prepareFilter(relativeBBox(true));
- context = device->currentContext();
- }
+ if (filter)
+ filter->prepareFilter(paintInfo.context, relativeBBox(true));
if (SVGResourceClipper* clipper = getClipperById(document(), style()->svgStyle()->clipPath().substring(1)))
- clipper->applyClip(relativeBBox(true));
+ clipper->applyClip(paintInfo.context, relativeBBox(true));
if (SVGResourceMasker* masker = getMaskerById(document(), style()->svgStyle()->maskElement().substring(1)))
- masker->applyMask(relativeBBox(true));
+ masker->applyMask(paintInfo.context, relativeBBox(true));
- context->clearPath();
+ paintInfo.context->beginPath();
SVGPaintServer* fillPaintServer = KSVGPainterFactory::fillPaintServer(style(), this);
if (fillPaintServer) {
- context->addPath(path());
+ paintInfo.context->addPath(path());
fillPaintServer->setActiveClient(this);
- fillPaintServer->draw(context, this, ApplyToFillTargetType);
+ fillPaintServer->draw(paintInfo.context, this, ApplyToFillTargetType);
}
SVGPaintServer* strokePaintServer = KSVGPainterFactory::strokePaintServer(style(), this);
if (strokePaintServer) {
- context->addPath(path()); // path is cleared when filled.
+ paintInfo.context->addPath(path()); // path is cleared when filled.
strokePaintServer->setActiveClient(this);
- strokePaintServer->draw(context, this, ApplyToStrokeTargetType);
+ strokePaintServer->draw(paintInfo.context, this, ApplyToStrokeTargetType);
}
drawMarkersIfNeeded(paintInfo.context, paintInfo.rect, path());
// actually apply the filter
if (filter)
- filter->applyFilter(relativeBBox(true));
-
- // restore drawing state
- if (!shouldPopContext)
- paintInfo.context->restore();
- else {
- device->popContext();
- delete context;
- }
+ filter->applyFilter(paintInfo.context, relativeBBox(true));
+
+ paintInfo.context->restore();
}
void RenderPath::absoluteRects(Vector<IntRect>& rects, int _tx, int _ty)
#include "SVGResourceClipper.h"
#include "SVGResourceFilter.h"
#include "SVGResourceMasker.h"
-#include "KRenderingDevice.h"
#include "SVGStyledElement.h"
#include "GraphicsContext.h"
#include "SVGLength.h"
if (!firstChild() && !filter)
return; // Spec: groups w/o children still may render filter content.
- KRenderingDevice* device = renderingDevice();
- KRenderingDeviceContext* deviceContext = device->currentContext();
- bool shouldPopContext = false;
- if (!deviceContext) {
- // I only need to setup for KCanvas rendering if it hasn't already been done.
- deviceContext = paintInfo.context->createRenderingDeviceContext();
- device->pushContext(deviceContext);
- shouldPopContext = true;
- } else
- paintInfo.context->save();
+ paintInfo.context->save();
if (parentX != 0 || parentY != 0) {
// Translate from parent offsets (html renderers) to a relative transform (svg renderers)
- deviceContext->concatCTM(AffineTransform().translate(parentX, parentY));
+ paintInfo.context->concatCTM(AffineTransform().translate(parentX, parentY));
parentX = parentY = 0;
}
if (!viewport().isEmpty()) {
if (style()->overflowX() != OVISIBLE)
paintInfo.context->clip(enclosingIntRect(viewport())); // FIXME: Eventually we'll want float-precision clipping
- deviceContext->concatCTM(AffineTransform().translate(viewport().x(), viewport().y()));
+
+ paintInfo.context->concatCTM(AffineTransform().translate(viewport().x(), viewport().y()));
}
if (!localTransform().isIdentity())
- deviceContext->concatCTM(localTransform());
+ paintInfo.context->concatCTM(localTransform());
FloatRect strokeBBox = relativeBBox(true);
- if (SVGResourceClipper *clipper = getClipperById(document(), style()->svgStyle()->clipPath().substring(1)))
- clipper->applyClip(strokeBBox);
+ if (SVGResourceClipper* clipper = getClipperById(document(), style()->svgStyle()->clipPath().substring(1)))
+ clipper->applyClip(paintInfo.context, strokeBBox);
- if (SVGResourceMasker *masker = getMaskerById(document(), style()->svgStyle()->maskElement().substring(1)))
- masker->applyMask(strokeBBox);
+ if (SVGResourceMasker* masker = getMaskerById(document(), style()->svgStyle()->maskElement().substring(1)))
+ masker->applyMask(paintInfo.context, strokeBBox);
float opacity = style()->opacity();
if (opacity < 1.0f) {
}
if (filter)
- filter->prepareFilter(strokeBBox);
-
+ filter->prepareFilter(paintInfo.context, strokeBBox);
+
if (!viewBox().isEmpty())
- deviceContext->concatCTM(viewportTransform());
+ paintInfo.context->concatCTM(viewportTransform());
RenderContainer::paint(paintInfo, 0, 0);
if (filter)
- filter->applyFilter(strokeBBox);
+ filter->applyFilter(paintInfo.context, strokeBBox);
if (opacity < 1.0f)
paintInfo.context->endTransparencyLayer();
- // restore drawing state
- if (shouldPopContext) {
- device->popContext();
- delete deviceContext;
- } else
- paintInfo.context->restore();
+ paintInfo.context->restore();
}
FloatRect RenderSVGContainer::viewport() const
#include "SVGResourceClipper.h"
#include "SVGResourceFilter.h"
#include "SVGResourceMasker.h"
-#include "KRenderingDevice.h"
#include "SVGLength.h"
#include "SVGPreserveAspectRatio.h"
#include "SVGImageElement.h"
#include "SVGImageElement.h"
-#include <wtf/OwnPtr.h>
namespace WebCore {
if (paintInfo.context->paintingDisabled() || (paintInfo.phase != PaintPhaseForeground) || style()->visibility() == HIDDEN)
return;
- KRenderingDevice* device = renderingDevice();
- KRenderingDeviceContext* context = device->currentContext();
- bool shouldPopContext = false;
- if (context)
- paintInfo.context->save();
- else {
- // Need to push a device context on the stack if empty.
- context = paintInfo.context->createRenderingDeviceContext();
- device->pushContext(context);
- shouldPopContext = true;
- }
+ paintInfo.context->save();
+ paintInfo.context->concatCTM(AffineTransform().translate(parentX, parentY));
+ paintInfo.context->concatCTM(localTransform());
+ paintInfo.context->concatCTM(translationForAttributes());
- context->concatCTM(AffineTransform().translate(parentX, parentY));
- context->concatCTM(localTransform());
- translateForAttributes();
-
FloatRect boundingBox = FloatRect(0, 0, width(), height());
const SVGRenderStyle* svgStyle = style()->svgStyle();
if (SVGResourceClipper* clipper = getClipperById(document(), svgStyle->clipPath().substring(1)))
- clipper->applyClip(boundingBox);
+ clipper->applyClip(paintInfo.context, boundingBox);
if (SVGResourceMasker* masker = getMaskerById(document(), svgStyle->maskElement().substring(1)))
- masker->applyMask(boundingBox);
+ masker->applyMask(paintInfo.context, boundingBox);
SVGResourceFilter* filter = getFilterById(document(), svgStyle->filter().substring(1));
if (filter)
- filter->prepareFilter(boundingBox);
-
- OwnPtr<GraphicsContext> c(device->currentContext()->createGraphicsContext());
+ filter->prepareFilter(paintInfo.context, boundingBox);
float opacity = style()->opacity();
if (opacity < 1.0f) {
- c->clip(enclosingIntRect(boundingBox));
- c->beginTransparencyLayer(opacity);
+ paintInfo.context->clip(enclosingIntRect(boundingBox));
+ paintInfo.context->beginTransparencyLayer(opacity);
}
PaintInfo pi(paintInfo);
- pi.context = c.get();
- pi.rect = absoluteTransform().invert().mapRect(paintInfo.rect);
+ pi.rect = absoluteTransform().invert().mapRect(pi.rect);
int x = 0, y = 0;
if (shouldPaint(pi, x, y)) {
FloatRect destRect(m_x, m_y, contentWidth(), contentHeight());
FloatRect srcRect(0, 0, image()->width(), image()->height());
adjustRectsForAspectRatio(destRect, srcRect, imageElt->preserveAspectRatio());
- c->drawImage(image(), destRect, srcRect);
+ paintInfo.context->drawImage(image(), destRect, srcRect);
}
-
- if (filter)
- filter->applyFilter(boundingBox);
}
-
+
+ if (filter)
+ filter->applyFilter(paintInfo.context, boundingBox);
+
if (opacity < 1.0f)
- c->endTransparencyLayer();
-
- // restore drawing state
- if (!shouldPopContext)
- paintInfo.context->restore();
- else {
- device->popContext();
- delete context;
- }
+ paintInfo.context->endTransparencyLayer();
+
+ paintInfo.context->restore();
}
void RenderSVGImage::computeAbsoluteRepaintRect(IntRect& r, bool f)
return AffineTransform().translate(image->x()->value(), image->y()->value());
}
-void RenderSVGImage::translateForAttributes()
-{
- KRenderingDeviceContext* context = renderingDevice()->currentContext();
- context->concatCTM(translationForAttributes());
-}
-
}
#endif // SVG_SUPPORT
virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int _x, int _y, int _tx, int _ty, HitTestAction);
private:
- void translateForAttributes();
AffineTransform translationForAttributes();
AffineTransform m_transform;
IntRect m_absoluteBounds;
*/
#include "config.h"
+
#ifdef SVG_SUPPORT
#include "RenderSVGInline.h"
#include "SVGInlineFlowBox.h"
namespace WebCore {
-RenderSVGInline::RenderSVGInline(Node* n) : RenderInline(n) {}
-
+RenderSVGInline::RenderSVGInline(Node* n) : RenderInline(n)
+{
+}
+
InlineBox* RenderSVGInline::createInlineBox(bool makePlaceHolderBox, bool isRootLineBox, bool isOnlyRun)
{
- assert(!(!isRootLineBox && (isReplaced() || makePlaceHolderBox)));
- assert(isInlineFlow());
+ ASSERT(!(!isRootLineBox && (isReplaced() || makePlaceHolderBox)));
+ ASSERT(isInlineFlow());
+
InlineFlowBox* flowBox = new (renderArena()) SVGInlineFlowBox(this);
+
if (!m_firstLineBox)
m_firstLineBox = m_lastLineBox = flowBox;
else {
#include "GraphicsContext.h"
#include "KCanvasRenderingStyle.h"
-#include "KRenderingDevice.h"
#include "AffineTransform.h"
namespace WebCore {
RenderSVGInlineText::RenderSVGInlineText(Node* n, StringImpl* str)
- : RenderText(n, str) {}
+ : RenderText(n, str)
+{
+}
void RenderSVGInlineText::absoluteRects(Vector<IntRect>& rects, int tx, int ty)
{
*/
#include "config.h"
+
#ifdef SVG_SUPPORT
#include "RenderSVGTSpan.h"
#include "GraphicsContext.h"
#include "KCanvasRenderingStyle.h"
-#include "KRenderingDevice.h"
#include "SVGRootInlineBox.h"
#include "SVGInlineFlowBox.h"
#include "AffineTransform.h"
#include "SVGLengthList.h"
namespace WebCore {
-
-RenderSVGTSpan::RenderSVGTSpan(Node* n) : RenderSVGInline(n) {}
+
+RenderSVGTSpan::RenderSVGTSpan(Node* n) : RenderSVGInline(n)
+{
+}
void RenderSVGTSpan::absoluteRects(Vector<IntRect>& rects, int tx, int ty)
{
*/
#include "config.h"
+
#ifdef SVG_SUPPORT
#include "RenderSVGText.h"
#include "GraphicsContext.h"
#include "KCanvasRenderingStyle.h"
-#include "KRenderingDevice.h"
#include "SVGLengthList.h"
#include "SVGTextElement.h"
#include "SVGRootInlineBox.h"
+
#include <wtf/OwnPtr.h>
namespace WebCore {
}
void RenderSVGText::paint(PaintInfo& paintInfo, int tx, int ty)
-{
- KRenderingDevice* device = renderingDevice();
- RenderObject::PaintInfo pi = paintInfo;
- OwnPtr<GraphicsContext> c(device->currentContext()->createGraphicsContext());
- pi.context = c.get();
- pi.rect = (absoluteTransform()).invert().mapRect(paintInfo.rect);
+{
+ RenderObject::PaintInfo pi(paintInfo);
+ pi.rect = (absoluteTransform()).invert().mapRect(pi.rect);
RenderBlock::paint(pi, tx, ty);
}
#include "config.h"
#ifdef SVG_SUPPORT
-
#include "SVGInlineFlowBox.h"
#include "GraphicsContext.h"
#include "SVGResourceClipper.h"
#include "SVGResourceFilter.h"
#include "SVGResourceMasker.h"
+#include "SVGPaintServer.h"
#include "KCanvasRenderingStyle.h"
-#include "KRenderingDevice.h"
#include "RootInlineBox.h"
#include "SVGLengthList.h"
#include "SVGTextPositioningElement.h"
-#include <wtf/OwnPtr.h>
using namespace std;
if (paintInfo.context->paintingDisabled())
return;
- KRenderingDevice* device = renderingDevice();
- KRenderingDeviceContext* context = device->currentContext();
- bool shouldPopContext = false;
- if (context)
- paintInfo.context->save();
- else {
- // Need to set up KCanvas rendering if it hasn't already been done.
- context = paintInfo.context->createRenderingDeviceContext();
- device->pushContext(context);
- shouldPopContext = true;
- }
-
- context->concatCTM(object->localTransform());
+ paintInfo.context->save();
+ paintInfo.context->concatCTM(object->localTransform());
FloatRect boundingBox(tx + flow->xPos(), ty + flow->yPos(), flow->width(), flow->height());
const SVGRenderStyle* svgStyle = object->style()->svgStyle();
if (SVGResourceClipper* clipper = getClipperById(object->document(), svgStyle->clipPath().substring(1)))
- clipper->applyClip(boundingBox);
+ clipper->applyClip(paintInfo.context, boundingBox);
if (SVGResourceMasker* masker = getMaskerById(object->document(), svgStyle->maskElement().substring(1)))
- masker->applyMask(boundingBox);
+ masker->applyMask(paintInfo.context, boundingBox);
SVGResourceFilter* filter = getFilterById(object->document(), svgStyle->filter().substring(1));
if (filter)
- filter->prepareFilter(boundingBox);
+ filter->prepareFilter(paintInfo.context, boundingBox);
- RenderObject::PaintInfo pi = paintInfo;
- OwnPtr<GraphicsContext> c(device->currentContext()->createGraphicsContext());
- pi.context = c.get();
+ RenderObject::PaintInfo pi(paintInfo);
+
if (!flow->isRootInlineBox())
- pi.rect = (object->localTransform()).invert().mapRect(paintInfo.rect);
+ pi.rect = (object->localTransform()).invert().mapRect(pi.rect);
float opacity = object->style()->opacity();
if (opacity < 1.0f) {
- c->clip(enclosingIntRect(boundingBox));
- c->beginTransparencyLayer(opacity);
+ paintInfo.context->clip(enclosingIntRect(boundingBox));
+ paintInfo.context->beginTransparencyLayer(opacity);
}
SVGPaintServer* fillPaintServer = KSVGPainterFactory::fillPaintServer(object->style(), object);
if (fillPaintServer) {
fillPaintServer->setPaintingText(true);
- if (fillPaintServer->setup(context, object, ApplyToFillTargetType)) {
+ if (fillPaintServer->setup(pi.context, object, ApplyToFillTargetType)) {
flow->InlineFlowBox::paint(pi, tx, ty);
- fillPaintServer->teardown(context, object, ApplyToFillTargetType);
+ fillPaintServer->teardown(pi.context, object, ApplyToFillTargetType);
}
fillPaintServer->setPaintingText(false);
}
SVGPaintServer* strokePaintServer = KSVGPainterFactory::strokePaintServer(object->style(), object);
if (strokePaintServer) {
strokePaintServer->setPaintingText(true);
- if (strokePaintServer->setup(context, object, ApplyToStrokeTargetType)) {
+ if (strokePaintServer->setup(pi.context, object, ApplyToStrokeTargetType)) {
flow->InlineFlowBox::paint(pi, tx, ty);
- strokePaintServer->teardown(context, object, ApplyToStrokeTargetType);
+ strokePaintServer->teardown(pi.context, object, ApplyToStrokeTargetType);
}
strokePaintServer->setPaintingText(false);
}
if (filter)
- filter->applyFilter(boundingBox);
+ filter->applyFilter(paintInfo.context, boundingBox);
if (opacity < 1.0f)
- c->endTransparencyLayer();
+ paintInfo.context->endTransparencyLayer();
- // restore drawing state
- if (!shouldPopContext)
- paintInfo.context->restore();
- else {
- device->popContext();
- delete context;
- }
+ paintInfo.context->restore();
}
static bool translateBox(InlineBox* box, int x, int y, bool topLevel = true)
#include "HTMLNames.h"
#include "RenderTreeAsText.h"
#include "RenderSVGContainer.h"
-#include "KRenderingDevice.h"
#include "SVGPaintServerGradient.h"
#include "SVGPaintServerPattern.h"
#include "SVGPaintServerSolid.h"
if (strokePaintServer) {
TextStreamSeparator s(" ");
ts << " [stroke={";
- if (strokePaintServer) {
- if (!strokePaintServer->idInRegistry().isEmpty())
- ts << s << "[id=\""<< strokePaintServer->idInRegistry() << "\"]";
- else
- ts << s << *strokePaintServer;
- }
+ if (strokePaintServer)
+ ts << s << *strokePaintServer;
double dashOffset = KSVGPainterFactory::cssPrimitiveToLength(&path, svgStyle->strokeDashOffset(), 0.0);
const KCDashArray& dashArray = KSVGPainterFactory::dashArrayFromRenderingStyle(style);
if (fillPaintServer) {
TextStreamSeparator s(" ");
ts << " [fill={";
- if (fillPaintServer) {
- if (!fillPaintServer->idInRegistry().isEmpty())
- ts << s << "[id=\"" << fillPaintServer->idInRegistry() << "\"]";
- else
- ts << s << *fillPaintServer;
- }
-
+ if (fillPaintServer)
+ ts << s << *fillPaintServer;
+
if (style->svgStyle()->fillOpacity() != 1.0f)
ts << s << "[opacity=" << style->svgStyle()->fillOpacity() << "]";
if (style->svgStyle()->fillRule() != RULE_NONZERO)