diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2008-12-17 18:05:15 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2008-12-17 18:05:15 -0800 |
commit | 1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353 (patch) | |
tree | 4457a7306ea5acb43fe05bfe0973b1f7faf97ba2 /WebCore/svg/graphics/qt/SVGPaintServerSolidQt.cpp | |
parent | 9364f22aed35e1a1e9d07c121510f80be3ab0502 (diff) | |
download | external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.zip external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.tar.gz external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.tar.bz2 |
Code drop from //branches/cupcake/...@124589
Diffstat (limited to 'WebCore/svg/graphics/qt/SVGPaintServerSolidQt.cpp')
-rw-r--r-- | WebCore/svg/graphics/qt/SVGPaintServerSolidQt.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/WebCore/svg/graphics/qt/SVGPaintServerSolidQt.cpp b/WebCore/svg/graphics/qt/SVGPaintServerSolidQt.cpp index 7b06a03..e088df2 100644 --- a/WebCore/svg/graphics/qt/SVGPaintServerSolidQt.cpp +++ b/WebCore/svg/graphics/qt/SVGPaintServerSolidQt.cpp @@ -1,5 +1,6 @@ /* Copyright (C) 2006 Nikolas Zimmermann <wildfox@kde.org> + Copyright (C) 2008 Holger Hans Peter Freyther This file is part of the KDE project @@ -36,27 +37,33 @@ bool SVGPaintServerSolid::setup(GraphicsContext*& context, const RenderObject* o QPainter* painter(context ? context->platformContext() : 0); Q_ASSERT(painter); - RenderStyle* renderStyle = object->style(); + const SVGRenderStyle* svgStyle = object->style()->svgStyle(); + RenderStyle* style = object ? object->style() : 0; // TODO? painter->setOpacity(renderStyle->opacity()); QColor c = color(); - if ((type & ApplyToFillTargetType) && renderStyle->svgStyle()->hasFill()) { - c.setAlphaF(renderStyle->svgStyle()->fillOpacity()); + if ((type & ApplyToFillTargetType) && (!style || svgStyle->hasFill())) { + if (style) + c.setAlphaF(svgStyle->fillOpacity()); QBrush brush(c); painter->setBrush(brush); - context->setFillRule(renderStyle->svgStyle()->fillRule()); + + if (style) + context->setFillRule(svgStyle->fillRule()); /* if(isPaintingText()) ... */ } - if ((type & ApplyToStrokeTargetType) && renderStyle->svgStyle()->hasStroke()) { - c.setAlphaF(renderStyle->svgStyle()->strokeOpacity()); + if ((type & ApplyToStrokeTargetType) && (!style || svgStyle->hasStroke())) { + if (style) + c.setAlphaF(svgStyle->strokeOpacity()); QPen pen(c); - setPenProperties(object, renderStyle, pen); painter->setPen(pen); + if (style) + applyStrokeStyleToContext(context, style, object); /* if(isPaintingText()) ... */ } |