Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Side by Side Diff: Source/core/rendering/svg/RenderSVGResourceGradient.cpp

Issue 630903003: Move common GC state update code out of paint-server application (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | Source/core/rendering/svg/RenderSVGResourcePattern.cpp » ('j') | Source/core/rendering/svg/RenderSVGShape.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698