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

Side by Side Diff: Source/core/rendering/HitTestLocation.h

Issue 338543003: Gesture event hit test refactoring and reduction (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix release build Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Apple Computer, Inc. 2 * Copyright (C) 2006 Apple Computer, Inc.
3 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 static IntRect rectForPoint(const LayoutPoint&, unsigned topPadding, unsigne d rightPadding, unsigned bottomPadding, unsigned leftPadding); 58 static IntRect rectForPoint(const LayoutPoint&, unsigned topPadding, unsigne d rightPadding, unsigned bottomPadding, unsigned leftPadding);
59 int topPadding() const { return roundedPoint().y() - m_boundingBox.y(); } 59 int topPadding() const { return roundedPoint().y() - m_boundingBox.y(); }
60 int rightPadding() const { return m_boundingBox.maxX() - roundedPoint().x() - 1; } 60 int rightPadding() const { return m_boundingBox.maxX() - roundedPoint().x() - 1; }
61 int bottomPadding() const { return m_boundingBox.maxY() - roundedPoint().y() - 1; } 61 int bottomPadding() const { return m_boundingBox.maxY() - roundedPoint().y() - 1; }
62 int leftPadding() const { return roundedPoint().x() - m_boundingBox.x(); } 62 int leftPadding() const { return roundedPoint().x() - m_boundingBox.x(); }
63 63
64 bool intersects(const LayoutRect&) const; 64 bool intersects(const LayoutRect&) const;
65 bool intersects(const FloatRect&) const; 65 bool intersects(const FloatRect&) const;
66 bool intersects(const RoundedRect&) const; 66 bool intersects(const RoundedRect&) const;
67 bool containsPoint(const FloatPoint&) const;
67 68
68 const FloatPoint& transformedPoint() const { return m_transformedPoint; } 69 const FloatPoint& transformedPoint() const { return m_transformedPoint; }
69 const FloatQuad& transformedRect() const { return m_transformedRect; } 70 const FloatQuad& transformedRect() const { return m_transformedRect; }
70 71
71 private: 72 private:
72 template<typename RectType> 73 template<typename RectType>
73 bool intersectsRect(const RectType&) const; 74 bool intersectsRect(const RectType&) const;
74 void move(const LayoutSize& offset); 75 void move(const LayoutSize& offset);
75 76
76 // This is cached forms of the more accurate point and area below. 77 // This is cached forms of the more accurate point and area below.
77 LayoutPoint m_point; 78 LayoutPoint m_point;
78 IntRect m_boundingBox; 79 IntRect m_boundingBox;
79 80
80 FloatPoint m_transformedPoint; 81 FloatPoint m_transformedPoint;
81 FloatQuad m_transformedRect; 82 FloatQuad m_transformedRect;
82 83
83 bool m_isRectBased; 84 bool m_isRectBased;
84 bool m_isRectilinear; 85 bool m_isRectilinear;
85 }; 86 };
86 87
87 } // namespace WebCore 88 } // namespace WebCore
88 89
89 #endif // HitTestLocation_h 90 #endif // HitTestLocation_h
OLDNEW
« no previous file with comments | « Source/core/page/MouseEventWithHitTestResults.cpp ('k') | Source/core/rendering/HitTestLocation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698