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 19 matching lines...) Expand all Loading... |
30 | 30 |
31 RenderSVGResourceLinearGradient::RenderSVGResourceLinearGradient(SVGLinearGradie
ntElement* node) | 31 RenderSVGResourceLinearGradient::RenderSVGResourceLinearGradient(SVGLinearGradie
ntElement* node) |
32 : RenderSVGResourceGradient(node) | 32 : RenderSVGResourceGradient(node) |
33 { | 33 { |
34 } | 34 } |
35 | 35 |
36 RenderSVGResourceLinearGradient::~RenderSVGResourceLinearGradient() | 36 RenderSVGResourceLinearGradient::~RenderSVGResourceLinearGradient() |
37 { | 37 { |
38 } | 38 } |
39 | 39 |
| 40 void RenderSVGResourceLinearGradient::trace(Visitor* visitor) |
| 41 { |
| 42 visitor->trace(m_attributes); |
| 43 RenderSVGResourceGradient::trace(visitor); |
| 44 } |
| 45 |
40 bool RenderSVGResourceLinearGradient::collectGradientAttributes(SVGGradientEleme
nt* gradientElement) | 46 bool RenderSVGResourceLinearGradient::collectGradientAttributes(SVGGradientEleme
nt* gradientElement) |
41 { | 47 { |
42 m_attributes = LinearGradientAttributes(); | 48 m_attributes = LinearGradientAttributes(); |
43 return toSVGLinearGradientElement(gradientElement)->collectGradientAttribute
s(m_attributes); | 49 return toSVGLinearGradientElement(gradientElement)->collectGradientAttribute
s(m_attributes); |
44 } | 50 } |
45 | 51 |
46 FloatPoint RenderSVGResourceLinearGradient::startPoint(const LinearGradientAttri
butes& attributes) const | 52 FloatPoint RenderSVGResourceLinearGradient::startPoint(const LinearGradientAttri
butes& attributes) const |
47 { | 53 { |
48 return SVGLengthContext::resolvePoint(element(), attributes.gradientUnits(),
attributes.x1(), attributes.y1()); | 54 return SVGLengthContext::resolvePoint(element(), attributes.gradientUnits(),
attributes.x1(), attributes.y1()); |
49 } | 55 } |
50 | 56 |
51 FloatPoint RenderSVGResourceLinearGradient::endPoint(const LinearGradientAttribu
tes& attributes) const | 57 FloatPoint RenderSVGResourceLinearGradient::endPoint(const LinearGradientAttribu
tes& attributes) const |
52 { | 58 { |
53 return SVGLengthContext::resolvePoint(element(), attributes.gradientUnits(),
attributes.x2(), attributes.y2()); | 59 return SVGLengthContext::resolvePoint(element(), attributes.gradientUnits(),
attributes.x2(), attributes.y2()); |
54 } | 60 } |
55 | 61 |
56 void RenderSVGResourceLinearGradient::buildGradient(GradientData* gradientData)
const | 62 void RenderSVGResourceLinearGradient::buildGradient(GradientData* gradientData)
const |
57 { | 63 { |
58 gradientData->gradient = Gradient::create(startPoint(m_attributes), endPoint
(m_attributes)); | 64 gradientData->gradient = Gradient::create(startPoint(m_attributes), endPoint
(m_attributes)); |
59 gradientData->gradient->setSpreadMethod(platformSpreadMethodFromSVGType(m_at
tributes.spreadMethod())); | 65 gradientData->gradient->setSpreadMethod(platformSpreadMethodFromSVGType(m_at
tributes.spreadMethod())); |
60 addStops(gradientData, m_attributes.stops()); | 66 addStops(gradientData, m_attributes.stops()); |
61 } | 67 } |
62 | 68 |
63 } | 69 } |
OLD | NEW |