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

Side by Side Diff: cc/trees/layer_tree_host_in_process.cc

Issue 2365793002: Fix scroll chaining for non-descendants of root scroller. (Closed)
Patch Set: Rebase + Hack for telemetry Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host_in_process.h" 5 #include "cc/trees/layer_tree_host_in_process.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 sync_tree->ForceRedrawNextActivation(); 443 sync_tree->ForceRedrawNextActivation();
444 next_commit_forces_redraw_ = false; 444 next_commit_forces_redraw_ = false;
445 } 445 }
446 if (next_commit_forces_recalculate_raster_scales_) { 446 if (next_commit_forces_recalculate_raster_scales_) {
447 sync_tree->ForceRecalculateRasterScales(); 447 sync_tree->ForceRecalculateRasterScales();
448 next_commit_forces_recalculate_raster_scales_ = false; 448 next_commit_forces_recalculate_raster_scales_ = false;
449 } 449 }
450 450
451 sync_tree->set_source_frame_number(SourceFrameNumber()); 451 sync_tree->set_source_frame_number(SourceFrameNumber());
452 452
453 // TODO(bokan): The tree sync might destroy the currently scrolling layer.
454 // Normally, this would be fine and we'd just drop incoming scrolls but some
455 // telemetry tests rely on the viewport not having this behavior. Those should
456 // be fixed and this removed. crbug.com/652905.
457 bool restore_currently_scrolling_viewport =
458 host_impl->IsCurrentlyScrollingViewport();
459
453 if (layer_tree_->needs_full_tree_sync()) 460 if (layer_tree_->needs_full_tree_sync())
454 TreeSynchronizer::SynchronizeTrees(layer_tree_->root_layer(), sync_tree); 461 TreeSynchronizer::SynchronizeTrees(layer_tree_->root_layer(), sync_tree);
455 462
456 layer_tree_->PushPropertiesTo(sync_tree); 463 layer_tree_->PushPropertiesTo(sync_tree);
457 464
465 if (restore_currently_scrolling_viewport &&
466 !host_impl->IsCurrentlyScrollingViewport()) {
467 host_impl->active_tree()->SetCurrentlyScrollingLayer(
468 host_impl->ViewportMainScrollLayer());
469 }
470
458 sync_tree->PassSwapPromises(swap_promise_manager_.TakeSwapPromises()); 471 sync_tree->PassSwapPromises(swap_promise_manager_.TakeSwapPromises());
459 472
460 host_impl->SetHasGpuRasterizationTrigger(has_gpu_rasterization_trigger_); 473 host_impl->SetHasGpuRasterizationTrigger(has_gpu_rasterization_trigger_);
461 host_impl->SetContentIsSuitableForGpuRasterization( 474 host_impl->SetContentIsSuitableForGpuRasterization(
462 content_is_suitable_for_gpu_rasterization_); 475 content_is_suitable_for_gpu_rasterization_);
463 RecordGpuRasterizationHistogram(); 476 RecordGpuRasterizationHistogram();
464 477
465 host_impl->SetViewportSize(layer_tree_->device_viewport_size()); 478 host_impl->SetViewportSize(layer_tree_->device_viewport_size());
466 // TODO(senorblanco): Move this to LayerTree::PushPropertiesTo so that it 479 // TODO(senorblanco): Move this to LayerTree::PushPropertiesTo so that it
467 // happens before GPU rasterization properties are set, since those trigger an 480 // happens before GPU rasterization properties are set, since those trigger an
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 1048
1036 debug_state_.FromProtobuf(proto.debug_state()); 1049 debug_state_.FromProtobuf(proto.debug_state());
1037 has_gpu_rasterization_trigger_ = proto.has_gpu_rasterization_trigger(); 1050 has_gpu_rasterization_trigger_ = proto.has_gpu_rasterization_trigger();
1038 content_is_suitable_for_gpu_rasterization_ = 1051 content_is_suitable_for_gpu_rasterization_ =
1039 proto.content_is_suitable_for_gpu_rasterization(); 1052 proto.content_is_suitable_for_gpu_rasterization();
1040 id_ = proto.id(); 1053 id_ = proto.id();
1041 next_commit_forces_redraw_ = proto.next_commit_forces_redraw(); 1054 next_commit_forces_redraw_ = proto.next_commit_forces_redraw();
1042 } 1055 }
1043 1056
1044 } // namespace cc 1057 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698