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

Unified Diff: cc/trees/layer_tree_host_common.cc

Issue 335633003: Do not skip subtrees with wheel or touch handlers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rename Created 6 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 | « cc/layers/draw_properties.h ('k') | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_common.cc
diff --git a/cc/trees/layer_tree_host_common.cc b/cc/trees/layer_tree_host_common.cc
index 2335f4e0315b29726af6279526ed3c26955ca29f..f484206c3a64eafe8752c467fc2de140145adbd5 100644
--- a/cc/trees/layer_tree_host_common.cc
+++ b/cc/trees/layer_tree_host_common.cc
@@ -487,6 +487,11 @@ static inline bool SubtreeShouldBeSkipped(LayerImpl* layer,
if (layer->draw_properties().layer_or_descendant_has_copy_request)
return false;
+ // We cannot skip the the subtree if a descendant has a wheel or touch handler
+ // or the hit testing code will break (it requires fresh transforms, etc).
+ if (layer->draw_properties().layer_or_descendant_has_input_handler)
+ return false;
+
// If the layer is not drawn, then skip it and its subtree.
if (!layer_is_drawn)
return true;
@@ -513,6 +518,11 @@ static inline bool SubtreeShouldBeSkipped(Layer* layer, bool layer_is_drawn) {
if (layer->draw_properties().layer_or_descendant_has_copy_request)
return false;
+ // We cannot skip the the subtree if a descendant has a wheel or touch handler
+ // or the hit testing code will break (it requires fresh transforms, etc).
+ if (layer->draw_properties().layer_or_descendant_has_input_handler)
+ return false;
+
// If the layer is not drawn, then skip it and its subtree.
if (!layer_is_drawn)
return true;
@@ -1184,15 +1194,19 @@ static inline void RemoveSurfaceForEarlyExit(
struct PreCalculateMetaInformationRecursiveData {
bool layer_or_descendant_has_copy_request;
+ bool layer_or_descendant_has_input_handler;
int num_unclipped_descendants;
PreCalculateMetaInformationRecursiveData()
: layer_or_descendant_has_copy_request(false),
+ layer_or_descendant_has_input_handler(false),
num_unclipped_descendants(0) {}
void Merge(const PreCalculateMetaInformationRecursiveData& data) {
layer_or_descendant_has_copy_request |=
data.layer_or_descendant_has_copy_request;
+ layer_or_descendant_has_input_handler |=
+ data.layer_or_descendant_has_input_handler;
num_unclipped_descendants +=
data.num_unclipped_descendants;
}
@@ -1252,12 +1266,18 @@ static void PreCalculateMetaInformation(
if (layer->HasCopyRequest())
recursive_data->layer_or_descendant_has_copy_request = true;
+ if (!layer->touch_event_handler_region().IsEmpty() ||
+ layer->have_wheel_event_handlers())
+ recursive_data->layer_or_descendant_has_input_handler = true;
+
layer->draw_properties().num_descendants_that_draw_content =
num_descendants_that_draw_content;
layer->draw_properties().num_unclipped_descendants =
recursive_data->num_unclipped_descendants;
layer->draw_properties().layer_or_descendant_has_copy_request =
recursive_data->layer_or_descendant_has_copy_request;
+ layer->draw_properties().layer_or_descendant_has_input_handler =
+ recursive_data->layer_or_descendant_has_input_handler;
}
static void RoundTranslationComponents(gfx::Transform* transform) {
« no previous file with comments | « cc/layers/draw_properties.h ('k') | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698