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

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: CR feedback - accumulate LayoutRects instead of IntRects, disable when page isn't composited. Also… 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
« no previous file with comments | « Source/core/rendering/RenderLayerModelObject.cpp ('k') | Source/core/rendering/RenderObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderObject.h
diff --git a/Source/core/rendering/RenderObject.h b/Source/core/rendering/RenderObject.h
index 663713313b1f60cc7004468919e7d955be23800a..22430e73293bc17ef1ee0fb1cde05de23edf64e0 100644
--- a/Source/core/rendering/RenderObject.h
+++ b/Source/core/rendering/RenderObject.h
@@ -108,7 +108,8 @@ enum MarkingBehavior {
enum MapCoordinatesMode {
IsFixed = 1 << 0,
UseTransforms = 1 << 1,
- ApplyContainerFlip = 1 << 2
+ ApplyContainerFlip = 1 << 2,
+ TraverseDocumentBoundaries = 1 << 3,
};
typedef unsigned MapCoordinatesFlags;
@@ -129,6 +130,7 @@ struct AnnotatedRegionValue {
};
typedef WTF::HashSet<const RenderObject*> RenderObjectAncestorLineboxDirtySet;
+typedef WTF::HashMap<const RenderLayer*, Vector<LayoutRect> > LayerHitTestRects;
#ifndef NDEBUG
const int showTreeCharacterOffset = 39;
@@ -930,6 +932,9 @@ public:
virtual void addFocusRingRects(Vector<IntRect>&, const LayoutPoint& /* additionalOffset */, const RenderLayerModelObject* /* paintContainer */ = 0) { };
+ // Compute a list of hit-test rectangles per layer rooted at this renderer.
+ virtual void computeLayerHitTestRects(LayerHitTestRects&) const;
+
LayoutRect absoluteOutlineBounds() const
{
return outlineBoundsForRepaint(0);
@@ -971,6 +976,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-RenderLayer basis. CurrentLayer must be the enclosing 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* currentLayer, 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 layer that should be used for each result.
+ virtual void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint& layerOffset) const { };
+
private:
RenderFlowThread* locateFlowThreadContainingBlock() const;
void removeFromRenderFlowThread();
« no previous file with comments | « Source/core/rendering/RenderLayerModelObject.cpp ('k') | Source/core/rendering/RenderObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698