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 308 matching lines...) Loading... |
319 if (!fragmentTransform.isIdentity()) | 319 if (!fragmentTransform.isIdentity()) |
320 paintInfo.context->concatCTM(fragmentTransform); | 320 paintInfo.context->concatCTM(fragmentTransform); |
321 | 321 |
322 // Spec: All text decorations except line-through should be drawn before
the text is filled and stroked; thus, the text is rendered on top of these deco
rations. | 322 // Spec: All text decorations except line-through should be drawn before
the text is filled and stroked; thus, the text is rendered on top of these deco
rations. |
323 int decorations = style->textDecorationsInEffect(); | 323 int decorations = style->textDecorationsInEffect(); |
324 if (decorations & TextDecorationUnderline) | 324 if (decorations & TextDecorationUnderline) |
325 paintDecoration(paintInfo.context, TextDecorationUnderline, fragment
); | 325 paintDecoration(paintInfo.context, TextDecorationUnderline, fragment
); |
326 if (decorations & TextDecorationOverline) | 326 if (decorations & TextDecorationOverline) |
327 paintDecoration(paintInfo.context, TextDecorationOverline, fragment)
; | 327 paintDecoration(paintInfo.context, TextDecorationOverline, fragment)
; |
328 | 328 |
329 // Fill text | 329 for (int i = 0; i < 3; i++) { |
330 if (hasFill) { | 330 switch (svgStyle->paintOrderType(i)) { |
331 m_paintingResourceMode = ApplyToFillMode | ApplyToTextMode; | 331 case PT_FILL: |
332 paintText(paintInfo.context, style, selectionStyle, fragment, hasSel
ection, paintSelectedTextOnly); | 332 // Fill text |
333 } | 333 if (hasFill) { |
334 | 334 m_paintingResourceMode = ApplyToFillMode | ApplyToTextMode; |
335 // Stroke text | 335 paintText(paintInfo.context, style, selectionStyle, fragment
, hasSelection, paintSelectedTextOnly); |
336 if (hasVisibleStroke) { | 336 } |
337 m_paintingResourceMode = ApplyToStrokeMode | ApplyToTextMode; | 337 break; |
338 paintText(paintInfo.context, style, selectionStyle, fragment, hasSel
ection, paintSelectedTextOnly); | 338 case PT_STROKE: |
| 339 // Stroke text |
| 340 if (hasVisibleStroke) { |
| 341 m_paintingResourceMode = ApplyToStrokeMode | ApplyToTextMode
; |
| 342 paintText(paintInfo.context, style, selectionStyle, fragment
, hasSelection, paintSelectedTextOnly); |
| 343 } |
| 344 break; |
| 345 case PT_MARKERS: |
| 346 // Markers don't apply to text |
| 347 break; |
| 348 default: |
| 349 ASSERT_NOT_REACHED(); |
| 350 break; |
| 351 } |
339 } | 352 } |
340 | 353 |
341 // Spec: Line-through should be drawn after the text is filled and strok
ed; thus, the line-through is rendered on top of the text. | 354 // Spec: Line-through should be drawn after the text is filled and strok
ed; thus, the line-through is rendered on top of the text. |
342 if (decorations & TextDecorationLineThrough) | 355 if (decorations & TextDecorationLineThrough) |
343 paintDecoration(paintInfo.context, TextDecorationLineThrough, fragme
nt); | 356 paintDecoration(paintInfo.context, TextDecorationLineThrough, fragme
nt); |
344 | 357 |
345 m_paintingResourceMode = ApplyToDefaultMode; | 358 m_paintingResourceMode = ApplyToDefaultMode; |
346 } | 359 } |
347 | 360 |
348 ASSERT(!m_paintingResource); | 361 ASSERT(!m_paintingResource); |
(...skipping 383 matching lines...) Loading... |
732 renderer()->updateHitTestResult(result, locationInContainer.poin
t() - toLayoutSize(accumulatedOffset)); | 745 renderer()->updateHitTestResult(result, locationInContainer.poin
t() - toLayoutSize(accumulatedOffset)); |
733 if (!result.addNodeToRectBasedTestResult(renderer()->node(), req
uest, locationInContainer, rect)) | 746 if (!result.addNodeToRectBasedTestResult(renderer()->node(), req
uest, locationInContainer, rect)) |
734 return true; | 747 return true; |
735 } | 748 } |
736 } | 749 } |
737 } | 750 } |
738 return false; | 751 return false; |
739 } | 752 } |
740 | 753 |
741 } // namespace WebCore | 754 } // namespace WebCore |
OLD | NEW |