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) 2008 Eric Seidel <eric@webkit.org> | 3 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
4 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> | 4 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> |
5 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 5 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 updateGraphicsContext(context, style, *object, resourceMode); | 119 updateGraphicsContext(context, style, *object, resourceMode); |
120 return true; | 120 return true; |
121 } | 121 } |
122 | 122 |
123 void RenderSVGResourceGradient::postApplyResource(GraphicsContext* context) | 123 void RenderSVGResourceGradient::postApplyResource(GraphicsContext* context) |
124 { | 124 { |
125 ASSERT(context); | 125 ASSERT(context); |
126 context->restore(); | 126 context->restore(); |
127 } | 127 } |
128 | 128 |
| 129 bool RenderSVGResourceGradient::isChildAllowed(RenderObject* child, RenderStyle*
) const |
| 130 { |
| 131 if (child->isSVGGradientStop()) |
| 132 return true; |
| 133 |
| 134 if (!child->isSVGResourceContainer()) |
| 135 return false; |
| 136 |
| 137 RenderSVGResourceContainer* resource = toRenderSVGResourceContainer(child); |
| 138 return resource->resourceType() == PatternResourceType |
| 139 || resource->resourceType() == LinearGradientResourceType |
| 140 || resource->resourceType() == RadialGradientResourceType; |
| 141 } |
| 142 |
129 void RenderSVGResourceGradient::addStops(GradientData* gradientData, const Vecto
r<Gradient::ColorStop>& stops) const | 143 void RenderSVGResourceGradient::addStops(GradientData* gradientData, const Vecto
r<Gradient::ColorStop>& stops) const |
130 { | 144 { |
131 ASSERT(gradientData->gradient); | 145 ASSERT(gradientData->gradient); |
132 | 146 |
133 const Vector<Gradient::ColorStop>::const_iterator end = stops.end(); | 147 const Vector<Gradient::ColorStop>::const_iterator end = stops.end(); |
134 for (Vector<Gradient::ColorStop>::const_iterator it = stops.begin(); it != e
nd; ++it) | 148 for (Vector<Gradient::ColorStop>::const_iterator it = stops.begin(); it != e
nd; ++it) |
135 gradientData->gradient->addColorStop(*it); | 149 gradientData->gradient->addColorStop(*it); |
136 } | 150 } |
137 | 151 |
138 GradientSpreadMethod RenderSVGResourceGradient::platformSpreadMethodFromSVGType(
SVGSpreadMethodType method) const | 152 GradientSpreadMethod RenderSVGResourceGradient::platformSpreadMethodFromSVGType(
SVGSpreadMethodType method) const |
139 { | 153 { |
140 switch (method) { | 154 switch (method) { |
141 case SVGSpreadMethodUnknown: | 155 case SVGSpreadMethodUnknown: |
142 case SVGSpreadMethodPad: | 156 case SVGSpreadMethodPad: |
143 return SpreadMethodPad; | 157 return SpreadMethodPad; |
144 case SVGSpreadMethodReflect: | 158 case SVGSpreadMethodReflect: |
145 return SpreadMethodReflect; | 159 return SpreadMethodReflect; |
146 case SVGSpreadMethodRepeat: | 160 case SVGSpreadMethodRepeat: |
147 return SpreadMethodRepeat; | 161 return SpreadMethodRepeat; |
148 } | 162 } |
149 | 163 |
150 ASSERT_NOT_REACHED(); | 164 ASSERT_NOT_REACHED(); |
151 return SpreadMethodPad; | 165 return SpreadMethodPad; |
152 } | 166 } |
153 | 167 |
154 } | 168 } |
OLD | NEW |