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

Side by Side Diff: Source/modules/canvas2d/HitRegion.h

Issue 1259973002: Canvas2d: Remove unnecessary conversion in EventHitRegion. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 months 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
« no previous file with comments | « Source/modules/canvas2d/EventHitRegion.cpp ('k') | Source/modules/canvas2d/HitRegion.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "modules/canvas2d/HitRegionOptions.h" 9 #include "modules/canvas2d/HitRegionOptions.h"
10 #include "platform/graphics/Path.h" 10 #include "platform/graphics/Path.h"
(...skipping 10 matching lines...) Expand all
21 public: 21 public:
22 static PassRefPtrWillBeRawPtr<HitRegion> create(const Path& path, const HitR egionOptions& options) 22 static PassRefPtrWillBeRawPtr<HitRegion> create(const Path& path, const HitR egionOptions& options)
23 { 23 {
24 return adoptRefWillBeNoop(new HitRegion(path, options)); 24 return adoptRefWillBeNoop(new HitRegion(path, options));
25 } 25 }
26 26
27 virtual ~HitRegion() { } 27 virtual ~HitRegion() { }
28 28
29 void removePixels(const Path&); 29 void removePixels(const Path&);
30 30
31 bool contains(const LayoutPoint&) const;
32 bool contains(const FloatPoint&) const; 31 bool contains(const FloatPoint&) const;
33 32
34 const String& id() const { return m_id; } 33 const String& id() const { return m_id; }
35 const Path& path() const { return m_path; } 34 const Path& path() const { return m_path; }
36 Element* control() const { return m_control.get(); } 35 Element* control() const { return m_control.get(); }
37 WindRule fillRule() const { return m_fillRule; } 36 WindRule fillRule() const { return m_fillRule; }
38 37
39 DECLARE_TRACE(); 38 DECLARE_TRACE();
40 39
41 private: 40 private:
(...skipping 14 matching lines...) Expand all
56 void addHitRegion(PassRefPtrWillBeRawPtr<HitRegion>); 55 void addHitRegion(PassRefPtrWillBeRawPtr<HitRegion>);
57 56
58 void removeHitRegion(HitRegion*); 57 void removeHitRegion(HitRegion*);
59 void removeHitRegionById(const String& id); 58 void removeHitRegionById(const String& id);
60 void removeHitRegionByControl(Element*); 59 void removeHitRegionByControl(Element*);
61 void removeHitRegionsInRect(const FloatRect&, const AffineTransform&); 60 void removeHitRegionsInRect(const FloatRect&, const AffineTransform&);
62 void removeAllHitRegions(); 61 void removeAllHitRegions();
63 62
64 HitRegion* getHitRegionById(const String& id) const; 63 HitRegion* getHitRegionById(const String& id) const;
65 HitRegion* getHitRegionByControl(Element*) const; 64 HitRegion* getHitRegionByControl(Element*) const;
66 HitRegion* getHitRegionAtPoint(const LayoutPoint&) const; 65 HitRegion* getHitRegionAtPoint(const FloatPoint&) const;
67 66
68 unsigned getHitRegionsCount() const; 67 unsigned getHitRegionsCount() const;
69 68
70 DECLARE_TRACE(); 69 DECLARE_TRACE();
71 70
72 private: 71 private:
73 HitRegionManager() { } 72 HitRegionManager() { }
74 73
75 typedef WillBeHeapListHashSet<RefPtrWillBeMember<HitRegion>> HitRegionList; 74 typedef WillBeHeapListHashSet<RefPtrWillBeMember<HitRegion>> HitRegionList;
76 typedef HitRegionList::const_reverse_iterator HitRegionIterator; 75 typedef HitRegionList::const_reverse_iterator HitRegionIterator;
77 typedef WillBeHeapHashMap<String, RefPtrWillBeMember<HitRegion>> HitRegionId Map; 76 typedef WillBeHeapHashMap<String, RefPtrWillBeMember<HitRegion>> HitRegionId Map;
78 typedef WillBeHeapHashMap<RefPtrWillBeMember<Element>, RefPtrWillBeMember<Hi tRegion>> HitRegionControlMap; 77 typedef WillBeHeapHashMap<RefPtrWillBeMember<Element>, RefPtrWillBeMember<Hi tRegion>> HitRegionControlMap;
79 78
80 HitRegionList m_hitRegionList; 79 HitRegionList m_hitRegionList;
81 HitRegionIdMap m_hitRegionIdMap; 80 HitRegionIdMap m_hitRegionIdMap;
82 HitRegionControlMap m_hitRegionControlMap; 81 HitRegionControlMap m_hitRegionControlMap;
83 }; 82 };
84 83
85 } // namespace blink 84 } // namespace blink
86 85
87 #endif 86 #endif
OLDNEW
« no previous file with comments | « Source/modules/canvas2d/EventHitRegion.cpp ('k') | Source/modules/canvas2d/HitRegion.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698