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

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

Issue 169283008: Maintain SkPaint in GraphicsContextState. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: A couple more optimizations. Created 6 years, 9 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 // Draw gradient 117 // Draw gradient
118 context->save(); 118 context->save();
119 119
120 if (isPaintingText) 120 if (isPaintingText)
121 context->setTextDrawingMode(resourceMode & ApplyToFillMode ? TextModeFil l : TextModeStroke); 121 context->setTextDrawingMode(resourceMode & ApplyToFillMode ? TextModeFil l : TextModeStroke);
122 122
123 const SVGRenderStyle* svgStyle = style->svgStyle(); 123 const SVGRenderStyle* svgStyle = style->svgStyle();
124 ASSERT(svgStyle); 124 ASSERT(svgStyle);
125 125
126 if (resourceMode & ApplyToFillMode) { 126 if (resourceMode & ApplyToFillMode) {
127 context->setAlpha(svgStyle->fillOpacity()); 127 context->setAlphaAsFloat(svgStyle->fillOpacity());
128 context->setFillGradient(gradientData->gradient); 128 context->setFillGradient(gradientData->gradient);
129 context->setFillRule(svgStyle->fillRule()); 129 context->setFillRule(svgStyle->fillRule());
130 } else if (resourceMode & ApplyToStrokeMode) { 130 } else if (resourceMode & ApplyToStrokeMode) {
131 if (svgStyle->vectorEffect() == VE_NON_SCALING_STROKE) 131 if (svgStyle->vectorEffect() == VE_NON_SCALING_STROKE)
132 gradientData->gradient->setGradientSpaceTransform(transformOnNonScal ingStroke(object, gradientData->userspaceTransform)); 132 gradientData->gradient->setGradientSpaceTransform(transformOnNonScal ingStroke(object, gradientData->userspaceTransform));
133 context->setAlpha(svgStyle->strokeOpacity()); 133 context->setAlphaAsFloat(svgStyle->strokeOpacity());
134 context->setStrokeGradient(gradientData->gradient); 134 context->setStrokeGradient(gradientData->gradient);
135 SVGRenderSupport::applyStrokeStyleToContext(context, style, object); 135 SVGRenderSupport::applyStrokeStyleToContext(context, style, object);
136 } 136 }
137 137
138 return true; 138 return true;
139 } 139 }
140 140
141 void RenderSVGResourceGradient::postApplyResource(RenderObject*, GraphicsContext *& context, unsigned short resourceMode, const Path* path, const RenderSVGShape* shape) 141 void RenderSVGResourceGradient::postApplyResource(RenderObject*, GraphicsContext *& context, unsigned short resourceMode, const Path* path, const RenderSVGShape* shape)
142 { 142 {
143 ASSERT(context); 143 ASSERT(context);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 return SpreadMethodReflect; 178 return SpreadMethodReflect;
179 case SVGSpreadMethodRepeat: 179 case SVGSpreadMethodRepeat:
180 return SpreadMethodRepeat; 180 return SpreadMethodRepeat;
181 } 181 }
182 182
183 ASSERT_NOT_REACHED(); 183 ASSERT_NOT_REACHED();
184 return SpreadMethodPad; 184 return SpreadMethodPad;
185 } 185 }
186 186
187 } 187 }
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderEmbeddedObject.cpp ('k') | Source/core/rendering/svg/RenderSVGResourcePattern.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698