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

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: Move updateGraphicsContext. 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); 115 context->setFillGradient(gradientData->gradient);
116 else if (resourceMode & ApplyToStrokeMode)
117 context->setStrokeGradient(gradientData->gradient);
116 118
117 if (resourceMode & ApplyToFillMode) { 119 updateGraphicsContext(context, style, *object, resourceMode);
118 context->setAlphaAsFloat(svgStyle.fillOpacity());
119 context->setFillGradient(gradientData->gradient);
120 context->setFillRule(svgStyle.fillRule());
121 } else if (resourceMode & ApplyToStrokeMode) {
122 context->setAlphaAsFloat(svgStyle.strokeOpacity());
123 context->setStrokeGradient(gradientData->gradient);
124 SVGRenderSupport::applyStrokeStyleToContext(context, style, object);
125 }
126
127 return true; 120 return true;
128 } 121 }
129 122
130 void RenderSVGResourceGradient::postApplyResource(GraphicsContext* context) 123 void RenderSVGResourceGradient::postApplyResource(GraphicsContext* context)
131 { 124 {
132 ASSERT(context); 125 ASSERT(context);
133 context->restore(); 126 context->restore();
134 } 127 }
135 128
136 void RenderSVGResourceGradient::addStops(GradientData* gradientData, const Vecto r<Gradient::ColorStop>& stops) const 129 void RenderSVGResourceGradient::addStops(GradientData* gradientData, const Vecto r<Gradient::ColorStop>& stops) const
(...skipping 15 matching lines...) Expand all
152 return SpreadMethodReflect; 145 return SpreadMethodReflect;
153 case SVGSpreadMethodRepeat: 146 case SVGSpreadMethodRepeat:
154 return SpreadMethodRepeat; 147 return SpreadMethodRepeat;
155 } 148 }
156 149
157 ASSERT_NOT_REACHED(); 150 ASSERT_NOT_REACHED();
158 return SpreadMethodPad; 151 return SpreadMethodPad;
159 } 152 }
160 153
161 } 154 }
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGResource.cpp ('k') | Source/core/rendering/svg/RenderSVGResourcePattern.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698