OLD | NEW |
1 /** | 1 /** |
2 * Copyright (C) 2007 Rob Buis <buis@kde.org> | 2 * Copyright (C) 2007 Rob Buis <buis@kde.org> |
3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> |
4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 ASSERT(textRenderer); | 191 ASSERT(textRenderer); |
192 if (!textShouldBePainted(textRenderer)) | 192 if (!textShouldBePainted(textRenderer)) |
193 return; | 193 return; |
194 | 194 |
195 RenderStyle* style = parentRenderer->style(); | 195 RenderStyle* style = parentRenderer->style(); |
196 ASSERT(style); | 196 ASSERT(style); |
197 | 197 |
198 const SVGRenderStyle* svgStyle = style->svgStyle(); | 198 const SVGRenderStyle* svgStyle = style->svgStyle(); |
199 ASSERT(svgStyle); | 199 ASSERT(svgStyle); |
200 | 200 |
201 bool hasFill = svgStyle->hasFill(); | |
202 bool hasStroke = svgStyle->hasStroke(); | |
203 | |
204 RenderStyle* selectionStyle = style; | 201 RenderStyle* selectionStyle = style; |
205 if (hasSelection) { | 202 if (hasSelection) { |
206 selectionStyle = parentRenderer->getCachedPseudoStyle(SELECTION); | 203 selectionStyle = parentRenderer->getCachedPseudoStyle(SELECTION); |
207 if (selectionStyle) { | 204 if (!selectionStyle) |
208 const SVGRenderStyle* svgSelectionStyle = selectionStyle->svgStyle()
; | |
209 ASSERT(svgSelectionStyle); | |
210 | |
211 if (!hasFill) | |
212 hasFill = svgSelectionStyle->hasFill(); | |
213 if (!hasStroke) | |
214 hasStroke = svgSelectionStyle->hasStroke(); | |
215 } else | |
216 selectionStyle = style; | 205 selectionStyle = style; |
217 } | 206 } |
218 | 207 |
219 int startPosition, endPosition; | 208 int startPosition, endPosition; |
220 selectionStartEnd(startPosition, endPosition); | 209 selectionStartEnd(startPosition, endPosition); |
221 | 210 |
222 int fragmentStartPosition = 0; | 211 int fragmentStartPosition = 0; |
223 int fragmentEndPosition = 0; | 212 int fragmentEndPosition = 0; |
224 AffineTransform fragmentTransform; | 213 AffineTransform fragmentTransform; |
225 unsigned textFragmentsSize = m_textFragments.size(); | 214 unsigned textFragmentsSize = m_textFragments.size(); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 ASSERT(svgSelectionStyle); | 277 ASSERT(svgSelectionStyle); |
289 | 278 |
290 if (!hasFill) | 279 if (!hasFill) |
291 hasFill = svgSelectionStyle->hasFill(); | 280 hasFill = svgSelectionStyle->hasFill(); |
292 if (!hasStroke) | 281 if (!hasStroke) |
293 hasStroke = svgSelectionStyle->hasStroke(); | 282 hasStroke = svgSelectionStyle->hasStroke(); |
294 } else | 283 } else |
295 selectionStyle = style; | 284 selectionStyle = style; |
296 } | 285 } |
297 | 286 |
| 287 if (textRenderer->frame() && textRenderer->frame()->view() && textRenderer->
frame()->view()->paintBehavior() & PaintBehaviorRenderingSVGMask) { |
| 288 hasFill = true; |
| 289 hasStroke = false; |
| 290 } |
| 291 |
298 AffineTransform fragmentTransform; | 292 AffineTransform fragmentTransform; |
299 unsigned textFragmentsSize = m_textFragments.size(); | 293 unsigned textFragmentsSize = m_textFragments.size(); |
300 for (unsigned i = 0; i < textFragmentsSize; ++i) { | 294 for (unsigned i = 0; i < textFragmentsSize; ++i) { |
301 SVGTextFragment& fragment = m_textFragments.at(i); | 295 SVGTextFragment& fragment = m_textFragments.at(i); |
302 ASSERT(!m_paintingResource); | 296 ASSERT(!m_paintingResource); |
303 | 297 |
304 GraphicsContextStateSaver stateSaver(*paintInfo.context); | 298 GraphicsContextStateSaver stateSaver(*paintInfo.context); |
305 fragment.buildFragmentTransform(fragmentTransform); | 299 fragment.buildFragmentTransform(fragmentTransform); |
306 if (!fragmentTransform.isIdentity()) | 300 if (!fragmentTransform.isIdentity()) |
307 paintInfo.context->concatCTM(fragmentTransform); | 301 paintInfo.context->concatCTM(fragmentTransform); |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
748 return true; | 742 return true; |
749 } | 743 } |
750 } | 744 } |
751 } | 745 } |
752 return false; | 746 return false; |
753 } | 747 } |
754 | 748 |
755 } // namespace WebCore | 749 } // namespace WebCore |
756 | 750 |
757 #endif | 751 #endif |
OLD | NEW |