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

Unified Diff: cc/trees/layer_tree_host_common.cc

Issue 2720183003: Track the currently scrolling ScrollNode instead of the scrolling layer (Closed)
Patch Set: Ali did forsee a use-after-free with no stable id Created 3 years, 10 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 | « no previous file | cc/trees/layer_tree_host_impl.h » ('j') | cc/trees/layer_tree_host_impl.cc » ('J')
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 205b95f732a056203fa78efe8b3b4bdb029b694a..2e4ded747af48204387514f00a2bb43fefab4da7 100644
--- a/cc/trees/layer_tree_host_common.cc
+++ b/cc/trees/layer_tree_host_common.cc
@@ -604,11 +604,9 @@ void LayerTreeHostCommon::CalculateDrawProperties(
layer_tree_impl->FindActiveTreeLayerById(inputs->root_layer->id());
float jitter = 0.f;
if (active_tree_root) {
- LayerImpl* last_scrolled_layer = layer_tree_impl->LayerById(
- active_tree_root->layer_tree_impl()->LastScrolledLayerId());
- if (last_scrolled_layer) {
- const int last_scrolled_scroll_node_id =
- last_scrolled_layer->scroll_tree_index();
+ int last_scrolled_node_index =
+ active_tree_root->layer_tree_impl()->LastScrolledScrollNodeIndex();
+ if (last_scrolled_node_index != ScrollTree::kInvalidNodeId) {
std::unordered_set<int> jitter_nodes;
for (auto* layer : *layer_tree_impl) {
// Layers that have the same scroll tree index jitter together. So,
@@ -616,7 +614,7 @@ void LayerTreeHostCommon::CalculateDrawProperties(
// after we find a jittering layer, we need not consider other
// layers with the same scroll tree index.
int scroll_tree_index = layer->scroll_tree_index();
- if (last_scrolled_scroll_node_id <= scroll_tree_index &&
+ if (last_scrolled_node_index <= scroll_tree_index &&
jitter_nodes.find(scroll_tree_index) == jitter_nodes.end()) {
float layer_jitter = CalculateLayerJitter(layer);
if (layer_jitter > 0.f) {
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_impl.h » ('j') | cc/trees/layer_tree_host_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698