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

Side by Side Diff: Source/core/rendering/svg/RenderSVGResourceSolidColor.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
« no previous file with comments | « Source/core/rendering/svg/RenderSVGResourcePattern.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 22 matching lines...) Expand all
33 RenderSVGResourceSolidColor::RenderSVGResourceSolidColor() 33 RenderSVGResourceSolidColor::RenderSVGResourceSolidColor()
34 { 34 {
35 } 35 }
36 36
37 RenderSVGResourceSolidColor::~RenderSVGResourceSolidColor() 37 RenderSVGResourceSolidColor::~RenderSVGResourceSolidColor()
38 { 38 {
39 } 39 }
40 40
41 bool RenderSVGResourceSolidColor::applyResource(RenderObject* object, RenderStyl e* style, GraphicsContext* context, RenderSVGResourceModeFlags resourceMode) 41 bool RenderSVGResourceSolidColor::applyResource(RenderObject* object, RenderStyl e* style, GraphicsContext* context, RenderSVGResourceModeFlags resourceMode)
42 { 42 {
43 ASSERT(object); 43 ASSERT_UNUSED(object, object);
44 ASSERT(style); 44 ASSERT_UNUSED(style, style);
45 ASSERT(context); 45 ASSERT(context);
46 ASSERT_UNUSED(resourceMode, resourceMode); 46 ASSERT_UNUSED(resourceMode, resourceMode);
47 47
48 bool isRenderingMask = SVGRenderSupport::isRenderingClipPathAsMaskImage(*obj ect); 48 if (resourceMode & ApplyToFillMode)
49 const SVGRenderStyle& svgStyle = style->svgStyle();
50
51 if (resourceMode & ApplyToFillMode) {
52 if (!isRenderingMask)
53 context->setAlphaAsFloat(svgStyle.fillOpacity());
54 else
55 context->setAlphaAsFloat(1);
56 context->setFillColor(m_color); 49 context->setFillColor(m_color);
57 if (!isRenderingMask) 50 else if (resourceMode & ApplyToStrokeMode)
58 context->setFillRule(svgStyle.fillRule());
59
60 if (resourceMode & ApplyToTextMode)
61 context->setTextDrawingMode(TextModeFill);
62 } else if (resourceMode & ApplyToStrokeMode) {
63 // When rendering the mask for a RenderSVGResourceClipper, the stroke co de path is never hit.
64 ASSERT(!isRenderingMask);
65 context->setAlphaAsFloat(svgStyle.strokeOpacity());
66 context->setStrokeColor(m_color); 51 context->setStrokeColor(m_color);
67 52
68 SVGRenderSupport::applyStrokeStyleToContext(context, style, object); 53 updateGraphicsContext(context, style, *object, resourceMode);
69
70 if (resourceMode & ApplyToTextMode)
71 context->setTextDrawingMode(TextModeStroke);
72 }
73
74 return true; 54 return true;
75 } 55 }
76 56
77 } 57 }
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGResourcePattern.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698