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 29 matching lines...) Expand all Loading... |
40 #include "platform/text/TextBreakIterator.h" | 40 #include "platform/text/TextBreakIterator.h" |
41 | 41 |
42 namespace blink { | 42 namespace blink { |
43 | 43 |
44 namespace TouchAdjustment { | 44 namespace TouchAdjustment { |
45 | 45 |
46 const float zeroTolerance = 1e-6f; | 46 const float zeroTolerance = 1e-6f; |
47 | 47 |
48 // Class for remembering absolute quads of a target node and what node they repr
esent. | 48 // Class for remembering absolute quads of a target node and what node they repr
esent. |
49 class SubtargetGeometry { | 49 class SubtargetGeometry { |
50 ALLOW_ONLY_INLINE_ALLOCATION(); | 50 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
51 public: | 51 public: |
52 SubtargetGeometry(Node* node, const FloatQuad& quad) | 52 SubtargetGeometry(Node* node, const FloatQuad& quad) |
53 : m_node(node) | 53 : m_node(node) |
54 , m_quad(quad) | 54 , m_quad(quad) |
55 { } | 55 { } |
56 DEFINE_INLINE_TRACE() { visitor->trace(m_node); } | 56 DEFINE_INLINE_TRACE() { visitor->trace(m_node); } |
57 | 57 |
58 Node* node() const { return m_node; } | 58 Node* node() const { return m_node; } |
59 FloatQuad quad() const { return m_quad; } | 59 FloatQuad quad() const { return m_quad; } |
60 IntRect boundingBox() const { return m_quad.enclosingBoundingBox(); } | 60 IntRect boundingBox() const { return m_quad.enclosingBoundingBox(); } |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 | 499 |
500 bool findBestZoomableArea(Node*& targetNode, IntRect& targetArea, const IntPoint
& touchHotspot, const IntRect& touchArea, const WillBeHeapVector<RefPtrWillBeMem
ber<Node>>& nodes) | 500 bool findBestZoomableArea(Node*& targetNode, IntRect& targetArea, const IntPoint
& touchHotspot, const IntRect& touchArea, const WillBeHeapVector<RefPtrWillBeMem
ber<Node>>& nodes) |
501 { | 501 { |
502 IntPoint targetPoint; | 502 IntPoint targetPoint; |
503 TouchAdjustment::SubtargetGeometryList subtargets; | 503 TouchAdjustment::SubtargetGeometryList subtargets; |
504 TouchAdjustment::compileZoomableSubtargets(nodes, subtargets); | 504 TouchAdjustment::compileZoomableSubtargets(nodes, subtargets); |
505 return TouchAdjustment::findNodeWithLowestDistanceMetric(targetNode, targetP
oint, targetArea, touchHotspot, touchArea, subtargets, TouchAdjustment::zoomable
IntersectionQuotient); | 505 return TouchAdjustment::findNodeWithLowestDistanceMetric(targetNode, targetP
oint, targetArea, touchHotspot, touchArea, subtargets, TouchAdjustment::zoomable
IntersectionQuotient); |
506 } | 506 } |
507 | 507 |
508 } // namespace blink | 508 } // namespace blink |
OLD | NEW |