| 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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 void releasePaintingResource(GraphicsContext*&); | 357 void releasePaintingResource(GraphicsContext*&); |
| 358 | 358 |
| 359 private: | 359 private: |
| 360 RenderObject& m_renderer; | 360 RenderObject& m_renderer; |
| 361 RenderSVGResource* m_paintingResource; | 361 RenderSVGResource* m_paintingResource; |
| 362 }; | 362 }; |
| 363 | 363 |
| 364 bool PaintingResourceScope::acquirePaintingResource(GraphicsContext*& context, R
enderStyle* style, RenderSVGResourceModeFlags resourceModeFlags) | 364 bool PaintingResourceScope::acquirePaintingResource(GraphicsContext*& context, R
enderStyle* style, RenderSVGResourceModeFlags resourceModeFlags) |
| 365 { | 365 { |
| 366 ASSERT(style); | 366 ASSERT(style); |
| 367 ASSERT(resourceModeFlags != ApplyToDefaultMode); | |
| 368 RenderSVGResourceMode resourceMode = static_cast<RenderSVGResourceMode>(reso
urceModeFlags & (ApplyToFillMode | ApplyToStrokeMode)); | 367 RenderSVGResourceMode resourceMode = static_cast<RenderSVGResourceMode>(reso
urceModeFlags & (ApplyToFillMode | ApplyToStrokeMode)); |
| 369 ASSERT(resourceMode == ApplyToFillMode || resourceMode == ApplyToStrokeMode)
; | 368 ASSERT(resourceMode == ApplyToFillMode || resourceMode == ApplyToStrokeMode)
; |
| 370 | 369 |
| 371 bool hasFallback = false; | 370 bool hasFallback = false; |
| 372 m_paintingResource = RenderSVGResource::requestPaintingResource(resourceMode
, &m_renderer, style, hasFallback); | 371 m_paintingResource = RenderSVGResource::requestPaintingResource(resourceMode
, &m_renderer, style, hasFallback); |
| 373 if (!m_paintingResource) | 372 if (!m_paintingResource) |
| 374 return false; | 373 return false; |
| 375 | 374 |
| 376 if (!m_paintingResource->applyResource(&m_renderer, style, context, resource
ModeFlags)) { | 375 if (!m_paintingResource->applyResource(&m_renderer, style, context, resource
ModeFlags)) { |
| 377 if (hasFallback) { | 376 if (hasFallback) { |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 break; | 522 break; |
| 524 default: | 523 default: |
| 525 ASSERT_NOT_REACHED(); | 524 ASSERT_NOT_REACHED(); |
| 526 } | 525 } |
| 527 } | 526 } |
| 528 } | 527 } |
| 529 | 528 |
| 530 void SVGInlineTextBox::paintDecorationWithStyle(GraphicsContext* context, TextDe
coration decoration, | 529 void SVGInlineTextBox::paintDecorationWithStyle(GraphicsContext* context, TextDe
coration decoration, |
| 531 const SVGTextFragment& fragment, RenderObject* decorationRenderer, RenderSVG
ResourceModeFlags resourceMode) | 530 const SVGTextFragment& fragment, RenderObject* decorationRenderer, RenderSVG
ResourceModeFlags resourceMode) |
| 532 { | 531 { |
| 533 ASSERT(resourceMode != ApplyToDefaultMode); | |
| 534 | |
| 535 RenderStyle* decorationStyle = decorationRenderer->style(); | 532 RenderStyle* decorationStyle = decorationRenderer->style(); |
| 536 ASSERT(decorationStyle); | 533 ASSERT(decorationStyle); |
| 537 | 534 |
| 538 float scalingFactor = 1; | 535 float scalingFactor = 1; |
| 539 Font scaledFont; | 536 Font scaledFont; |
| 540 RenderSVGInlineText::computeNewScaledFontForStyle(decorationRenderer, decora
tionStyle, scalingFactor, scaledFont); | 537 RenderSVGInlineText::computeNewScaledFontForStyle(decorationRenderer, decora
tionStyle, scalingFactor, scaledFont); |
| 541 ASSERT(scalingFactor); | 538 ASSERT(scalingFactor); |
| 542 | 539 |
| 543 float thickness = thicknessForDecoration(decoration, scaledFont); | 540 float thickness = thicknessForDecoration(decoration, scaledFont); |
| 544 | 541 |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 757 renderer().updateHitTestResult(result, locationInContainer.point
() - toLayoutSize(accumulatedOffset)); | 754 renderer().updateHitTestResult(result, locationInContainer.point
() - toLayoutSize(accumulatedOffset)); |
| 758 if (!result.addNodeToRectBasedTestResult(renderer().node(), requ
est, locationInContainer, rect)) | 755 if (!result.addNodeToRectBasedTestResult(renderer().node(), requ
est, locationInContainer, rect)) |
| 759 return true; | 756 return true; |
| 760 } | 757 } |
| 761 } | 758 } |
| 762 } | 759 } |
| 763 return false; | 760 return false; |
| 764 } | 761 } |
| 765 | 762 |
| 766 } // namespace blink | 763 } // namespace blink |
| OLD | NEW |