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

Unified Diff: Source/core/rendering/RenderObject.h

Issue 17471008: Rework compositor touch hit testing (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Various fixes and test additions Created 7 years, 5 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/rendering/RenderObject.h
diff --git a/Source/core/rendering/RenderObject.h b/Source/core/rendering/RenderObject.h
index 3e12f3b4e963608cda77d4e40ce0ce4a99a4e3c2..10f50c12833045b291a9503cf30dd255560a910e 100644
--- a/Source/core/rendering/RenderObject.h
+++ b/Source/core/rendering/RenderObject.h
@@ -129,6 +129,7 @@ struct AnnotatedRegionValue {
};
typedef WTF::HashSet<const RenderObject*> RenderObjectAncestorLineboxDirtySet;
+typedef WTF::HashMap<const RenderLayer*, Vector<IntRect> > LayerHitTestRects;
#ifndef NDEBUG
const int showTreeCharacterOffset = 39;
@@ -940,6 +941,9 @@ public:
virtual void addFocusRingRects(Vector<IntRect>&, const LayoutPoint& /* additionalOffset */, const RenderLayerModelObject* /* paintContainer */ = 0) { };
+ // Compute a list of hit-test rectangles per composited layer rooted at this renderer.
+ virtual void computeLayerHitTestRects(LayerHitTestRects&) const;
+
LayoutRect absoluteOutlineBounds() const
{
return outlineBoundsForRepaint(0);
@@ -953,6 +957,8 @@ public:
protected:
inline bool layerCreationAllowedForSubtree() const;
+ void enclosingCompositedLayerAndOffset(const RenderLayer**, LayoutPoint&) const;
+
// Overrides should call the superclass at the end
virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle);
// Overrides should call the superclass at the start
@@ -981,6 +987,17 @@ protected:
void setDocumentForAnonymous(Document* document) { ASSERT(isAnonymous()); m_node = document; }
+ // Add hit-test rects for the render tree rooted at this node to the provided collection on a
+ // per-composited-layer basis. CurrentCompositedLayer must be the enclosing composited layer,
+ // and layerOffset is the current offset within this layer. Subclass implementations will add
+ // any offset for this renderer within it's container, so callers should provide only the
+ // offset of the container within it's layer.
+ virtual void addLayerHitTestRects(LayerHitTestRects&, const RenderLayer* currentCompositedLayer, const LayoutPoint& layerOffset) const;
+
+ // Add hit-test rects for this renderer only to the provided list. layerOffset is the offset of this renderer within
+ // the current composited layer that should be used for each result.
+ virtual void computeOwnHitTestRects(Vector<IntRect>&, const LayoutPoint& layerOffset) const { };
+
private:
RenderFlowThread* locateFlowThreadContainingBlock() const;
void removeFromRenderFlowThread();

Powered by Google App Engine
This is Rietveld 408576698