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

Side by Side Diff: Source/core/rendering/svg/RenderSVGResourcePattern.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) Research In Motion Limited 2010. All rights reserved. 3 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 if (!patternData) 151 if (!patternData)
152 return false; 152 return false;
153 153
154 // Draw pattern 154 // Draw pattern
155 context->save(); 155 context->save();
156 156
157 const SVGRenderStyle* svgStyle = style->svgStyle(); 157 const SVGRenderStyle* svgStyle = style->svgStyle();
158 ASSERT(svgStyle); 158 ASSERT(svgStyle);
159 159
160 if (resourceMode & ApplyToFillMode) { 160 if (resourceMode & ApplyToFillMode) {
161 context->setAlpha(svgStyle->fillOpacity()); 161 context->setAlphaAsFloat(svgStyle->fillOpacity());
162 context->setFillPattern(patternData->pattern); 162 context->setFillPattern(patternData->pattern);
163 context->setFillRule(svgStyle->fillRule()); 163 context->setFillRule(svgStyle->fillRule());
164 } else if (resourceMode & ApplyToStrokeMode) { 164 } else if (resourceMode & ApplyToStrokeMode) {
165 if (svgStyle->vectorEffect() == VE_NON_SCALING_STROKE) 165 if (svgStyle->vectorEffect() == VE_NON_SCALING_STROKE)
166 patternData->pattern->setPatternSpaceTransform(transformOnNonScaling Stroke(object, patternData->transform)); 166 patternData->pattern->setPatternSpaceTransform(transformOnNonScaling Stroke(object, patternData->transform));
167 context->setAlpha(svgStyle->strokeOpacity()); 167 context->setAlphaAsFloat(svgStyle->strokeOpacity());
168 context->setStrokePattern(patternData->pattern); 168 context->setStrokePattern(patternData->pattern);
169 SVGRenderSupport::applyStrokeStyleToContext(context, style, object); 169 SVGRenderSupport::applyStrokeStyleToContext(context, style, object);
170 } 170 }
171 171
172 if (resourceMode & ApplyToTextMode) { 172 if (resourceMode & ApplyToTextMode) {
173 if (resourceMode & ApplyToFillMode) 173 if (resourceMode & ApplyToFillMode)
174 context->setTextDrawingMode(TextModeFill); 174 context->setTextDrawingMode(TextModeFill);
175 else if (resourceMode & ApplyToStrokeMode) 175 else if (resourceMode & ApplyToStrokeMode)
176 context->setTextDrawingMode(TextModeStroke); 176 context->setTextDrawingMode(TextModeStroke);
177 } 177 }
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 continue; 271 continue;
272 if (element->renderer()->needsLayout()) 272 if (element->renderer()->needsLayout())
273 return nullptr; 273 return nullptr;
274 SVGRenderingContext::renderSubtree(tileImage->context(), element->render er(), contentTransformation); 274 SVGRenderingContext::renderSubtree(tileImage->context(), element->render er(), contentTransformation);
275 } 275 }
276 276
277 return tileImage.release(); 277 return tileImage.release();
278 } 278 }
279 279
280 } 280 }
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGResourceGradient.cpp ('k') | Source/core/rendering/svg/RenderSVGResourceSolidColor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698