OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 3 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 RenderSVGResourceLinearGradient::RenderSVGResourceLinearGradient(SVGLinearGradie
ntElement* node) | 29 RenderSVGResourceLinearGradient::RenderSVGResourceLinearGradient(SVGLinearGradie
ntElement* node) |
30 : RenderSVGResourceGradient(node) | 30 : RenderSVGResourceGradient(node) |
31 { | 31 { |
32 } | 32 } |
33 | 33 |
34 RenderSVGResourceLinearGradient::~RenderSVGResourceLinearGradient() | 34 RenderSVGResourceLinearGradient::~RenderSVGResourceLinearGradient() |
35 { | 35 { |
36 } | 36 } |
37 | 37 |
| 38 void RenderSVGResourceLinearGradient::trace(Visitor* visitor) |
| 39 { |
| 40 visitor->trace(m_attributes); |
| 41 RenderSVGResourceGradient::trace(visitor); |
| 42 } |
| 43 |
38 bool RenderSVGResourceLinearGradient::collectGradientAttributes(SVGGradientEleme
nt* gradientElement) | 44 bool RenderSVGResourceLinearGradient::collectGradientAttributes(SVGGradientEleme
nt* gradientElement) |
39 { | 45 { |
40 m_attributes = LinearGradientAttributes(); | 46 m_attributes = LinearGradientAttributes(); |
41 return toSVGLinearGradientElement(gradientElement)->collectGradientAttribute
s(m_attributes); | 47 return toSVGLinearGradientElement(gradientElement)->collectGradientAttribute
s(m_attributes); |
42 } | 48 } |
43 | 49 |
44 FloatPoint RenderSVGResourceLinearGradient::startPoint(const LinearGradientAttri
butes& attributes) const | 50 FloatPoint RenderSVGResourceLinearGradient::startPoint(const LinearGradientAttri
butes& attributes) const |
45 { | 51 { |
46 return SVGLengthContext::resolvePoint(element(), attributes.gradientUnits(),
attributes.x1(), attributes.y1()); | 52 return SVGLengthContext::resolvePoint(element(), attributes.gradientUnits(),
attributes.x1(), attributes.y1()); |
47 } | 53 } |
48 | 54 |
49 FloatPoint RenderSVGResourceLinearGradient::endPoint(const LinearGradientAttribu
tes& attributes) const | 55 FloatPoint RenderSVGResourceLinearGradient::endPoint(const LinearGradientAttribu
tes& attributes) const |
50 { | 56 { |
51 return SVGLengthContext::resolvePoint(element(), attributes.gradientUnits(),
attributes.x2(), attributes.y2()); | 57 return SVGLengthContext::resolvePoint(element(), attributes.gradientUnits(),
attributes.x2(), attributes.y2()); |
52 } | 58 } |
53 | 59 |
54 void RenderSVGResourceLinearGradient::buildGradient(GradientData* gradientData)
const | 60 void RenderSVGResourceLinearGradient::buildGradient(GradientData* gradientData)
const |
55 { | 61 { |
56 gradientData->gradient = Gradient::create(startPoint(m_attributes), endPoint
(m_attributes)); | 62 gradientData->gradient = Gradient::create(startPoint(m_attributes), endPoint
(m_attributes)); |
57 gradientData->gradient->setSpreadMethod(platformSpreadMethodFromSVGType(m_at
tributes.spreadMethod())); | 63 gradientData->gradient->setSpreadMethod(platformSpreadMethodFromSVGType(m_at
tributes.spreadMethod())); |
58 addStops(gradientData, m_attributes.stops()); | 64 addStops(gradientData, m_attributes.stops()); |
59 } | 65 } |
60 | 66 |
61 } | 67 } |
OLD | NEW |