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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 return false; | 104 return false; |
105 | 105 |
106 const SVGRenderStyle& svgStyle = style->svgStyle(); | 106 const SVGRenderStyle& svgStyle = style->svgStyle(); |
107 | 107 |
108 AffineTransform computedGradientSpaceTransform = computeResourceSpaceTransfo
rm(object, gradientData->userspaceTransform, svgStyle, resourceMode); | 108 AffineTransform computedGradientSpaceTransform = computeResourceSpaceTransfo
rm(object, gradientData->userspaceTransform, svgStyle, resourceMode); |
109 gradientData->gradient->setGradientSpaceTransform(computedGradientSpaceTrans
form); | 109 gradientData->gradient->setGradientSpaceTransform(computedGradientSpaceTrans
form); |
110 | 110 |
111 // Draw gradient | 111 // Draw gradient |
112 context->save(); | 112 context->save(); |
113 | 113 |
114 if (resourceMode & ApplyToTextMode) | 114 if (resourceMode & ApplyToFillMode) |
115 context->setTextDrawingMode(resourceMode & ApplyToFillMode ? TextModeFil
l : TextModeStroke); | |
116 | |
117 if (resourceMode & ApplyToFillMode) { | |
118 context->setAlphaAsFloat(svgStyle.fillOpacity()); | |
119 context->setFillGradient(gradientData->gradient); | 115 context->setFillGradient(gradientData->gradient); |
120 context->setFillRule(svgStyle.fillRule()); | 116 else if (resourceMode & ApplyToStrokeMode) |
121 } else if (resourceMode & ApplyToStrokeMode) { | |
122 context->setAlphaAsFloat(svgStyle.strokeOpacity()); | |
123 context->setStrokeGradient(gradientData->gradient); | 117 context->setStrokeGradient(gradientData->gradient); |
124 SVGRenderSupport::applyStrokeStyleToContext(context, style, object); | |
125 } | |
126 | 118 |
127 return true; | 119 return true; |
128 } | 120 } |
129 | 121 |
130 void RenderSVGResourceGradient::postApplyResource(GraphicsContext* context) | 122 void RenderSVGResourceGradient::postApplyResource(GraphicsContext* context) |
131 { | 123 { |
132 ASSERT(context); | 124 ASSERT(context); |
133 context->restore(); | 125 context->restore(); |
134 } | 126 } |
135 | 127 |
(...skipping 16 matching lines...) Expand all Loading... |
152 return SpreadMethodReflect; | 144 return SpreadMethodReflect; |
153 case SVGSpreadMethodRepeat: | 145 case SVGSpreadMethodRepeat: |
154 return SpreadMethodRepeat; | 146 return SpreadMethodRepeat; |
155 } | 147 } |
156 | 148 |
157 ASSERT_NOT_REACHED(); | 149 ASSERT_NOT_REACHED(); |
158 return SpreadMethodPad; | 150 return SpreadMethodPad; |
159 } | 151 } |
160 | 152 |
161 } | 153 } |
OLD | NEW |