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

Side by Side Diff: Source/core/layout/LayoutView.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/LayoutPart.cpp ('k') | Source/core/layout/LayoutView.cpp » ('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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2006 Apple Computer, Inc. 3 * Copyright (C) 2006 Apple Computer, Inc.
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,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details. 13 * Library General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU Library General Public License 15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to 16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA. 18 * Boston, MA 02110-1301, USA.
19 * 19 *
20 */ 20 */
21 21
22 #ifndef LayoutView_h 22 #ifndef LayoutView_h
23 #define LayoutView_h 23 #define LayoutView_h
24 24
25 #include "core/CoreExport.h" 25 #include "core/CoreExport.h"
26 #include "core/dom/Position.h" 26 #include "core/dom/Position.h"
27 #include "core/frame/FrameView.h" 27 #include "core/frame/FrameView.h"
28 #include "core/layout/HitTestCache.h"
29 #include "core/layout/HitTestResult.h"
30 #include "core/layout/LayoutBlockFlow.h" 28 #include "core/layout/LayoutBlockFlow.h"
31 #include "core/layout/LayoutState.h" 29 #include "core/layout/LayoutState.h"
32 #include "core/layout/PaintInvalidationState.h" 30 #include "core/layout/PaintInvalidationState.h"
33 #include "core/layout/PendingSelection.h" 31 #include "core/layout/PendingSelection.h"
34 #include "platform/PODFreeListArena.h" 32 #include "platform/PODFreeListArena.h"
35 #include "platform/RuntimeEnabledFeatures.h" 33 #include "platform/RuntimeEnabledFeatures.h"
36 #include "platform/heap/Handle.h" 34 #include "platform/heap/Handle.h"
37 #include "platform/scroll/ScrollableArea.h" 35 #include "platform/scroll/ScrollableArea.h"
38 #include "wtf/OwnPtr.h" 36 #include "wtf/OwnPtr.h"
39 37
40 namespace blink { 38 namespace blink {
41 39
42 class DeprecatedPaintLayerCompositor; 40 class DeprecatedPaintLayerCompositor;
43 class LayoutQuote; 41 class LayoutQuote;
44 42
45 // The root of the layout tree, corresponding to the CSS initial containing bloc k. 43 // The root of the layout tree, corresponding to the CSS initial containing bloc k.
46 // It's dimensions match that of the logical viewport (which may be different fr om 44 // It's dimensions match that of the logical viewport (which may be different fr om
47 // the visible viewport in fixed-layout mode), and it is always at position (0,0 ) 45 // the visible viewport in fixed-layout mode), and it is always at position (0,0 )
48 // relative to the document (and so isn't necessarily in view). 46 // relative to the document (and so isn't necessarily in view).
49 class CORE_EXPORT LayoutView final : public LayoutBlockFlow { 47 class CORE_EXPORT LayoutView final : public LayoutBlockFlow {
50 public: 48 public:
51 explicit LayoutView(Document*); 49 explicit LayoutView(Document*);
52 virtual ~LayoutView(); 50 virtual ~LayoutView();
53 void willBeDestroyed() override; 51 void willBeDestroyed() override;
54 52
55 bool hitTest(HitTestResult&); 53 bool hitTest(HitTestResult&);
54 bool hitTest(const HitTestRequest&, const HitTestLocation&, HitTestResult&);
56 55
57 // Returns the total count of calls to HitTest, for testing. 56 // Returns the total count of calls to HitTest, for testing.
58 unsigned hitTestCount() const { return m_hitTestCount; } 57 unsigned hitTestCount() const { return m_hitTestCount; }
59 unsigned hitTestCacheHits() const { return m_hitTestCacheHits; }
60
61 void clearHitTestCache() { m_hitTestCache.clear(); }
62 58
63 virtual const char* name() const override { return "LayoutView"; } 59 virtual const char* name() const override { return "LayoutView"; }
64 60
65 virtual bool isOfType(LayoutObjectType type) const override { return type == LayoutObjectLayoutView || LayoutBlockFlow::isOfType(type); } 61 virtual bool isOfType(LayoutObjectType type) const override { return type == LayoutObjectLayoutView || LayoutBlockFlow::isOfType(type); }
66 62
67 virtual DeprecatedPaintLayerType layerTypeRequired() const override { return NormalDeprecatedPaintLayer; } 63 virtual DeprecatedPaintLayerType layerTypeRequired() const override { return NormalDeprecatedPaintLayer; }
68 64
69 virtual bool isChildAllowed(LayoutObject*, const ComputedStyle&) const overr ide; 65 virtual bool isChildAllowed(LayoutObject*, const ComputedStyle&) const overr ide;
70 66
71 virtual void layout() override; 67 virtual void layout() override;
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 LayoutUnit m_pageLogicalHeight; 206 LayoutUnit m_pageLogicalHeight;
211 bool m_pageLogicalHeightChanged; 207 bool m_pageLogicalHeightChanged;
212 LayoutState* m_layoutState; 208 LayoutState* m_layoutState;
213 OwnPtr<DeprecatedPaintLayerCompositor> m_compositor; 209 OwnPtr<DeprecatedPaintLayerCompositor> m_compositor;
214 RefPtr<IntervalArena> m_intervalArena; 210 RefPtr<IntervalArena> m_intervalArena;
215 211
216 LayoutQuote* m_layoutQuoteHead; 212 LayoutQuote* m_layoutQuoteHead;
217 unsigned m_layoutCounterCount; 213 unsigned m_layoutCounterCount;
218 214
219 unsigned m_hitTestCount; 215 unsigned m_hitTestCount;
220 unsigned m_hitTestCacheHits;
221 HitTestCache m_hitTestCache;
222 216
223 OwnPtrWillBePersistent<PendingSelection> m_pendingSelection; 217 OwnPtrWillBePersistent<PendingSelection> m_pendingSelection;
224 }; 218 };
225 219
226 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutView, isLayoutView()); 220 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutView, isLayoutView());
227 221
228 // Suspends the LayoutState cached offset and clipRect optimization. Used under transforms 222 // Suspends the LayoutState cached offset and clipRect optimization. Used under transforms
229 // that cannot be represented by LayoutState (common in SVG) and when manipulati ng the layout 223 // that cannot be represented by LayoutState (common in SVG) and when manipulati ng the layout
230 // tree during layout in ways that can trigger paint invalidation of a non-child (e.g. when a list item 224 // tree during layout in ways that can trigger paint invalidation of a non-child (e.g. when a list item
231 // moves its list marker around). Note that even when disabled, LayoutState is s till used to 225 // moves its list marker around). Note that even when disabled, LayoutState is s till used to
(...skipping 15 matching lines...) Expand all
247 m_paintInvalidationState->m_cachedOffsetsEnabled = true; 241 m_paintInvalidationState->m_cachedOffsetsEnabled = true;
248 } 242 }
249 private: 243 private:
250 const PaintInvalidationState* m_paintInvalidationState; 244 const PaintInvalidationState* m_paintInvalidationState;
251 bool m_didDisable; 245 bool m_didDisable;
252 }; 246 };
253 247
254 } // namespace blink 248 } // namespace blink
255 249
256 #endif // LayoutView_h 250 #endif // LayoutView_h
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutPart.cpp ('k') | Source/core/layout/LayoutView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698