| OLD | NEW |
| 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 Loading... |
| 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); | |
| 69 | |
| 70 if (resourceMode & ApplyToTextMode) | |
| 71 context->setTextDrawingMode(TextModeStroke); | |
| 72 } | |
| 73 | |
| 74 return true; | 53 return true; |
| 75 } | 54 } |
| 76 | 55 |
| 77 } | 56 } |
| OLD | NEW |