Reviewed by Sam. Previous attempts reviewed by Oliver & Eric.
authorzimmermann <zimmermann@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Dec 2006 14:51:13 +0000 (14:51 +0000)
committerzimmermann <zimmermann@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Dec 2006 14:51:13 +0000 (14:51 +0000)
commit8502c1a0544b29a8031cbae2d1970aa9fa711064
treea2f5d77e0639705bb1507702f1b23ac0f796d3d3
parentbb2e0a12e4582519069602b7a900e87cd3cc06a2
Reviewed by Sam. Previous attempts reviewed by Oliver & Eric.

Fixes: http://bugs.webkit.org/show_bug.cgi?id=11867
Bring back masking, by adding off-screen rendering functionality in GraphicsContext.
Add new "static GraphicsContext* createImageContext(const IntSize& size, bool grayScale)"
function, and implement it with CGBitmapContext in the GraphicsContextCG (stubs for Qt.)

Mask image sizes are dynamically calculated using the passed bounding box in applyMask,
as it was orignally planned. Gradient stroke mask image sizes aren't hardcoded to 2048x2048
anymore, but are as well dynamically calculated using getAbsoluteRepaintRect().

Add new ImageBuffer class encapsulating the size of the image, a platform-specific
handle (ie. CGImageRef for CG platform) plus the GraphicsContext pointer, obtained
via GraphicsContext::createImageBuffer. Offer a generic logic for rendering subtrees
of the rendering tree into a ImageBuffer (see renderSubtreeToImage function)
ImageBufferCG is completly implemented, ImageBufferQt is stubbed.

Also add correct default values for x/y/width/height of <mask>.
Fixes masking related LayoutTests, and speeds up gradient-on-stroke a lot.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@18315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
32 files changed:
LayoutTests/ChangeLog
LayoutTests/svg/W3C-SVG-1.1/masking-mask-01-b-expected.png
LayoutTests/svg/W3C-SVG-1.1/pservers-grad-06-b-expected.png
LayoutTests/svg/custom/grayscale-gradient-mask-expected.png
LayoutTests/svg/custom/mask-inside-defs-expected.png
WebCore/CMakeLists.txt
WebCore/ChangeLog
WebCore/WebCore.pro
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/ksvg2/svg/SVGFEImageElement.cpp
WebCore/ksvg2/svg/SVGImageElement.cpp
WebCore/ksvg2/svg/SVGMaskElement.cpp
WebCore/ksvg2/svg/SVGMaskElement.h
WebCore/ksvg2/svg/SVGPatternElement.cpp
WebCore/ksvg2/svg/SVGPatternElement.h
WebCore/platform/graphics/GraphicsContext.h
WebCore/platform/graphics/ImageBuffer.cpp [new file with mode: 0644]
WebCore/platform/graphics/ImageBuffer.h [moved from WebCore/platform/graphics/svg/SVGResourceImage.h with 71% similarity]
WebCore/platform/graphics/cg/GraphicsContextCG.cpp
WebCore/platform/graphics/cg/ImageBufferCG.cpp [new file with mode: 0644]
WebCore/platform/graphics/mac/GraphicsContextMac.mm
WebCore/platform/graphics/qt/GraphicsContextQt.cpp
WebCore/platform/graphics/qt/ImageBufferQt.cpp [moved from WebCore/platform/graphics/svg/cg/SVGResourceImageCg.cpp with 64% similarity]
WebCore/platform/graphics/svg/SVGPaintServerGradient.h
WebCore/platform/graphics/svg/SVGPaintServerPattern.cpp
WebCore/platform/graphics/svg/SVGPaintServerPattern.h
WebCore/platform/graphics/svg/SVGResourceMasker.cpp
WebCore/platform/graphics/svg/SVGResourceMasker.h
WebCore/platform/graphics/svg/cg/SVGPaintServerGradientCg.cpp
WebCore/platform/graphics/svg/cg/SVGPaintServerPatternCg.cpp
WebCore/platform/graphics/svg/cg/SVGResourceMaskerCg.mm
WebCore/platform/graphics/svg/qt/SVGResourceImageQt.cpp [deleted file]