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

Unified Diff: Source/core/paint/DeprecatedPaintLayer.cpp

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/layout/LayoutView.cpp ('k') | Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/DeprecatedPaintLayer.cpp
diff --git a/Source/core/paint/DeprecatedPaintLayer.cpp b/Source/core/paint/DeprecatedPaintLayer.cpp
index ade9a36ab2c161256cb11b39e7b614cf8c4957b4..7bfe447d7838fa4c8164ef98652e2532612b2982 100644
--- a/Source/core/paint/DeprecatedPaintLayer.cpp
+++ b/Source/core/paint/DeprecatedPaintLayer.cpp
@@ -1580,20 +1580,21 @@ static inline LayoutRect frameVisibleRect(LayoutObject* layoutObject)
bool DeprecatedPaintLayer::hitTest(HitTestResult& result)
{
+ return hitTest(result.hitTestRequest(), result.hitTestLocation(), result);
+}
+
+bool DeprecatedPaintLayer::hitTest(const HitTestRequest& request, const HitTestLocation& hitTestLocation, HitTestResult& result)
+{
ASSERT(isSelfPaintingLayer() || hasSelfPaintingLayerDescendant());
// LayoutView should make sure to update layout before entering hit testing
ASSERT(!layoutObject()->frame()->view()->layoutPending());
ASSERT(!layoutObject()->document().layoutView()->needsLayout());
- const HitTestRequest& request = result.hitTestRequest();
- const HitTestLocation& hitTestLocation = result.hitTestLocation();
-
// Start with frameVisibleRect to ensure we include the scrollbars.
LayoutRect hitTestArea = frameVisibleRect(layoutObject());
if (request.ignoreClipping())
hitTestArea.unite(LayoutRect(layoutObject()->view()->documentRect()));
- result.setValidityRect(boundingRect(hitTestLocation.point()));
DeprecatedPaintLayer* insideLayer = hitTestLayer(this, 0, result, hitTestArea, hitTestLocation, false);
if (!insideLayer) {
@@ -1606,9 +1607,6 @@ bool DeprecatedPaintLayer::hitTest(HitTestResult& result)
if (!request.isChildFrameHitTest() && ((request.active() || request.release()) || (request.move() && hitTestArea.contains(hitPoint.x(), hitPoint.y()))) && isRootLayer()) {
layoutObject()->updateHitTestResult(result, toLayoutView(layoutObject())->flipForWritingMode(hitTestLocation.point()));
insideLayer = this;
-
- // Don't cache this result since it really wasn't a true hit.
- result.setValidityRect(LayoutRect());
}
}
@@ -1832,7 +1830,6 @@ DeprecatedPaintLayer* DeprecatedPaintLayer::hitTestLayer(DeprecatedPaintLayer* r
if (isSelfPaintingLayer()) {
// Hit test with a temporary HitTestResult, because we only want to commit to 'result' if we know we're frontmost.
HitTestResult tempResult(result.hitTestRequest(), result.hitTestLocation());
- tempResult.setValidityRect(result.validityRect());
bool insideFragmentForegroundRect = false;
if (hitTestContentsForFragments(layerFragments, tempResult, hitTestLocation, HitTestDescendants, insideFragmentForegroundRect)
&& isHitCandidate(this, false, zOffsetForContentsPtr, unflattenedTransformState.get())) {
@@ -1864,7 +1861,6 @@ DeprecatedPaintLayer* DeprecatedPaintLayer::hitTestLayer(DeprecatedPaintLayer* r
if (isSelfPaintingLayer()) {
HitTestResult tempResult(result.hitTestRequest(), result.hitTestLocation());
- tempResult.setValidityRect(result.validityRect());
bool insideFragmentBackgroundRect = false;
if (hitTestContentsForFragments(layerFragments, tempResult, hitTestLocation, HitTestSelf, insideFragmentBackgroundRect)
&& isHitCandidate(this, false, zOffsetForContentsPtr, unflattenedTransformState.get())) {
@@ -2019,7 +2015,6 @@ DeprecatedPaintLayer* DeprecatedPaintLayer::hitTestChildren(ChildrenIteration ch
DeprecatedPaintLayer* childLayer = child->layer();
DeprecatedPaintLayer* hitLayer = 0;
HitTestResult tempResult(result.hitTestRequest(), result.hitTestLocation());
- tempResult.setValidityRect(result.validityRect());
hitLayer = childLayer->hitTestLayer(rootLayer, this, tempResult, hitTestRect, hitTestLocation, false, transformState, zOffsetForDescendants);
// If it is a list-based test, we can safely append the temporary result since it might had hit
« no previous file with comments | « Source/core/layout/LayoutView.cpp ('k') | Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698