OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2009-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 |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 * Library General Public License for more details. | 12 * Library General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU Library General Public License | 14 * You should have received a copy of the GNU Library General Public License |
15 * along with this library; see the file COPYING.LIB. If not, write to | 15 * along with this library; see the file COPYING.LIB. If not, write to |
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
17 * Boston, MA 02110-1301, USA. | 17 * Boston, MA 02110-1301, USA. |
18 */ | 18 */ |
19 | 19 |
20 #ifndef RenderSVGResource_h | 20 #ifndef RenderSVGResource_h |
21 #define RenderSVGResource_h | 21 #define RenderSVGResource_h |
22 | 22 |
23 #include "platform/graphics/Color.h" | 23 #include "platform/graphics/Color.h" |
24 #include "platform/graphics/Gradient.h" | 24 #include "platform/graphics/Gradient.h" |
25 #include "platform/graphics/Pattern.h" | 25 #include "platform/graphics/Pattern.h" |
26 | 26 |
27 namespace blink { | 27 namespace blink { |
28 | 28 |
29 enum RenderSVGResourceType { | |
30 MaskerResourceType, | |
31 MarkerResourceType, | |
32 PatternResourceType, | |
33 LinearGradientResourceType, | |
34 RadialGradientResourceType, | |
35 FilterResourceType, | |
36 ClipperResourceType | |
37 }; | |
38 | |
39 enum RenderSVGResourceMode { | 29 enum RenderSVGResourceMode { |
40 ApplyToFillMode, | 30 ApplyToFillMode, |
41 ApplyToStrokeMode, | 31 ApplyToStrokeMode, |
42 }; | 32 }; |
43 | 33 |
44 class GraphicsContext; | 34 class GraphicsContext; |
45 class GraphicsContextStateSaver; | 35 class GraphicsContextStateSaver; |
46 class RenderObject; | 36 class RenderObject; |
47 class RenderSVGResource; | 37 class RenderSVGResource; |
48 class RenderStyle; | 38 class RenderStyle; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 bool hasFallback; | 73 bool hasFallback; |
84 }; | 74 }; |
85 | 75 |
86 class RenderSVGResource { | 76 class RenderSVGResource { |
87 public: | 77 public: |
88 RenderSVGResource() { } | 78 RenderSVGResource() { } |
89 virtual ~RenderSVGResource() { } | 79 virtual ~RenderSVGResource() { } |
90 | 80 |
91 virtual SVGPaintServer preparePaintServer(const RenderObject&); | 81 virtual SVGPaintServer preparePaintServer(const RenderObject&); |
92 | 82 |
93 virtual RenderSVGResourceType resourceType() const = 0; | |
94 | |
95 // Helper utilities used in to access the underlying resources for DRT. | 83 // Helper utilities used in to access the underlying resources for DRT. |
96 static SVGPaintDescription requestPaintDescription(const RenderObject&, cons
t RenderStyle*, RenderSVGResourceMode); | 84 static SVGPaintDescription requestPaintDescription(const RenderObject&, cons
t RenderStyle*, RenderSVGResourceMode); |
97 | 85 |
98 static void markForLayoutAndParentResourceInvalidation(RenderObject*, bool n
eedsLayout = true); | 86 static void markForLayoutAndParentResourceInvalidation(RenderObject*, bool n
eedsLayout = true); |
99 }; | 87 }; |
100 | 88 |
101 #define DEFINE_RENDER_SVG_RESOURCE_TYPE_CASTS(thisType, typeName) \ | |
102 DEFINE_TYPE_CASTS(thisType, RenderSVGResource, resource, resource->resourceT
ype() == typeName, resource.resourceType() == typeName) | |
103 | |
104 } | 89 } |
105 | 90 |
106 #endif | 91 #endif |
OLD | NEW |