| 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 #include "config.h" | 5 #include "config.h" |
| 6 #include "core/html/canvas/HitRegion.h" | 6 #include "core/html/canvas/HitRegion.h" |
| 7 | 7 |
| 8 #include "core/rendering/RenderBoxModelObject.h" | 8 #include "core/rendering/RenderBoxModelObject.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 bool HitRegion::contains(const LayoutPoint& point) const | 24 bool HitRegion::contains(const LayoutPoint& point) const |
| 25 { | 25 { |
| 26 return m_path.contains(point, m_fillRule); | 26 return m_path.contains(point, m_fillRule); |
| 27 } | 27 } |
| 28 | 28 |
| 29 void HitRegion::removePixels(const Path& clearArea) | 29 void HitRegion::removePixels(const Path& clearArea) |
| 30 { | 30 { |
| 31 m_path.subtractPath(clearArea); | 31 m_path.subtractPath(clearArea); |
| 32 } | 32 } |
| 33 | 33 |
| 34 void HitRegion::trace(Visitor* visitor) | |
| 35 { | |
| 36 visitor->trace(m_control); | |
| 37 } | |
| 38 | |
| 39 void HitRegionManager::addHitRegion(PassRefPtr<HitRegion> passHitRegion) | 34 void HitRegionManager::addHitRegion(PassRefPtr<HitRegion> passHitRegion) |
| 40 { | 35 { |
| 41 RefPtr<HitRegion> hitRegion = passHitRegion; | 36 RefPtr<HitRegion> hitRegion = passHitRegion; |
| 42 | 37 |
| 43 m_hitRegionList.add(hitRegion); | 38 m_hitRegionList.add(hitRegion); |
| 44 | 39 |
| 45 if (!hitRegion->id().isEmpty()) | 40 if (!hitRegion->id().isEmpty()) |
| 46 m_hitRegionIdMap.set(hitRegion->id(), hitRegion); | 41 m_hitRegionIdMap.set(hitRegion->id(), hitRegion); |
| 47 | 42 |
| 48 if (hitRegion->control()) | 43 if (hitRegion->control()) |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 } | 121 } |
| 127 | 122 |
| 128 return 0; | 123 return 0; |
| 129 } | 124 } |
| 130 | 125 |
| 131 unsigned HitRegionManager::getHitRegionsCount() const | 126 unsigned HitRegionManager::getHitRegionsCount() const |
| 132 { | 127 { |
| 133 return m_hitRegionList.size(); | 128 return m_hitRegionList.size(); |
| 134 } | 129 } |
| 135 | 130 |
| 136 void HitRegionManager::trace(Visitor* visitor) | |
| 137 { | |
| 138 #if ENABLE(OILPAN) | |
| 139 visitor->trace(m_hitRegionList); | |
| 140 visitor->trace(m_hitRegionIdMap); | |
| 141 visitor->trace(m_hitRegionControlMap); | |
| 142 #endif | |
| 143 } | |
| 144 | |
| 145 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(HitRegionManager) | 131 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(HitRegionManager) |
| 146 | 132 |
| 147 } // namespace blink | 133 } // namespace blink |
| OLD | NEW |