| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Rob Buis <buis@kde.org> | 2 * Copyright (C) 2007, 2008 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) 2007 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
| 5 * Copyright (C) 2009 Google, Inc. All rights reserved. | 5 * Copyright (C) 2009 Google, Inc. All rights reserved. |
| 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
| 7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 #include "core/rendering/svg/RenderSVGResourceFilter.h" | 36 #include "core/rendering/svg/RenderSVGResourceFilter.h" |
| 37 #include "core/rendering/svg/RenderSVGResourceMasker.h" | 37 #include "core/rendering/svg/RenderSVGResourceMasker.h" |
| 38 #include "core/rendering/svg/RenderSVGRoot.h" | 38 #include "core/rendering/svg/RenderSVGRoot.h" |
| 39 #include "core/rendering/svg/RenderSVGShape.h" | 39 #include "core/rendering/svg/RenderSVGShape.h" |
| 40 #include "core/rendering/svg/RenderSVGText.h" | 40 #include "core/rendering/svg/RenderSVGText.h" |
| 41 #include "core/rendering/svg/RenderSVGViewportContainer.h" | 41 #include "core/rendering/svg/RenderSVGViewportContainer.h" |
| 42 #include "core/rendering/svg/SVGResources.h" | 42 #include "core/rendering/svg/SVGResources.h" |
| 43 #include "core/rendering/svg/SVGResourcesCache.h" | 43 #include "core/rendering/svg/SVGResourcesCache.h" |
| 44 #include "core/svg/SVGElement.h" | 44 #include "core/svg/SVGElement.h" |
| 45 #include "platform/geometry/TransformState.h" | 45 #include "platform/geometry/TransformState.h" |
| 46 #include "platform/graphics/Path.h" | |
| 47 | 46 |
| 48 namespace blink { | 47 namespace blink { |
| 49 | 48 |
| 50 LayoutRect SVGRenderSupport::clippedOverflowRectForPaintInvalidation(const Rende
rObject* object, const RenderLayerModelObject* paintInvalidationContainer, const
PaintInvalidationState* paintInvalidationState) | 49 LayoutRect SVGRenderSupport::clippedOverflowRectForPaintInvalidation(const Rende
rObject* object, const RenderLayerModelObject* paintInvalidationContainer, const
PaintInvalidationState* paintInvalidationState) |
| 51 { | 50 { |
| 52 // Return early for any cases where we don't actually paint | 51 // Return early for any cases where we don't actually paint |
| 53 if (object->style()->visibility() != VISIBLE && !object->enclosingLayer()->h
asVisibleContent()) | 52 if (object->style()->visibility() != VISIBLE && !object->enclosingLayer()->h
asVisibleContent()) |
| 54 return LayoutRect(); | 53 return LayoutRect(); |
| 55 | 54 |
| 56 // Pass our local paint rect to computeRectForPaintInvalidation() which will | 55 // Pass our local paint rect to computeRectForPaintInvalidation() which will |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 if (resourceMode == ApplyToFillMode) { | 419 if (resourceMode == ApplyToFillMode) { |
| 421 context->setAlphaAsFloat(svgStyle.fillOpacity()); | 420 context->setAlphaAsFloat(svgStyle.fillOpacity()); |
| 422 context->setFillRule(svgStyle.fillRule()); | 421 context->setFillRule(svgStyle.fillRule()); |
| 423 } else { | 422 } else { |
| 424 context->setAlphaAsFloat(svgStyle.strokeOpacity()); | 423 context->setAlphaAsFloat(svgStyle.strokeOpacity()); |
| 425 applyStrokeStyleToContext(context, style, &renderer); | 424 applyStrokeStyleToContext(context, style, &renderer); |
| 426 } | 425 } |
| 427 return true; | 426 return true; |
| 428 } | 427 } |
| 429 | 428 |
| 430 void SVGRenderSupport::fillOrStrokePath(GraphicsContext* context, unsigned short
resourceMode, const Path& path) | |
| 431 { | |
| 432 if (resourceMode & ApplyToFillMode) | |
| 433 context->fillPath(path); | |
| 434 if (resourceMode & ApplyToStrokeMode) | |
| 435 context->strokePath(path); | |
| 436 } | |
| 437 | |
| 438 bool SVGRenderSupport::isRenderableTextNode(const RenderObject* object) | 429 bool SVGRenderSupport::isRenderableTextNode(const RenderObject* object) |
| 439 { | 430 { |
| 440 ASSERT(object->isText()); | 431 ASSERT(object->isText()); |
| 441 // <br> is marked as text, but is not handled by the SVG rendering code-path
. | 432 // <br> is marked as text, but is not handled by the SVG rendering code-path
. |
| 442 return object->isSVGInlineText() && !toRenderSVGInlineText(object)->hasEmpty
Text(); | 433 return object->isSVGInlineText() && !toRenderSVGInlineText(object)->hasEmpty
Text(); |
| 443 } | 434 } |
| 444 | 435 |
| 445 } | 436 } |
| OLD | NEW |