Changeset 36725 in webkit
- Timestamp:
- Sep 20, 2008 6:29:08 PM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 1 deleted
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r36724 r36725 9 9 (WebCore::SVGInlineTextBoxQueryWalker::chunkPortionCallback): Changed to 10 10 not include the first character in the extraCharsAvailable count. 11 12 2008-09-20 Dan Bernstein <mitz@apple.com>13 14 - Mac build fix15 16 * WebCore.xcodeproj/project.pbxproj: Made DashArray.h a private header.17 18 2008-09-20 Dirk Schulze <vbs85@gmx.de>19 20 Reviewed by eseidel. Landed by eseidel.21 22 Moved DashArray to the GraphicsContext.23 24 * GNUmakefile.am:25 * platform/graphics/DashArray.h: Added.26 * platform/graphics/GraphicsContext.h:27 * platform/graphics/cairo/GraphicsContextCairo.cpp:28 (WebCore::GraphicsContext::setLineDash):29 * platform/graphics/cg/GraphicsContextCG.cpp:30 (WebCore::GraphicsContext::setLineDash):31 * platform/graphics/qt/GraphicsContextQt.cpp:32 (WebCore::GraphicsContext::setLineDash):33 * svg/graphics/SVGPaintServer.cpp:34 (WebCore::applyStrokeStyleToContext):35 * svg/graphics/SVGPaintServer.h:36 * svg/graphics/cg/CgSupport.cpp:37 * svg/graphics/cg/CgSupport.h:38 11 39 12 2008-09-20 Kevin Ollivier <kevino@theolliviers.com> -
trunk/WebCore/GNUmakefile.am
r36719 r36725 1567 1567 WebCore/platform/graphics/Color.cpp \ 1568 1568 WebCore/platform/graphics/Color.h \ 1569 WebCore/platform/graphics/DashArray.h \1570 1569 WebCore/platform/graphics/FloatPoint.cpp \ 1571 1570 WebCore/platform/graphics/FloatPoint.h \ -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r36719 r36725 3770 3770 </File> 3771 3771 <File 3772 RelativePath="..\platform\graphics\DashArray.h"3773 >3774 </File>3775 <File3776 3772 RelativePath="..\platform\graphics\FloatPoint.cpp" 3777 3773 > -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r36722 r36725 2345 2345 A8C4A80E09D563270003AC8D /* Attr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C4A7FC09D563270003AC8D /* Attr.cpp */; }; 2346 2346 A8C4A84C09D5649D0003AC8D /* MappedAttributeEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C4A84B09D5649D0003AC8D /* MappedAttributeEntry.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2347 A8CB41030E85B8A50032C4F0 /* DashArray.h in Headers */ = {isa = PBXBuildFile; fileRef = A8CB41020E85B8A50032C4F0 /* DashArray.h */; settings = {ATTRIBUTES = (Private, ); }; };2348 2347 A8CFF04D0A154F09000A4234 /* FixedTableLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8CFF0480A154F09000A4234 /* FixedTableLayout.cpp */; }; 2349 2348 A8CFF04E0A154F09000A4234 /* AutoTableLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = A8CFF0490A154F09000A4234 /* AutoTableLayout.h */; }; … … 6827 6826 A8C4A7FC09D563270003AC8D /* Attr.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Attr.cpp; sourceTree = "<group>"; }; 6828 6827 A8C4A84B09D5649D0003AC8D /* MappedAttributeEntry.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MappedAttributeEntry.h; sourceTree = "<group>"; }; 6829 A8CB41020E85B8A50032C4F0 /* DashArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DashArray.h; sourceTree = "<group>"; };6830 6828 A8CFF0480A154F09000A4234 /* FixedTableLayout.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FixedTableLayout.cpp; sourceTree = "<group>"; }; 6831 6829 A8CFF0490A154F09000A4234 /* AutoTableLayout.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AutoTableLayout.h; sourceTree = "<group>"; }; … … 12447 12445 B27535380B053814002CE64F /* Color.cpp */, 12448 12446 B27535390B053814002CE64F /* Color.h */, 12449 A8CB41020E85B8A50032C4F0 /* DashArray.h */,12450 12447 B275353A0B053814002CE64F /* FloatPoint.cpp */, 12451 12448 B275353B0B053814002CE64F /* FloatPoint.h */, … … 15856 15853 B2F34FE60E82F81400F627CD /* DNS.h in Headers */, 15857 15854 089582560E857A7E00F82C83 /* ImageLoader.h in Headers */, 15858 A8CB41030E85B8A50032C4F0 /* DashArray.h in Headers */,15859 15855 ); 15860 15856 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebCore/platform/graphics/GraphicsContext.h
r36719 r36725 27 27 #define GraphicsContext_h 28 28 29 #include "DashArray.h"30 29 #include "FloatRect.h" 31 30 #include "Image.h" … … 233 232 234 233 void setLineCap(LineCap); 235 void setLineDash(const DashArray&, float dashOffset);236 234 void setLineJoin(LineJoin); 237 235 void setMiterLimit(float); -
trunk/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
r36719 r36725 806 806 } 807 807 cairo_set_line_cap(m_data->cr, cairoCap); 808 }809 810 void GraphicsContext::setLineDash(const DashArray& dashes, float dashOffset)811 {812 cairo_set_dash(m_data->cr, dashes.data(), dashes.size(), dashOffset);813 808 } 814 809 -
trunk/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
r36719 r36725 719 719 } 720 720 721 void GraphicsContext::setLineDash(const DashArray& dashes, float dashOffset)722 {723 CGContextSetLineDash(platformContext(), dashOffset, dashes.data(), dashes.size());724 }725 726 721 void GraphicsContext::setLineJoin(LineJoin join) 727 722 { … … 740 735 } 741 736 } 742 737 743 738 void GraphicsContext::beginPath() 744 739 { -
trunk/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
r36719 r36725 40 40 41 41 #include "AffineTransform.h" 42 #include "Path.h" 43 #include "Pattern.h" 42 44 #include "Color.h" 43 #include "Font.h"44 45 #include "GraphicsContext.h" 45 46 #include "GraphicsContextPrivate.h" 46 47 #include "ImageBuffer.h" 47 #include "Path.h" 48 #include "Pattern.h" 48 #include "Font.h" 49 49 #include "Pen.h" 50 50 #include "NotImplemented.h" 51 51 52 #include <QStack> 53 #include <QPainter> 54 #include <QPolygonF> 55 #include <QPainterPath> 56 #include <QPaintDevice> 57 #include <QPixmap> 58 #include <QPaintEngine> 52 59 #include <QDebug> 53 #include <QPainter>54 #include <QPaintDevice>55 #include <QPaintEngine>56 #include <QPainterPath>57 #include <QPixmap>58 #include <QPolygonF>59 #include <QStack>60 #include <QVector>61 60 62 61 #ifndef M_PI … … 786 785 } 787 786 788 void GraphicsContext::setLineDash(const DashArray& dashes, float dashOffset)789 {790 QPainter* p = m_data->p();791 QPen pen = p->pen();792 unsigned dashLength = dashes.size();793 if (dashLength) {794 QVector<qreal> pattern;795 unsigned count = dashLength;796 if (dashLength % 2)797 count *= 2;798 799 for (unsigned i = 0; i < count; i++)800 pattern.append(dashes[i % dashLength] / narrowPrecisionToFloat(pen.widthF()));801 802 pen.setDashPattern(pattern);803 pen.setDashOffset(dashOffset);804 }805 p->setPen(pen);806 }807 808 787 void GraphicsContext::setLineJoin(LineJoin lj) 809 788 { -
trunk/WebCore/svg/graphics/SVGPaintServer.cpp
r36719 r36725 30 30 #include "SVGPaintServer.h" 31 31 32 #include "GraphicsContext.h"33 32 #include "RenderObject.h" 34 33 #include "RenderStyle.h" … … 146 145 } 147 146 148 void applyStrokeStyleToContext(GraphicsContext* context, RenderStyle* style, const RenderObject* object)149 {150 context->setStrokeThickness(SVGRenderStyle::cssPrimitiveToLength(object, style->svgStyle()->strokeWidth(), 1.0f));151 context->setLineCap(style->svgStyle()->capStyle());152 context->setLineJoin(style->svgStyle()->joinStyle());153 if (style->svgStyle()->joinStyle() == MiterJoin)154 context->setMiterLimit(style->svgStyle()->strokeMiterLimit());155 156 const DashArray& dashes = dashArrayFromRenderingStyle(object->style());157 float dashOffset = SVGRenderStyle::cssPrimitiveToLength(object, style->svgStyle()->strokeDashOffset(), 0.0f);158 context->setLineDash(dashes, dashOffset);159 }160 161 147 DashArray dashArrayFromRenderingStyle(const RenderStyle* style) 162 148 { -
trunk/WebCore/svg/graphics/SVGPaintServer.h
r36719 r36725 29 29 #if ENABLE(SVG) 30 30 31 #include "DashArray.h"32 31 #include "SVGResource.h" 33 32 … … 41 40 class QPen; 42 41 QT_END_NAMESPACE 42 #endif 43 44 #if PLATFORM(CG) 45 typedef Vector<CGFloat> DashArray; 46 #else 47 typedef Vector<float> DashArray; 43 48 #endif 44 49 … … 103 108 SVGPaintServer* getPaintServerById(Document*, const AtomicString&); 104 109 105 void applyStrokeStyleToContext(GraphicsContext*, RenderStyle*, const RenderObject*);106 110 DashArray dashArrayFromRenderingStyle(const RenderStyle* style); 107 111 } // namespace WebCore -
trunk/WebCore/svg/graphics/cg/CgSupport.cpp
r36719 r36725 47 47 transform = CGAffineTransformScale(transform, dest.size.width/source.size.width, dest.size.height/source.size.height); 48 48 return transform; 49 } 50 51 void applyStrokeStyleToContext(GraphicsContext* context, RenderStyle* style, const RenderObject* object) 52 { 53 context->setStrokeThickness(SVGRenderStyle::cssPrimitiveToLength(object, style->svgStyle()->strokeWidth(), 1.0f)); 54 context->setLineCap(style->svgStyle()->capStyle()); 55 context->setLineJoin(style->svgStyle()->joinStyle()); 56 context->setMiterLimit(style->svgStyle()->strokeMiterLimit()); 57 58 // FIXME: DashArray support could easily be moved into GraphicsContext, and this function then made x-platform 59 const DashArray& dashes = dashArrayFromRenderingStyle(style); 60 float dashOffset = SVGRenderStyle::cssPrimitiveToLength(object, style->svgStyle()->strokeDashOffset(), 0.0f); 61 62 CGContextSetLineDash(context->platformContext(), dashOffset, dashes.data(), dashes.size()); 49 63 } 50 64 -
trunk/WebCore/svg/graphics/cg/CgSupport.h
r36719 r36725 44 44 CGAffineTransform CGAffineTransformMakeMapBetweenRects(CGRect source, CGRect dest); 45 45 46 void applyStrokeStyleToContext(GraphicsContext*, RenderStyle*, const RenderObject*); 47 46 48 CGContextRef scratchContext(); 47 49 FloatRect strokeBoundingBox(const Path& path, RenderStyle*, const RenderObject*);
Note: See TracChangeset
for help on using the changeset viewer.