Plumb cc hit test regions to viz.
This CL adds a HitTestDataProvider class for cc layer trees. It generates hit
test data based on surface layers and property trees in cc. The data will be
submitted to viz during SubmitCompositorFrame and be used by HitTestQuery.
This change is hidden behind a flag --use-viz-hit-test-surface-layer. It is
the first of a series of changes. This CL is expected to be functionally
equivalent to generating HTRLs from CompositorFrame draw quads, but it allows
additional data being plumbed in the future CL.
Bug: 823888
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ie82f04f5837955bfc81049cf6fdcfe2ecb6fef39
Reviewed-on: https://chromium-review.googlesource.com/786349
Reviewed-by: Ria Jiang <[email protected]>
Reviewed-by: Robert Flack <[email protected]>
Reviewed-by: danakj <[email protected]>
Reviewed-by: Ken Buchanan <[email protected]>
Reviewed-by: Kentaro Hara <[email protected]>
Reviewed-by: Khushal <[email protected]>
Reviewed-by: Robert Kroeger <[email protected]>
Commit-Queue: Xianda Sun <[email protected]>
Cr-Commit-Position: refs/heads/master@{#545205}
diff --git a/cc/layers/surface_layer_impl.h b/cc/layers/surface_layer_impl.h
index 380e8b9..d51dd6a 100644
--- a/cc/layers/surface_layer_impl.h
+++ b/cc/layers/surface_layer_impl.h
@@ -50,11 +50,15 @@
return stretch_content_to_fill_bounds_;
}
+ void SetHitTestable(bool hit_testable);
+ bool hit_testable() const { return hit_testable_; }
+
// LayerImpl overrides.
std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
void PushPropertiesTo(LayerImpl* layer) override;
void AppendQuads(viz::RenderPass* render_pass,
AppendQuadsData* append_quads_data) override;
+ bool is_surface_layer() const override;
protected:
SurfaceLayerImpl(LayerTreeImpl* tree_impl, int id);
@@ -75,6 +79,7 @@
base::Optional<uint32_t> deadline_in_frames_;
bool stretch_content_to_fill_bounds_ = false;
+ bool hit_testable_ = false;
DISALLOW_COPY_AND_ASSIGN(SurfaceLayerImpl);
};