| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 markAllClientsForInvalidation(markForInvalidation ? PaintInvalidation : Pare
ntOnlyInvalidation); | 43 markAllClientsForInvalidation(markForInvalidation ? PaintInvalidation : Pare
ntOnlyInvalidation); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void RenderSVGResourceGradient::removeClientFromCache(RenderObject* client, bool
markForInvalidation) | 46 void RenderSVGResourceGradient::removeClientFromCache(RenderObject* client, bool
markForInvalidation) |
| 47 { | 47 { |
| 48 ASSERT(client); | 48 ASSERT(client); |
| 49 m_gradientMap.remove(client); | 49 m_gradientMap.remove(client); |
| 50 markClientForInvalidation(client, markForInvalidation ? PaintInvalidation :
ParentOnlyInvalidation); | 50 markClientForInvalidation(client, markForInvalidation ? PaintInvalidation :
ParentOnlyInvalidation); |
| 51 } | 51 } |
| 52 | 52 |
| 53 bool RenderSVGResourceGradient::applyResource(RenderObject* object, RenderStyle*
style, GraphicsContext* context, RenderSVGResourceModeFlags resourceMode) | 53 bool RenderSVGResourceGradient::applyResource(RenderObject* object, RenderStyle*
style, GraphicsContext*& context, unsigned short resourceMode) |
| 54 { | 54 { |
| 55 ASSERT(object); | 55 ASSERT(object); |
| 56 ASSERT(style); | 56 ASSERT(style); |
| 57 ASSERT(context); | 57 ASSERT(context); |
| 58 | 58 |
| 59 clearInvalidationMask(); | 59 clearInvalidationMask(); |
| 60 | 60 |
| 61 // Be sure to synchronize all SVG properties on the gradientElement _before_
processing any further. | 61 // Be sure to synchronize all SVG properties on the gradientElement _before_
processing any further. |
| 62 // Otherwhise the call to collectGradientAttributes() in createTileImage(),
may cause the SVG DOM property | 62 // Otherwhise the call to collectGradientAttributes() in createTileImage(),
may cause the SVG DOM property |
| 63 // synchronization to kick in, which causes removeAllClientsFromCache() to b
e called, which in turn deletes our | 63 // synchronization to kick in, which causes removeAllClientsFromCache() to b
e called, which in turn deletes our |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 context->setFillRule(svgStyle.fillRule()); | 120 context->setFillRule(svgStyle.fillRule()); |
| 121 } else if (resourceMode & ApplyToStrokeMode) { | 121 } else if (resourceMode & ApplyToStrokeMode) { |
| 122 context->setAlphaAsFloat(svgStyle.strokeOpacity()); | 122 context->setAlphaAsFloat(svgStyle.strokeOpacity()); |
| 123 context->setStrokeGradient(gradientData->gradient); | 123 context->setStrokeGradient(gradientData->gradient); |
| 124 SVGRenderSupport::applyStrokeStyleToContext(context, style, object); | 124 SVGRenderSupport::applyStrokeStyleToContext(context, style, object); |
| 125 } | 125 } |
| 126 | 126 |
| 127 return true; | 127 return true; |
| 128 } | 128 } |
| 129 | 129 |
| 130 void RenderSVGResourceGradient::postApplyResource(GraphicsContext* context) | 130 void RenderSVGResourceGradient::postApplyResource(RenderObject*, GraphicsContext
*& context) |
| 131 { | 131 { |
| 132 ASSERT(context); | 132 ASSERT(context); |
| 133 context->restore(); | 133 context->restore(); |
| 134 } | 134 } |
| 135 | 135 |
| 136 void RenderSVGResourceGradient::addStops(GradientData* gradientData, const Vecto
r<Gradient::ColorStop>& stops) const | 136 void RenderSVGResourceGradient::addStops(GradientData* gradientData, const Vecto
r<Gradient::ColorStop>& stops) const |
| 137 { | 137 { |
| 138 ASSERT(gradientData->gradient); | 138 ASSERT(gradientData->gradient); |
| 139 | 139 |
| 140 const Vector<Gradient::ColorStop>::const_iterator end = stops.end(); | 140 const Vector<Gradient::ColorStop>::const_iterator end = stops.end(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 152 return SpreadMethodReflect; | 152 return SpreadMethodReflect; |
| 153 case SVGSpreadMethodRepeat: | 153 case SVGSpreadMethodRepeat: |
| 154 return SpreadMethodRepeat; | 154 return SpreadMethodRepeat; |
| 155 } | 155 } |
| 156 | 156 |
| 157 ASSERT_NOT_REACHED(); | 157 ASSERT_NOT_REACHED(); |
| 158 return SpreadMethodPad; | 158 return SpreadMethodPad; |
| 159 } | 159 } |
| 160 | 160 |
| 161 } | 161 } |
| OLD | NEW |