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

Unified Diff: Source/core/layout/LayoutView.h

Issue 1142283004: Implement a Hit Test Cache. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/layout/LayoutView.h
diff --git a/Source/core/layout/LayoutView.h b/Source/core/layout/LayoutView.h
index c8caad6cd3304c6b400cd9205dc77108cb594c81..04c942dcfce914ec8716411437b665fd723922c1 100644
--- a/Source/core/layout/LayoutView.h
+++ b/Source/core/layout/LayoutView.h
@@ -25,6 +25,7 @@
#include "core/CoreExport.h"
#include "core/dom/Position.h"
#include "core/frame/FrameView.h"
+#include "core/layout/HitTestResult.h"
#include "core/layout/LayoutBlockFlow.h"
#include "core/layout/LayoutState.h"
#include "core/layout/PaintInvalidationState.h"
@@ -51,11 +52,12 @@ public:
void willBeDestroyed() override;
bool hitTest(HitTestResult&);
- bool hitTest(const HitTestRequest&, const HitTestLocation&, HitTestResult&);
// Returns the total count of calls to HitTest, for testing.
unsigned hitTestCount() const { return m_hitTestCount; }
+ void clearHitTestCache();
+
virtual const char* name() const override { return "LayoutView"; }
virtual bool isOfType(LayoutObjectType type) const override { return type == LayoutObjectLayoutView || LayoutBlockFlow::isOfType(type); }
@@ -123,7 +125,7 @@ public:
LayoutState* layoutState() const { return m_layoutState; }
- virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&) override;
+ virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&, const LayoutRect&) override;
LayoutUnit pageLogicalHeight() const { return m_pageLogicalHeight; }
void setPageLogicalHeight(LayoutUnit height)
@@ -206,6 +208,9 @@ private:
unsigned m_layoutCounterCount;
unsigned m_hitTestCount;
+ unsigned m_hitTestCacheHits;
+ HitTestResult m_hitTestCacheResult;
+ int m_hitTestCacheLayoutCount;
OwnPtrWillBePersistent<PendingSelection> m_pendingSelection;
};

Powered by Google App Engine
This is Rietveld 408576698