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

Side by Side Diff: Source/core/layout/HitTestRequest.h

Issue 1177123003: Revert "Implement a Hit Test Cache for same point hits." (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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/core/layout/HitTestCache.cpp ('k') | Source/core/layout/HitTestResult.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Apple Computer, Inc. 2 * Copyright (C) 2006 Apple Computer, Inc.
3 * Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ 3 * Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
4 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) 4 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 28 matching lines...) Expand all
39 TouchEvent = 1 << 7, 39 TouchEvent = 1 << 7,
40 AllowChildFrameContent = 1 << 8, 40 AllowChildFrameContent = 1 << 8,
41 ChildFrameHitTest = 1 << 9, 41 ChildFrameHitTest = 1 << 9,
42 IgnorePointerEventsNone = 1 << 10, 42 IgnorePointerEventsNone = 1 << 10,
43 // Collect a list of nodes instead of just one. 43 // Collect a list of nodes instead of just one.
44 // (This is for elementsFromPoint and rect-based tests). 44 // (This is for elementsFromPoint and rect-based tests).
45 ListBased = 1 << 11, 45 ListBased = 1 << 11,
46 // When using list-based testing, this flag causes us to continue hit 46 // When using list-based testing, this flag causes us to continue hit
47 // testing after a hit has been found. 47 // testing after a hit has been found.
48 PenetratingList = 1 << 12, 48 PenetratingList = 1 << 12,
49 AvoidCache = 1 << 13,
50 }; 49 };
51 50
52 typedef unsigned HitTestRequestType; 51 typedef unsigned HitTestRequestType;
53 52
54 HitTestRequest(HitTestRequestType requestType) 53 HitTestRequest(HitTestRequestType requestType)
55 : m_requestType(requestType) 54 : m_requestType(requestType)
56 { 55 {
57 // Penetrating lists should also be list-based. 56 // Penetrating lists should also be list-based.
58 ASSERT(!(requestType & PenetratingList) || (requestType & ListBased)); 57 ASSERT(!(requestType & PenetratingList) || (requestType & ListBased));
59 } 58 }
60 59
61 bool readOnly() const { return m_requestType & ReadOnly; } 60 bool readOnly() const { return m_requestType & ReadOnly; }
62 bool active() const { return m_requestType & Active; } 61 bool active() const { return m_requestType & Active; }
63 bool move() const { return m_requestType & Move; } 62 bool move() const { return m_requestType & Move; }
64 bool release() const { return m_requestType & Release; } 63 bool release() const { return m_requestType & Release; }
65 bool ignoreClipping() const { return m_requestType & IgnoreClipping; } 64 bool ignoreClipping() const { return m_requestType & IgnoreClipping; }
66 bool svgClipContent() const { return m_requestType & SVGClipContent; } 65 bool svgClipContent() const { return m_requestType & SVGClipContent; }
67 bool touchEvent() const { return m_requestType & TouchEvent; } 66 bool touchEvent() const { return m_requestType & TouchEvent; }
68 bool allowsChildFrameContent() const { return m_requestType & AllowChildFram eContent; } 67 bool allowsChildFrameContent() const { return m_requestType & AllowChildFram eContent; }
69 bool isChildFrameHitTest() const { return m_requestType & ChildFrameHitTest; } 68 bool isChildFrameHitTest() const { return m_requestType & ChildFrameHitTest; }
70 bool ignorePointerEventsNone() const { return m_requestType & IgnorePointerE ventsNone; } 69 bool ignorePointerEventsNone() const { return m_requestType & IgnorePointerE ventsNone; }
71 bool listBased() const { return m_requestType & ListBased; } 70 bool listBased() const { return m_requestType & ListBased; }
72 bool penetratingList() const { return m_requestType & PenetratingList; } 71 bool penetratingList() const { return m_requestType & PenetratingList; }
73 bool avoidCache() const { return m_requestType & AvoidCache; }
74 72
75 // Convenience functions 73 // Convenience functions
76 bool touchMove() const { return move() && touchEvent(); } 74 bool touchMove() const { return move() && touchEvent(); }
77 75
78 HitTestRequestType type() const { return m_requestType; } 76 HitTestRequestType type() const { return m_requestType; }
79 77
80 // The Cacheability bits don't affect hit testing computation.
81 // TODO(dtapuska): These bits really shouldn't be fields on the HitTestReque st as
82 // they don't influence the result; but rather are hints on the output as to what to do.
83 // Perhaps move these fields to another enum ?
84 static const HitTestRequestType CacheabilityBits = ReadOnly | Active | Move | Release | TouchEvent;
85 bool equalForCacheability(const HitTestRequest& value) const
86 {
87 return (m_requestType | CacheabilityBits) == (value.m_requestType | Cach eabilityBits);
88 }
89
90 private: 78 private:
91 HitTestRequestType m_requestType; 79 HitTestRequestType m_requestType;
92 }; 80 };
93 81
94 } // namespace blink 82 } // namespace blink
95 83
96 #endif // HitTestRequest_h 84 #endif // HitTestRequest_h
OLDNEW
« no previous file with comments | « Source/core/layout/HitTestCache.cpp ('k') | Source/core/layout/HitTestResult.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698