| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2007 Rob Buis <buis@kde.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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 } | 42 } |
| 43 | 43 |
| 44 SVGPaintServer::SVGPaintServer(PassRefPtr<Pattern> pattern) | 44 SVGPaintServer::SVGPaintServer(PassRefPtr<Pattern> pattern) |
| 45 : m_pattern(pattern) | 45 : m_pattern(pattern) |
| 46 , m_color(Color::black) | 46 , m_color(Color::black) |
| 47 { | 47 { |
| 48 } | 48 } |
| 49 | 49 |
| 50 void SVGPaintServer::applyToSkPaint(SkPaint& paint, float paintAlpha) | 50 void SVGPaintServer::applyToSkPaint(SkPaint& paint, float paintAlpha) |
| 51 { | 51 { |
| 52 SkColor baseColor = m_gradient || m_pattern ? SK_ColorBLACK : m_color.rgb(); | 52 SkColor color = m_gradient || m_pattern ? SK_ColorBLACK : m_color.rgb(); |
| 53 paint.setColor(scaleAlpha(baseColor, paintAlpha)); | 53 color = scaleAlpha(color, paintAlpha); |
| 54 |
| 55 paint.setColor(Color::toDeviceColor(color).rgb()); |
| 54 if (m_pattern) { | 56 if (m_pattern) { |
| 55 m_pattern->applyToPaint(paint); | 57 m_pattern->applyToPaint(paint); |
| 56 } else if (m_gradient) { | 58 } else if (m_gradient) { |
| 57 m_gradient->applyToPaint(paint); | 59 m_gradient->applyToPaint(paint); |
| 58 } else { | 60 } else { |
| 59 paint.setShader(nullptr); | 61 paint.setShader(nullptr); |
| 60 } | 62 } |
| 61 } | 63 } |
| 62 | 64 |
| 63 void SVGPaintServer::prependTransform(const AffineTransform& transform) | 65 void SVGPaintServer::prependTransform(const AffineTransform& transform) |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 LayoutSVGResourcePaintServer::~LayoutSVGResourcePaintServer() | 177 LayoutSVGResourcePaintServer::~LayoutSVGResourcePaintServer() |
| 176 { | 178 { |
| 177 } | 179 } |
| 178 | 180 |
| 179 SVGPaintDescription LayoutSVGResourcePaintServer::requestPaintDescription(const
LayoutObject& layoutObject, const ComputedStyle& style, LayoutSVGResourceMode re
sourceMode) | 181 SVGPaintDescription LayoutSVGResourcePaintServer::requestPaintDescription(const
LayoutObject& layoutObject, const ComputedStyle& style, LayoutSVGResourceMode re
sourceMode) |
| 180 { | 182 { |
| 181 return requestPaint(layoutObject, style, resourceMode); | 183 return requestPaint(layoutObject, style, resourceMode); |
| 182 } | 184 } |
| 183 | 185 |
| 184 } | 186 } |
| OLD | NEW |