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

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: Fix git cl format mangling 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
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 static const HitTestRequestType CacheabilityBits = ReadOnly | Active | Move | Release | TouchEvent;
Rick Byers 2015/06/06 16:12:54 this probably deserves a comment saying these bits
dtapuska 2015/06/09 18:21:24 Done.
81 bool equalForCacheability(const HitTestRequest& value) const
82 {
83 return (m_requestType | CacheabilityBits) == (value.m_requestType | Cach eabilityBits);
84 }
85
78 private: 86 private:
79 HitTestRequestType m_requestType; 87 HitTestRequestType m_requestType;
80 }; 88 };
81 89
82 } // namespace blink 90 } // namespace blink
83 91
84 #endif // HitTestRequest_h 92 #endif // HitTestRequest_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698