| 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 10 matching lines...) Expand all Loading... |
| 21 #define SVGResources_h | 21 #define SVGResources_h |
| 22 | 22 |
| 23 #include "wtf/FastAllocBase.h" | 23 #include "wtf/FastAllocBase.h" |
| 24 #include "wtf/HashSet.h" | 24 #include "wtf/HashSet.h" |
| 25 #include "wtf/Noncopyable.h" | 25 #include "wtf/Noncopyable.h" |
| 26 #include "wtf/OwnPtr.h" | 26 #include "wtf/OwnPtr.h" |
| 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 LayoutObject; |
| 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 RenderSVGResourcePaintServer; |
| 38 class SVGElement; | 38 class SVGElement; |
| 39 class SVGRenderStyle; | 39 class SVGRenderStyle; |
| 40 | 40 |
| 41 // Holds a set of resources associated with a RenderObject | 41 // Holds a set of resources associated with a LayoutObject |
| 42 class SVGResources { | 42 class SVGResources { |
| 43 WTF_MAKE_NONCOPYABLE(SVGResources); WTF_MAKE_FAST_ALLOCATED; | 43 WTF_MAKE_NONCOPYABLE(SVGResources); WTF_MAKE_FAST_ALLOCATED; |
| 44 public: | 44 public: |
| 45 SVGResources(); | 45 SVGResources(); |
| 46 | 46 |
| 47 static PassOwnPtr<SVGResources> buildResources(const RenderObject*, const SV
GRenderStyle&); | 47 static PassOwnPtr<SVGResources> buildResources(const LayoutObject*, const SV
GRenderStyle&); |
| 48 void layoutIfNeeded(); | 48 void layoutIfNeeded(); |
| 49 | 49 |
| 50 static bool supportsMarkers(const SVGElement&); | 50 static bool supportsMarkers(const SVGElement&); |
| 51 | 51 |
| 52 // Ordinary resources | 52 // Ordinary resources |
| 53 RenderSVGResourceClipper* clipper() const { return m_clipperFilterMaskerData
? m_clipperFilterMaskerData->clipper : 0; } | 53 RenderSVGResourceClipper* clipper() const { return m_clipperFilterMaskerData
? m_clipperFilterMaskerData->clipper : 0; } |
| 54 RenderSVGResourceMarker* markerStart() const { return m_markerData ? m_marke
rData->markerStart : 0; } | 54 RenderSVGResourceMarker* markerStart() const { return m_markerData ? m_marke
rData->markerStart : 0; } |
| 55 RenderSVGResourceMarker* markerMid() const { return m_markerData ? m_markerD
ata->markerMid : 0; } | 55 RenderSVGResourceMarker* markerMid() const { return m_markerData ? m_markerD
ata->markerMid : 0; } |
| 56 RenderSVGResourceMarker* markerEnd() const { return m_markerData ? m_markerD
ata->markerEnd : 0; } | 56 RenderSVGResourceMarker* markerEnd() const { return m_markerData ? m_markerD
ata->markerEnd : 0; } |
| 57 RenderSVGResourceMasker* masker() const { return m_clipperFilterMaskerData ?
m_clipperFilterMaskerData->masker : 0; } | 57 RenderSVGResourceMasker* masker() const { return m_clipperFilterMaskerData ?
m_clipperFilterMaskerData->masker : 0; } |
| 58 | 58 |
| 59 RenderSVGResourceFilter* filter() const | 59 RenderSVGResourceFilter* filter() const |
| 60 { | 60 { |
| 61 if (m_clipperFilterMaskerData) | 61 if (m_clipperFilterMaskerData) |
| 62 return m_clipperFilterMaskerData->filter; | 62 return m_clipperFilterMaskerData->filter; |
| 63 return 0; | 63 return 0; |
| 64 } | 64 } |
| 65 | 65 |
| 66 // Paint servers | 66 // Paint servers |
| 67 RenderSVGResourcePaintServer* fill() const { return m_fillStrokeData ? m_fil
lStrokeData->fill : 0; } | 67 RenderSVGResourcePaintServer* fill() const { return m_fillStrokeData ? m_fil
lStrokeData->fill : 0; } |
| 68 RenderSVGResourcePaintServer* stroke() const { return m_fillStrokeData ? m_f
illStrokeData->stroke : 0; } | 68 RenderSVGResourcePaintServer* stroke() const { return m_fillStrokeData ? m_f
illStrokeData->stroke : 0; } |
| 69 | 69 |
| 70 // Chainable resources - linked through xlink:href | 70 // Chainable resources - linked through xlink:href |
| 71 RenderSVGResourceContainer* linkedResource() const { return m_linkedResource
; } | 71 RenderSVGResourceContainer* linkedResource() const { return m_linkedResource
; } |
| 72 | 72 |
| 73 void buildSetOfResources(HashSet<RenderSVGResourceContainer*>&); | 73 void buildSetOfResources(HashSet<RenderSVGResourceContainer*>&); |
| 74 | 74 |
| 75 // Methods operating on all cached resources | 75 // Methods operating on all cached resources |
| 76 void removeClientFromCache(RenderObject*, bool markForInvalidation = true) c
onst; | 76 void removeClientFromCache(LayoutObject*, bool markForInvalidation = true) c
onst; |
| 77 void resourceDestroyed(RenderSVGResourceContainer*); | 77 void resourceDestroyed(RenderSVGResourceContainer*); |
| 78 | 78 |
| 79 #ifndef NDEBUG | 79 #ifndef NDEBUG |
| 80 void dump(const RenderObject*); | 80 void dump(const LayoutObject*); |
| 81 #endif | 81 #endif |
| 82 | 82 |
| 83 private: | 83 private: |
| 84 friend class SVGResourcesCycleSolver; | 84 friend class SVGResourcesCycleSolver; |
| 85 | 85 |
| 86 bool hasResourceData() const; | 86 bool hasResourceData() const; |
| 87 | 87 |
| 88 // Only used by SVGResourcesCache cycle detection logic | 88 // Only used by SVGResourcesCache cycle detection logic |
| 89 void resetClipper(); | 89 void resetClipper(); |
| 90 void resetFilter(); | 90 void resetFilter(); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 | 177 |
| 178 OwnPtr<ClipperFilterMaskerData> m_clipperFilterMaskerData; | 178 OwnPtr<ClipperFilterMaskerData> m_clipperFilterMaskerData; |
| 179 OwnPtr<MarkerData> m_markerData; | 179 OwnPtr<MarkerData> m_markerData; |
| 180 OwnPtr<FillStrokeData> m_fillStrokeData; | 180 OwnPtr<FillStrokeData> m_fillStrokeData; |
| 181 RenderSVGResourceContainer* m_linkedResource; | 181 RenderSVGResourceContainer* m_linkedResource; |
| 182 }; | 182 }; |
| 183 | 183 |
| 184 } | 184 } |
| 185 | 185 |
| 186 #endif | 186 #endif |
| OLD | NEW |