OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Rob Buis <buis@kde.org> |
4 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. |
5 * Copyright (C) 2011 Dirk Schulze <krit@webkit.org> | 5 * Copyright (C) 2011 Dirk Schulze <krit@webkit.org> |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 return strategy; | 45 return strategy; |
46 return ClipStrategy::Mask; | 46 return ClipStrategy::Mask; |
47 } | 47 } |
48 | 48 |
49 ClipStrategy determineClipStrategy(const SVGGraphicsElement& element) { | 49 ClipStrategy determineClipStrategy(const SVGGraphicsElement& element) { |
50 const LayoutObject* layoutObject = element.layoutObject(); | 50 const LayoutObject* layoutObject = element.layoutObject(); |
51 if (!layoutObject) | 51 if (!layoutObject) |
52 return ClipStrategy::None; | 52 return ClipStrategy::None; |
53 const ComputedStyle& style = layoutObject->styleRef(); | 53 const ComputedStyle& style = layoutObject->styleRef(); |
54 if (style.display() == EDisplay::None || | 54 if (style.display() == EDisplay::None || |
55 style.visibility() != EVisibility::Visible) | 55 style.visibility() != EVisibility::kVisible) |
56 return ClipStrategy::None; | 56 return ClipStrategy::None; |
57 ClipStrategy strategy = ClipStrategy::None; | 57 ClipStrategy strategy = ClipStrategy::None; |
58 // Only shapes, paths and texts are allowed for clipping. | 58 // Only shapes, paths and texts are allowed for clipping. |
59 if (layoutObject->isSVGShape()) { | 59 if (layoutObject->isSVGShape()) { |
60 strategy = ClipStrategy::Path; | 60 strategy = ClipStrategy::Path; |
61 } else if (layoutObject->isSVGText()) { | 61 } else if (layoutObject->isSVGText()) { |
62 // Text requires masking. | 62 // Text requires masking. |
63 strategy = ClipStrategy::Mask; | 63 strategy = ClipStrategy::Mask; |
64 } | 64 } |
65 return modifyStrategyForClipPath(style, strategy); | 65 return modifyStrategyForClipPath(style, strategy); |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 toSVGClipPathElement(element())->calculateTransform( | 302 toSVGClipPathElement(element())->calculateTransform( |
303 SVGElement::IncludeMotionTransform); | 303 SVGElement::IncludeMotionTransform); |
304 if (clipPathUnits() == SVGUnitTypes::kSvgUnitTypeObjectboundingbox) { | 304 if (clipPathUnits() == SVGUnitTypes::kSvgUnitTypeObjectboundingbox) { |
305 transform.translate(referenceBox.x(), referenceBox.y()); | 305 transform.translate(referenceBox.x(), referenceBox.y()); |
306 transform.scaleNonUniform(referenceBox.width(), referenceBox.height()); | 306 transform.scaleNonUniform(referenceBox.width(), referenceBox.height()); |
307 } | 307 } |
308 return transform.mapRect(m_localClipBounds); | 308 return transform.mapRect(m_localClipBounds); |
309 } | 309 } |
310 | 310 |
311 } // namespace blink | 311 } // namespace blink |
OLD | NEW |