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

Side by Side Diff: Source/core/rendering/svg/SVGResources.h

Issue 673753004: Move RenderSVGResource into the inheritance hierarchy (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Non-move changes. Created 6 years, 1 month 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
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 16 matching lines...) Expand all
27 #include "wtf/PassOwnPtr.h" 27 #include "wtf/PassOwnPtr.h"
28 28
29 namespace blink { 29 namespace blink {
30 30
31 class RenderObject; 31 class RenderObject;
32 class RenderSVGResourceClipper; 32 class RenderSVGResourceClipper;
33 class RenderSVGResourceContainer; 33 class RenderSVGResourceContainer;
34 class RenderSVGResourceFilter; 34 class RenderSVGResourceFilter;
35 class RenderSVGResourceMarker; 35 class RenderSVGResourceMarker;
36 class RenderSVGResourceMasker; 36 class RenderSVGResourceMasker;
37 class RenderSVGResourcePaintServer;
37 class SVGElement; 38 class SVGElement;
38 class SVGRenderStyle; 39 class SVGRenderStyle;
39 40
40 // Holds a set of resources associated with a RenderObject 41 // Holds a set of resources associated with a RenderObject
41 class SVGResources { 42 class SVGResources {
42 WTF_MAKE_NONCOPYABLE(SVGResources); WTF_MAKE_FAST_ALLOCATED; 43 WTF_MAKE_NONCOPYABLE(SVGResources); WTF_MAKE_FAST_ALLOCATED;
43 public: 44 public:
44 SVGResources(); 45 SVGResources();
45 46
46 static PassOwnPtr<SVGResources> buildResources(const RenderObject*, const SV GRenderStyle&); 47 static PassOwnPtr<SVGResources> buildResources(const RenderObject*, const SV GRenderStyle&);
47 void layoutIfNeeded(); 48 void layoutIfNeeded();
48 49
49 static bool supportsMarkers(const SVGElement&); 50 static bool supportsMarkers(const SVGElement&);
50 51
51 // Ordinary resources 52 // Ordinary resources
52 RenderSVGResourceClipper* clipper() const { return m_clipperFilterMaskerData ? m_clipperFilterMaskerData->clipper : 0; } 53 RenderSVGResourceClipper* clipper() const { return m_clipperFilterMaskerData ? m_clipperFilterMaskerData->clipper : 0; }
53 RenderSVGResourceMarker* markerStart() const { return m_markerData ? m_marke rData->markerStart : 0; } 54 RenderSVGResourceMarker* markerStart() const { return m_markerData ? m_marke rData->markerStart : 0; }
54 RenderSVGResourceMarker* markerMid() const { return m_markerData ? m_markerD ata->markerMid : 0; } 55 RenderSVGResourceMarker* markerMid() const { return m_markerData ? m_markerD ata->markerMid : 0; }
55 RenderSVGResourceMarker* markerEnd() const { return m_markerData ? m_markerD ata->markerEnd : 0; } 56 RenderSVGResourceMarker* markerEnd() const { return m_markerData ? m_markerD ata->markerEnd : 0; }
56 RenderSVGResourceMasker* masker() const { return m_clipperFilterMaskerData ? m_clipperFilterMaskerData->masker : 0; } 57 RenderSVGResourceMasker* masker() const { return m_clipperFilterMaskerData ? m_clipperFilterMaskerData->masker : 0; }
57 58
58 RenderSVGResourceFilter* filter() const 59 RenderSVGResourceFilter* filter() const
59 { 60 {
60 if (m_clipperFilterMaskerData) 61 if (m_clipperFilterMaskerData)
61 return m_clipperFilterMaskerData->filter; 62 return m_clipperFilterMaskerData->filter;
62 return 0; 63 return 0;
63 } 64 }
64 65
65 // Paint servers 66 // Paint servers
66 RenderSVGResourceContainer* fill() const { return m_fillStrokeData ? m_fillS trokeData->fill : 0; } 67 RenderSVGResourcePaintServer* fill() const { return m_fillStrokeData ? m_fil lStrokeData->fill : 0; }
67 RenderSVGResourceContainer* stroke() const { return m_fillStrokeData ? m_fil lStrokeData->stroke : 0; } 68 RenderSVGResourcePaintServer* stroke() const { return m_fillStrokeData ? m_f illStrokeData->stroke : 0; }
68 69
69 // Chainable resources - linked through xlink:href 70 // Chainable resources - linked through xlink:href
70 RenderSVGResourceContainer* linkedResource() const { return m_linkedResource ; } 71 RenderSVGResourceContainer* linkedResource() const { return m_linkedResource ; }
71 72
72 void buildSetOfResources(HashSet<RenderSVGResourceContainer*>&); 73 void buildSetOfResources(HashSet<RenderSVGResourceContainer*>&);
73 74
74 // Methods operating on all cached resources 75 // Methods operating on all cached resources
75 void removeClientFromCache(RenderObject*, bool markForInvalidation = true) c onst; 76 void removeClientFromCache(RenderObject*, bool markForInvalidation = true) c onst;
76 void resourceDestroyed(RenderSVGResourceContainer*); 77 void resourceDestroyed(RenderSVGResourceContainer*);
77 78
(...skipping 16 matching lines...) Expand all
94 void resetFill(); 95 void resetFill();
95 void resetStroke(); 96 void resetStroke();
96 void resetLinkedResource(); 97 void resetLinkedResource();
97 98
98 bool setClipper(RenderSVGResourceClipper*); 99 bool setClipper(RenderSVGResourceClipper*);
99 bool setFilter(RenderSVGResourceFilter*); 100 bool setFilter(RenderSVGResourceFilter*);
100 bool setMarkerStart(RenderSVGResourceMarker*); 101 bool setMarkerStart(RenderSVGResourceMarker*);
101 bool setMarkerMid(RenderSVGResourceMarker*); 102 bool setMarkerMid(RenderSVGResourceMarker*);
102 bool setMarkerEnd(RenderSVGResourceMarker*); 103 bool setMarkerEnd(RenderSVGResourceMarker*);
103 bool setMasker(RenderSVGResourceMasker*); 104 bool setMasker(RenderSVGResourceMasker*);
104 bool setFill(RenderSVGResourceContainer*); 105 bool setFill(RenderSVGResourcePaintServer*);
105 bool setStroke(RenderSVGResourceContainer*); 106 bool setStroke(RenderSVGResourcePaintServer*);
106 bool setLinkedResource(RenderSVGResourceContainer*); 107 bool setLinkedResource(RenderSVGResourceContainer*);
107 108
108 // From SVG 1.1 2nd Edition 109 // From SVG 1.1 2nd Edition
109 // clipper: 'container elements' and 'graphics elements' 110 // clipper: 'container elements' and 'graphics elements'
110 // filter: 'container elements' and 'graphics elements' 111 // filter: 'container elements' and 'graphics elements'
111 // masker: 'container elements' and 'graphics elements' 112 // masker: 'container elements' and 'graphics elements'
112 // -> a, circle, defs, ellipse, glyph, g, image, line, marker, mask, missing -glyph, path, pattern, polygon, polyline, rect, svg, switch, symbol, text, use 113 // -> a, circle, defs, ellipse, glyph, g, image, line, marker, mask, missing -glyph, path, pattern, polygon, polyline, rect, svg, switch, symbol, text, use
113 struct ClipperFilterMaskerData { 114 struct ClipperFilterMaskerData {
114 WTF_MAKE_FAST_ALLOCATED; 115 WTF_MAKE_FAST_ALLOCATED;
115 public: 116 public:
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 : fill(0) 164 : fill(0)
164 , stroke(0) 165 , stroke(0)
165 { 166 {
166 } 167 }
167 168
168 static PassOwnPtr<FillStrokeData> create() 169 static PassOwnPtr<FillStrokeData> create()
169 { 170 {
170 return adoptPtr(new FillStrokeData); 171 return adoptPtr(new FillStrokeData);
171 } 172 }
172 173
173 RenderSVGResourceContainer* fill; 174 RenderSVGResourcePaintServer* fill;
174 RenderSVGResourceContainer* stroke; 175 RenderSVGResourcePaintServer* stroke;
175 }; 176 };
176 177
177 OwnPtr<ClipperFilterMaskerData> m_clipperFilterMaskerData; 178 OwnPtr<ClipperFilterMaskerData> m_clipperFilterMaskerData;
178 OwnPtr<MarkerData> m_markerData; 179 OwnPtr<MarkerData> m_markerData;
179 OwnPtr<FillStrokeData> m_fillStrokeData; 180 OwnPtr<FillStrokeData> m_fillStrokeData;
180 RenderSVGResourceContainer* m_linkedResource; 181 RenderSVGResourceContainer* m_linkedResource;
181 }; 182 };
182 183
183 } 184 }
184 185
185 #endif 186 #endif
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/SVGRenderTreeAsText.cpp ('k') | Source/core/rendering/svg/SVGResources.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698