| 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_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <stack> | 8 #include <stack> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 float page_scale_delta = | 342 float page_scale_delta = |
| 343 sync_tree->page_scale_delta() / sync_tree->sent_page_scale_delta(); | 343 sync_tree->page_scale_delta() / sync_tree->sent_page_scale_delta(); |
| 344 sync_tree->SetPageScaleValues(page_scale_factor_, | 344 sync_tree->SetPageScaleValues(page_scale_factor_, |
| 345 min_page_scale_factor_, | 345 min_page_scale_factor_, |
| 346 max_page_scale_factor_, | 346 max_page_scale_factor_, |
| 347 page_scale_delta); | 347 page_scale_delta); |
| 348 sync_tree->set_sent_page_scale_delta(1.f); | 348 sync_tree->set_sent_page_scale_delta(1.f); |
| 349 | 349 |
| 350 sync_tree->PassSwapPromises(&swap_promise_list_); | 350 sync_tree->PassSwapPromises(&swap_promise_list_); |
| 351 | 351 |
| 352 float top_controls_height = 0.f; | |
| 353 | |
| 354 if (host_impl->top_controls_manager()) | |
| 355 top_controls_height = host_impl->top_controls_manager()->controls_height(); | |
| 356 | |
| 357 sync_tree->set_top_controls_layout_height(top_controls_layout_height_); | 352 sync_tree->set_top_controls_layout_height(top_controls_layout_height_); |
| 358 sync_tree->set_top_controls_top_offset(top_controls_content_offset_ - | 353 sync_tree->set_top_controls_content_offset(top_controls_content_offset_); |
| 359 top_controls_height); | 354 sync_tree->set_top_controls_delta(sync_tree->top_controls_delta() - |
| 360 sync_tree->set_top_controls_delta( | 355 sync_tree->sent_top_controls_delta()); |
| 361 sync_tree->top_controls_delta() - | |
| 362 sync_tree->sent_top_controls_delta()); | |
| 363 sync_tree->set_sent_top_controls_delta(0.f); | 356 sync_tree->set_sent_top_controls_delta(0.f); |
| 364 | 357 |
| 365 host_impl->SetUseGpuRasterization(UseGpuRasterization()); | 358 host_impl->SetUseGpuRasterization(UseGpuRasterization()); |
| 366 RecordGpuRasterizationHistogram(); | 359 RecordGpuRasterizationHistogram(); |
| 367 | 360 |
| 368 host_impl->SetViewportSize(device_viewport_size_); | 361 host_impl->SetViewportSize(device_viewport_size_); |
| 369 host_impl->SetDeviceScaleFactor(device_scale_factor_); | 362 host_impl->SetDeviceScaleFactor(device_scale_factor_); |
| 370 host_impl->SetDebugState(debug_state_); | 363 host_impl->SetDebugState(debug_state_); |
| 371 if (pending_page_scale_animation_) { | 364 if (pending_page_scale_animation_) { |
| 372 host_impl->StartPageScaleAnimation( | 365 host_impl->StartPageScaleAnimation( |
| (...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1322 swap_promise_list_.push_back(swap_promise.Pass()); | 1315 swap_promise_list_.push_back(swap_promise.Pass()); |
| 1323 } | 1316 } |
| 1324 | 1317 |
| 1325 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { | 1318 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { |
| 1326 for (size_t i = 0; i < swap_promise_list_.size(); i++) | 1319 for (size_t i = 0; i < swap_promise_list_.size(); i++) |
| 1327 swap_promise_list_[i]->DidNotSwap(reason); | 1320 swap_promise_list_[i]->DidNotSwap(reason); |
| 1328 swap_promise_list_.clear(); | 1321 swap_promise_list_.clear(); |
| 1329 } | 1322 } |
| 1330 | 1323 |
| 1331 } // namespace cc | 1324 } // namespace cc |
| OLD | NEW |