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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 } | 112 } |
113 } | 113 } |
114 | 114 |
115 // If the primary resource is just a color, return immediately. | 115 // If the primary resource is just a color, return immediately. |
116 if (paintType < SVG_PAINTTYPE_URI_NONE) { | 116 if (paintType < SVG_PAINTTYPE_URI_NONE) { |
117 // |paintType| will be either <current-color> or <rgb-color> here - both
of which will have a color. | 117 // |paintType| will be either <current-color> or <rgb-color> here - both
of which will have a color. |
118 ASSERT(hasColor); | 118 ASSERT(hasColor); |
119 return SVGPaintDescription(color); | 119 return SVGPaintDescription(color); |
120 } | 120 } |
121 | 121 |
122 LayoutSVGResourcePaintServer* uriResource = 0; | 122 LayoutSVGResourcePaintServer* uriResource = nullptr; |
123 if (SVGResources* resources = SVGResourcesCache::cachedResourcesForLayoutObj
ect(&object)) | 123 if (SVGResources* resources = SVGResourcesCache::cachedResourcesForLayoutObj
ect(&object)) |
124 uriResource = applyToFill ? resources->fill() : resources->stroke(); | 124 uriResource = applyToFill ? resources->fill() : resources->stroke(); |
125 | 125 |
126 // If the requested resource is not available, return the color resource or
'none'. | 126 // If the requested resource is not available, return the color resource or
'none'. |
127 if (!uriResource) { | 127 if (!uriResource) { |
128 // The fallback is 'none'. (SVG2 say 'none' is implied when no fallback
is specified.) | 128 // The fallback is 'none'. (SVG2 say 'none' is implied when no fallback
is specified.) |
129 if (paintType == SVG_PAINTTYPE_URI_NONE || !hasColor) | 129 if (paintType == SVG_PAINTTYPE_URI_NONE || !hasColor) |
130 return SVGPaintDescription(); | 130 return SVGPaintDescription(); |
131 | 131 |
132 return SVGPaintDescription(color); | 132 return SVGPaintDescription(color); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 LayoutSVGResourcePaintServer::~LayoutSVGResourcePaintServer() | 171 LayoutSVGResourcePaintServer::~LayoutSVGResourcePaintServer() |
172 { | 172 { |
173 } | 173 } |
174 | 174 |
175 SVGPaintDescription LayoutSVGResourcePaintServer::requestPaintDescription(const
LayoutObject& layoutObject, const ComputedStyle& style, LayoutSVGResourceMode re
sourceMode) | 175 SVGPaintDescription LayoutSVGResourcePaintServer::requestPaintDescription(const
LayoutObject& layoutObject, const ComputedStyle& style, LayoutSVGResourceMode re
sourceMode) |
176 { | 176 { |
177 return requestPaint(layoutObject, style, resourceMode); | 177 return requestPaint(layoutObject, style, resourceMode); |
178 } | 178 } |
179 | 179 |
180 } | 180 } |
OLD | NEW |