OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef HitRegion_h | 5 #ifndef HitRegion_h |
6 #define HitRegion_h | 6 #define HitRegion_h |
7 | 7 |
8 #include "core/dom/Element.h" | 8 #include "core/dom/Element.h" |
9 #include "core/html/canvas/HitRegionOptions.h" | 9 #include "core/html/canvas/HitRegionOptions.h" |
10 #include "platform/graphics/Path.h" | 10 #include "platform/graphics/Path.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 void updateAccessibility(Element* canvas); | 30 void updateAccessibility(Element* canvas); |
31 | 31 |
32 bool contains(const LayoutPoint&) const; | 32 bool contains(const LayoutPoint&) const; |
33 bool contains(const FloatPoint&) const; | 33 bool contains(const FloatPoint&) const; |
34 | 34 |
35 const String& id() const { return m_id; } | 35 const String& id() const { return m_id; } |
36 const Path& path() const { return m_path; } | 36 const Path& path() const { return m_path; } |
37 Element* control() const { return m_control.get(); } | 37 Element* control() const { return m_control.get(); } |
38 WindRule fillRule() const { return m_fillRule; } | 38 WindRule fillRule() const { return m_fillRule; } |
39 | 39 |
40 void trace(Visitor*); | 40 DECLARE_TRACE(); |
41 | 41 |
42 private: | 42 private: |
43 HitRegion(const Path&, const HitRegionOptions&); | 43 HitRegion(const Path&, const HitRegionOptions&); |
44 | 44 |
45 String m_id; | 45 String m_id; |
46 RefPtrWillBeMember<Element> m_control; | 46 RefPtrWillBeMember<Element> m_control; |
47 Path m_path; | 47 Path m_path; |
48 WindRule m_fillRule; | 48 WindRule m_fillRule; |
49 }; | 49 }; |
50 | 50 |
(...skipping 10 matching lines...) Expand all Loading... |
61 void removeHitRegionByControl(Element*); | 61 void removeHitRegionByControl(Element*); |
62 void removeHitRegionsInRect(const FloatRect&, const AffineTransform&); | 62 void removeHitRegionsInRect(const FloatRect&, const AffineTransform&); |
63 void removeAllHitRegions(); | 63 void removeAllHitRegions(); |
64 | 64 |
65 HitRegion* getHitRegionById(const String& id) const; | 65 HitRegion* getHitRegionById(const String& id) const; |
66 HitRegion* getHitRegionByControl(Element*) const; | 66 HitRegion* getHitRegionByControl(Element*) const; |
67 HitRegion* getHitRegionAtPoint(const LayoutPoint&) const; | 67 HitRegion* getHitRegionAtPoint(const LayoutPoint&) const; |
68 | 68 |
69 unsigned getHitRegionsCount() const; | 69 unsigned getHitRegionsCount() const; |
70 | 70 |
71 void trace(Visitor*); | 71 DECLARE_TRACE(); |
72 | 72 |
73 private: | 73 private: |
74 HitRegionManager() { } | 74 HitRegionManager() { } |
75 | 75 |
76 typedef WillBeHeapListHashSet<RefPtrWillBeMember<HitRegion>> HitRegionList; | 76 typedef WillBeHeapListHashSet<RefPtrWillBeMember<HitRegion>> HitRegionList; |
77 typedef HitRegionList::const_reverse_iterator HitRegionIterator; | 77 typedef HitRegionList::const_reverse_iterator HitRegionIterator; |
78 typedef WillBeHeapHashMap<String, RefPtrWillBeMember<HitRegion>> HitRegionId
Map; | 78 typedef WillBeHeapHashMap<String, RefPtrWillBeMember<HitRegion>> HitRegionId
Map; |
79 typedef WillBeHeapHashMap<RefPtrWillBeMember<Element>, RefPtrWillBeMember<Hi
tRegion>> HitRegionControlMap; | 79 typedef WillBeHeapHashMap<RefPtrWillBeMember<Element>, RefPtrWillBeMember<Hi
tRegion>> HitRegionControlMap; |
80 | 80 |
81 HitRegionList m_hitRegionList; | 81 HitRegionList m_hitRegionList; |
82 HitRegionIdMap m_hitRegionIdMap; | 82 HitRegionIdMap m_hitRegionIdMap; |
83 HitRegionControlMap m_hitRegionControlMap; | 83 HitRegionControlMap m_hitRegionControlMap; |
84 }; | 84 }; |
85 | 85 |
86 } // namespace blink | 86 } // namespace blink |
87 | 87 |
88 #endif | 88 #endif |
OLD | NEW |