OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) | 2 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) |
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 const float zeroTolerance = 1e-6f; | 45 const float zeroTolerance = 1e-6f; |
46 | 46 |
47 // Class for remembering absolute quads of a target node and what node they repr
esent. | 47 // Class for remembering absolute quads of a target node and what node they repr
esent. |
48 class SubtargetGeometry { | 48 class SubtargetGeometry { |
49 ALLOW_ONLY_INLINE_ALLOCATION(); | 49 ALLOW_ONLY_INLINE_ALLOCATION(); |
50 public: | 50 public: |
51 SubtargetGeometry(Node* node, const FloatQuad& quad) | 51 SubtargetGeometry(Node* node, const FloatQuad& quad) |
52 : m_node(node) | 52 : m_node(node) |
53 , m_quad(quad) | 53 , m_quad(quad) |
54 { } | 54 { } |
55 void trace(Visitor* visitor) { visitor->trace(m_node); } | 55 DEFINE_INLINE_TRACE() { visitor->trace(m_node); } |
56 | 56 |
57 Node* node() const { return m_node; } | 57 Node* node() const { return m_node; } |
58 FloatQuad quad() const { return m_quad; } | 58 FloatQuad quad() const { return m_quad; } |
59 IntRect boundingBox() const { return m_quad.enclosingBoundingBox(); } | 59 IntRect boundingBox() const { return m_quad.enclosingBoundingBox(); } |
60 | 60 |
61 private: | 61 private: |
62 RawPtrWillBeMember<Node> m_node; | 62 RawPtrWillBeMember<Node> m_node; |
63 FloatQuad m_quad; | 63 FloatQuad m_quad; |
64 }; | 64 }; |
65 | 65 |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 | 507 |
508 bool findBestZoomableArea(Node*& targetNode, IntRect& targetArea, const IntPoint
& touchHotspot, const IntRect& touchArea, const WillBeHeapVector<RefPtrWillBeMem
ber<Node>>& nodes) | 508 bool findBestZoomableArea(Node*& targetNode, IntRect& targetArea, const IntPoint
& touchHotspot, const IntRect& touchArea, const WillBeHeapVector<RefPtrWillBeMem
ber<Node>>& nodes) |
509 { | 509 { |
510 IntPoint targetPoint; | 510 IntPoint targetPoint; |
511 TouchAdjustment::SubtargetGeometryList subtargets; | 511 TouchAdjustment::SubtargetGeometryList subtargets; |
512 TouchAdjustment::compileZoomableSubtargets(nodes, subtargets); | 512 TouchAdjustment::compileZoomableSubtargets(nodes, subtargets); |
513 return TouchAdjustment::findNodeWithLowestDistanceMetric(targetNode, targetP
oint, targetArea, touchHotspot, touchArea, subtargets, TouchAdjustment::zoomable
IntersectionQuotient); | 513 return TouchAdjustment::findNodeWithLowestDistanceMetric(targetNode, targetP
oint, targetArea, touchHotspot, touchArea, subtargets, TouchAdjustment::zoomable
IntersectionQuotient); |
514 } | 514 } |
515 | 515 |
516 } // namespace blink | 516 } // namespace blink |
OLD | NEW |