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

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

Issue 1142283004: Implement a Hit Test Cache. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove validity rect as per Elliott's request 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,
49 }; 50 };
50 51
51 typedef unsigned HitTestRequestType; 52 typedef unsigned HitTestRequestType;
52 53
53 HitTestRequest(HitTestRequestType requestType) 54 HitTestRequest(HitTestRequestType requestType)
54 : m_requestType(requestType) 55 : m_requestType(requestType)
55 { 56 {
56 // Penetrating lists should also be list-based. 57 // Penetrating lists should also be list-based.
57 ASSERT(!(requestType & PenetratingList) || (requestType & ListBased)); 58 ASSERT(!(requestType & PenetratingList) || (requestType & ListBased));
58 } 59 }
59 60
60 bool readOnly() const { return m_requestType & ReadOnly; } 61 bool readOnly() const { return m_requestType & ReadOnly; }
61 bool active() const { return m_requestType & Active; } 62 bool active() const { return m_requestType & Active; }
62 bool move() const { return m_requestType & Move; } 63 bool move() const { return m_requestType & Move; }
63 bool release() const { return m_requestType & Release; } 64 bool release() const { return m_requestType & Release; }
64 bool ignoreClipping() const { return m_requestType & IgnoreClipping; } 65 bool ignoreClipping() const { return m_requestType & IgnoreClipping; }
65 bool svgClipContent() const { return m_requestType & SVGClipContent; } 66 bool svgClipContent() const { return m_requestType & SVGClipContent; }
66 bool touchEvent() const { return m_requestType & TouchEvent; } 67 bool touchEvent() const { return m_requestType & TouchEvent; }
67 bool allowsChildFrameContent() const { return m_requestType & AllowChildFram eContent; } 68 bool allowsChildFrameContent() const { return m_requestType & AllowChildFram eContent; }
68 bool isChildFrameHitTest() const { return m_requestType & ChildFrameHitTest; } 69 bool isChildFrameHitTest() const { return m_requestType & ChildFrameHitTest; }
69 bool ignorePointerEventsNone() const { return m_requestType & IgnorePointerE ventsNone; } 70 bool ignorePointerEventsNone() const { return m_requestType & IgnorePointerE ventsNone; }
70 bool listBased() const { return m_requestType & ListBased; } 71 bool listBased() const { return m_requestType & ListBased; }
71 bool penetratingList() const { return m_requestType & PenetratingList; } 72 bool penetratingList() const { return m_requestType & PenetratingList; }
73 bool avoidCache() const { return m_requestType & AvoidCache; }
72 74
73 // Convenience functions 75 // Convenience functions
74 bool touchMove() const { return move() && touchEvent(); } 76 bool touchMove() const { return move() && touchEvent(); }
75 77
76 HitTestRequestType type() const { return m_requestType; } 78 HitTestRequestType type() const { return m_requestType; }
77 79
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
78 private: 90 private:
79 HitTestRequestType m_requestType; 91 HitTestRequestType m_requestType;
80 }; 92 };
81 93
82 } // namespace blink 94 } // namespace blink
83 95
84 #endif // HitTestRequest_h 96 #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