Changeset 26595 in webkit
- Timestamp:
- Oct 14, 2007 10:45:09 AM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 1 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r26591 r26595 1 2007-10-14 Nikolas Zimmermann <zimmermann@kde.org> 2 3 Reviewed by Eric. 4 5 Fix bad abstraction in ImageBuffer class. 6 While the class itself is platform-aware and thus it's location in platform/graphics 7 is fine, it contains the "renderSubtreeToImage" method which operates on RenderObject. 8 9 As it's SVG specific I decided to move this method into SVGRenderSupport, to avoid 10 implicit platform/ <-> rendering/ dependencies. 11 12 * WebCore.pro: 13 * WebCore.vcproj/WebCore.vcproj: 14 * WebCore.xcodeproj/project.pbxproj: 15 * ksvg2/svg/SVGMaskElement.cpp: 16 (WebCore::SVGMaskElement::drawMaskerContent): 17 * ksvg2/svg/SVGPatternElement.cpp: 18 (WebCore::SVGPatternElement::buildPattern): 19 * platform/graphics/ImageBuffer.cpp: Removed. 20 * platform/graphics/ImageBuffer.h: 21 (WebCore::ImageBuffer::size): 22 * platform/graphics/svg/SVGImage.cpp: 23 (WebCore::SVGImage::nativeImageForCurrentFrame): 24 * rendering/SVGRenderSupport.cpp: 25 (WebCore::renderSubtreeToImage): 26 * rendering/SVGRenderSupport.h: 27 1 28 2007-10-14 Peter Kasting <zerodpx@gmail.com> 2 29 -
trunk/WebCore/WebCore.pro
r26545 r26595 640 640 platform/graphics/GraphicsContext.cpp \ 641 641 platform/graphics/GraphicsTypes.cpp \ 642 platform/graphics/ImageBuffer.cpp \643 642 platform/graphics/Image.cpp \ 644 643 platform/graphics/IntRect.cpp \ -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r26569 r26595 3867 3867 <File 3868 3868 RelativePath="..\platform\graphics\Image.h" 3869 >3870 </File>3871 <File3872 RelativePath="..\platform\graphics\ImageBuffer.cpp"3873 3869 > 3874 3870 </File> -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r26558 r26595 2772 2772 B2310B770B1F46A200D55D87 /* CgSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = B2310B740B1F46A200D55D87 /* CgSupport.h */; }; 2773 2773 B2310B780B1F46A300D55D87 /* RenderPathCg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2310B750B1F46A200D55D87 /* RenderPathCg.cpp */; }; 2774 B23BCCE50B3829C9005B2415 /* ImageBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B23BCCE40B3829C9005B2415 /* ImageBuffer.cpp */; };2775 2774 B24055650B5BE640002A28C0 /* DOMSVGElementInstanceInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = B24055630B5BE640002A28C0 /* DOMSVGElementInstanceInternal.h */; }; 2776 2775 B24055660B5BE640002A28C0 /* DOMSVGElementInstanceListInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = B24055640B5BE640002A28C0 /* DOMSVGElementInstanceListInternal.h */; }; … … 6476 6475 B2310B740B1F46A200D55D87 /* CgSupport.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CgSupport.h; sourceTree = "<group>"; }; 6477 6476 B2310B750B1F46A200D55D87 /* RenderPathCg.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderPathCg.cpp; sourceTree = "<group>"; }; 6478 B23BCCE40B3829C9005B2415 /* ImageBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ImageBuffer.cpp; sourceTree = "<group>"; };6479 6477 B24055630B5BE640002A28C0 /* DOMSVGElementInstanceInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMSVGElementInstanceInternal.h; sourceTree = "<group>"; }; 6480 6478 B24055640B5BE640002A28C0 /* DOMSVGElementInstanceListInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMSVGElementInstanceListInternal.h; sourceTree = "<group>"; }; … … 10373 10371 B27535410B053814002CE64F /* Image.cpp */, 10374 10372 B27535420B053814002CE64F /* Image.h */, 10375 B23BCCE40B3829C9005B2415 /* ImageBuffer.cpp */,10376 10373 B2A10B910B3818BD00099AA4 /* ImageBuffer.h */, 10377 10374 BC7F44A70B9E324E00A9D081 /* ImageObserver.h */, … … 14529 14526 E12EDBEA0B308E0B002704B6 /* EventTarget.cpp in Sources */, 14530 14527 B2A10B940B3818D700099AA4 /* ImageBufferCG.cpp in Sources */, 14531 B23BCCE50B3829C9005B2415 /* ImageBuffer.cpp in Sources */,14532 14528 B2C96D8D0B3AF2B7005E80EC /* JSSVGPathSegCustom.cpp in Sources */, 14533 14529 B297BC700B3C14CF0045A590 /* JSSVGPathSegListCustom.cpp in Sources */, -
trunk/WebCore/ksvg2/svg/SVGMaskElement.cpp
r26497 r26595 33 33 #include "SVGLength.h" 34 34 #include "SVGNames.h" 35 #include "SVGRenderSupport.h" 35 36 #include "SVGUnitTypes.h" 36 37 #include <math.h> … … 159 160 continue; 160 161 161 ImageBuffer::renderSubtreeToImage(maskImage.get(), item);162 renderSubtreeToImage(maskImage.get(), item); 162 163 } 163 164 -
trunk/WebCore/ksvg2/svg/SVGPatternElement.cpp
r26497 r26595 36 36 #include "SVGNames.h" 37 37 #include "SVGPaintServerPattern.h" 38 #include "SVGRenderSupport.h" 38 39 #include "SVGStyledTransformableElement.h" 39 40 #include "SVGSVGElement.h" … … 226 227 continue; 227 228 228 ImageBuffer::renderSubtreeToImage(patternImage.get(), item);229 renderSubtreeToImage(patternImage.get(), item); 229 230 } 230 231 -
trunk/WebCore/platform/graphics/ImageBuffer.h
r21974 r26595 55 55 ~ImageBuffer(); 56 56 57 IntSize size() const ;57 IntSize size() const { return m_size; } 58 58 GraphicsContext* context() const; 59 60 // This offers a way to render parts of a WebKit rendering tree into this ImageBuffer class.61 // FIXME: This doesn't belong in the platform directory.62 // Bad layering that this knows about the render tree.63 // We need to move it into RenderObject or somewhere in the SVG world.64 static void renderSubtreeToImage(ImageBuffer*, RenderObject*);65 59 66 60 #if PLATFORM(CG) -
trunk/WebCore/platform/graphics/svg/SVGImage.cpp
r26494 r26595 42 42 #include "SVGImage.h" 43 43 #include "SVGLength.h" 44 #include "SVGRenderSupport.h" 44 45 #include "SVGSVGElement.h" 45 46 … … 117 118 if (!m_frameCache) // failed to allocate image 118 119 return 0; 119 ImageBuffer::renderSubtreeToImage(m_frameCache.get(), m_frame->renderer());120 renderSubtreeToImage(m_frameCache.get(), m_frame->renderer()); 120 121 } 121 122 #if PLATFORM(CG) -
trunk/WebCore/rendering/SVGRenderSupport.cpp
r26531 r26595 26 26 27 27 #if ENABLE(SVG) 28 29 28 #include "SVGRenderSupport.h" 30 29 31 30 #include "AffineTransform.h" 31 #include "ImageBuffer.h" 32 32 #include "RenderObject.h" 33 #include "RenderSVGContainer.h" 33 34 #include "SVGResourceClipper.h" 34 35 #include "SVGResourceFilter.h" … … 122 123 } 123 124 125 void renderSubtreeToImage(ImageBuffer* image, RenderObject* item) 126 { 127 ASSERT(item); 128 ASSERT(image); 129 ASSERT(image->context()); 130 RenderObject::PaintInfo info(image->context(), IntRect(), PaintPhaseForeground, 0, 0, 0); 131 132 RenderSVGContainer* svgContainer = 0; 133 if (item && item->isSVGContainer()) 134 svgContainer = static_cast<RenderSVGContainer*>(item); 135 136 bool drawsContents = svgContainer ? svgContainer->drawsContents() : false; 137 if (svgContainer && !drawsContents) 138 svgContainer->setDrawsContents(true); 139 140 item->paint(info, 0, 0); 141 142 if (svgContainer && !drawsContents) 143 svgContainer->setDrawsContents(false); 144 } 145 124 146 } // namespace WebCore 125 147 -
trunk/WebCore/rendering/SVGRenderSupport.h
r26446 r26595 24 24 25 25 #if ENABLE(SVG) 26 27 26 #include "RenderObject.h" 28 27 … … 33 32 void finishRenderSVGContent(RenderObject*, RenderObject::PaintInfo&, const FloatRect& boundingBox, SVGResourceFilter*&, GraphicsContext* savedContext); 34 33 34 // This offers a way to render parts of a WebKit rendering tree into a ImageBuffer. 35 class ImageBuffer; 36 void renderSubtreeToImage(ImageBuffer*, RenderObject*); 37 35 38 } 36 39
Note: See TracChangeset
for help on using the changeset viewer.