| OLD | NEW |
| 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_impl.h" | 5 #include "cc/trees/layer_tree_impl.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 scrolling_layer_id_from_previous_tree_(0), | 87 scrolling_layer_id_from_previous_tree_(0), |
| 88 contents_textures_purged_(false), | 88 contents_textures_purged_(false), |
| 89 requires_high_res_to_draw_(false), | 89 requires_high_res_to_draw_(false), |
| 90 viewport_size_invalid_(false), | 90 viewport_size_invalid_(false), |
| 91 needs_update_draw_properties_(true), | 91 needs_update_draw_properties_(true), |
| 92 needs_full_tree_sync_(true), | 92 needs_full_tree_sync_(true), |
| 93 next_activation_forces_redraw_(false), | 93 next_activation_forces_redraw_(false), |
| 94 has_ever_been_drawn_(false), | 94 has_ever_been_drawn_(false), |
| 95 render_surface_layer_list_id_(0), | 95 render_surface_layer_list_id_(0), |
| 96 top_controls_layout_height_(0), | 96 top_controls_layout_height_(0), |
| 97 top_controls_top_offset_(0), | 97 top_controls_content_offset_(0), |
| 98 top_controls_delta_(0), | 98 top_controls_delta_(0), |
| 99 sent_top_controls_delta_(0) { | 99 sent_top_controls_delta_(0) { |
| 100 } | 100 } |
| 101 | 101 |
| 102 LayerTreeImpl::~LayerTreeImpl() { | 102 LayerTreeImpl::~LayerTreeImpl() { |
| 103 BreakSwapPromises(SwapPromise::SWAP_FAILS); | 103 BreakSwapPromises(SwapPromise::SWAP_FAILS); |
| 104 | 104 |
| 105 // Need to explicitly clear the tree prior to destroying this so that | 105 // Need to explicitly clear the tree prior to destroying this so that |
| 106 // the LayerTreeImpl pointer is still valid in the LayerImpl dtor. | 106 // the LayerTreeImpl pointer is still valid in the LayerImpl dtor. |
| 107 DCHECK(!root_layer_); | 107 DCHECK(!root_layer_); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 DCHECK_EQ(ui_resource_request_queue_.size(), 0u); | 198 DCHECK_EQ(ui_resource_request_queue_.size(), 0u); |
| 199 | 199 |
| 200 if (next_activation_forces_redraw_) { | 200 if (next_activation_forces_redraw_) { |
| 201 target_tree->ForceRedrawNextActivation(); | 201 target_tree->ForceRedrawNextActivation(); |
| 202 next_activation_forces_redraw_ = false; | 202 next_activation_forces_redraw_ = false; |
| 203 } | 203 } |
| 204 | 204 |
| 205 target_tree->PassSwapPromises(&swap_promise_list_); | 205 target_tree->PassSwapPromises(&swap_promise_list_); |
| 206 | 206 |
| 207 target_tree->top_controls_layout_height_ = top_controls_layout_height_; | 207 target_tree->top_controls_layout_height_ = top_controls_layout_height_; |
| 208 target_tree->top_controls_top_offset_ = top_controls_top_offset_; | 208 target_tree->top_controls_content_offset_ = top_controls_content_offset_; |
| 209 target_tree->top_controls_delta_ = | 209 target_tree->top_controls_delta_ = |
| 210 target_tree->top_controls_delta_ - | 210 target_tree->top_controls_delta_ - |
| 211 target_tree->sent_top_controls_delta_; | 211 target_tree->sent_top_controls_delta_; |
| 212 target_tree->sent_top_controls_delta_ = 0.f; | 212 target_tree->sent_top_controls_delta_ = 0.f; |
| 213 | 213 |
| 214 target_tree->SetPageScaleValues( | 214 target_tree->SetPageScaleValues( |
| 215 page_scale_factor(), min_page_scale_factor(), max_page_scale_factor(), | 215 page_scale_factor(), min_page_scale_factor(), max_page_scale_factor(), |
| 216 target_tree->page_scale_delta() / target_tree->sent_page_scale_delta()); | 216 target_tree->page_scale_delta() / target_tree->sent_page_scale_delta()); |
| 217 target_tree->set_sent_page_scale_delta(1); | 217 target_tree->set_sent_page_scale_delta(1); |
| 218 | 218 |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 layer->ApplySentScrollDeltasFromAbortedCommit(); | 380 layer->ApplySentScrollDeltasFromAbortedCommit(); |
| 381 } | 381 } |
| 382 | 382 |
| 383 void LayerTreeImpl::ApplySentScrollAndScaleDeltasFromAbortedCommit() { | 383 void LayerTreeImpl::ApplySentScrollAndScaleDeltasFromAbortedCommit() { |
| 384 DCHECK(IsActiveTree()); | 384 DCHECK(IsActiveTree()); |
| 385 | 385 |
| 386 page_scale_factor_ *= sent_page_scale_delta_; | 386 page_scale_factor_ *= sent_page_scale_delta_; |
| 387 page_scale_delta_ /= sent_page_scale_delta_; | 387 page_scale_delta_ /= sent_page_scale_delta_; |
| 388 sent_page_scale_delta_ = 1.f; | 388 sent_page_scale_delta_ = 1.f; |
| 389 | 389 |
| 390 top_controls_top_offset_ += sent_top_controls_delta_; | 390 top_controls_content_offset_ += sent_top_controls_delta_; |
| 391 top_controls_delta_ -= sent_top_controls_delta_; | 391 top_controls_delta_ -= sent_top_controls_delta_; |
| 392 sent_top_controls_delta_ = 0.f; | 392 sent_top_controls_delta_ = 0.f; |
| 393 | 393 |
| 394 if (!root_layer()) | 394 if (!root_layer()) |
| 395 return; | 395 return; |
| 396 | 396 |
| 397 LayerTreeHostCommon::CallFunctionForSubtree( | 397 LayerTreeHostCommon::CallFunctionForSubtree( |
| 398 root_layer(), base::Bind(&ApplySentScrollDeltasFromAbortedCommitTo)); | 398 root_layer(), base::Bind(&ApplySentScrollDeltasFromAbortedCommitTo)); |
| 399 } | 399 } |
| 400 | 400 |
| (...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1438 | 1438 |
| 1439 void LayerTreeImpl::InputScrollAnimationFinished() { | 1439 void LayerTreeImpl::InputScrollAnimationFinished() { |
| 1440 layer_tree_host_impl_->ScrollEnd(); | 1440 layer_tree_host_impl_->ScrollEnd(); |
| 1441 } | 1441 } |
| 1442 | 1442 |
| 1443 BlockingTaskRunner* LayerTreeImpl::BlockingMainThreadTaskRunner() const { | 1443 BlockingTaskRunner* LayerTreeImpl::BlockingMainThreadTaskRunner() const { |
| 1444 return proxy()->blocking_main_thread_task_runner(); | 1444 return proxy()->blocking_main_thread_task_runner(); |
| 1445 } | 1445 } |
| 1446 | 1446 |
| 1447 } // namespace cc | 1447 } // namespace cc |
| OLD | NEW |