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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 page_scale_delta = sync_tree->page_scale_delta(); | 341 page_scale_delta = sync_tree->page_scale_delta(); |
342 sent_page_scale_delta = sync_tree->sent_page_scale_delta(); | 342 sent_page_scale_delta = sync_tree->sent_page_scale_delta(); |
343 sync_tree->set_sent_page_scale_delta(1.f); | 343 sync_tree->set_sent_page_scale_delta(1.f); |
344 } | 344 } |
345 | 345 |
346 sync_tree->SetPageScaleFactorAndLimits(page_scale_factor_, | 346 sync_tree->SetPageScaleFactorAndLimits(page_scale_factor_, |
347 min_page_scale_factor_, | 347 min_page_scale_factor_, |
348 max_page_scale_factor_); | 348 max_page_scale_factor_); |
349 sync_tree->SetPageScaleDelta(page_scale_delta / sent_page_scale_delta); | 349 sync_tree->SetPageScaleDelta(page_scale_delta / sent_page_scale_delta); |
350 | 350 |
351 sync_tree->SetUseGpuRasterization(UseGpuRasterization()); | |
352 | |
353 sync_tree->PassSwapPromises(&swap_promise_list_); | 351 sync_tree->PassSwapPromises(&swap_promise_list_); |
354 | 352 |
| 353 host_impl->SetUseGpuRasterization(UseGpuRasterization()); |
355 host_impl->SetViewportSize(device_viewport_size_); | 354 host_impl->SetViewportSize(device_viewport_size_); |
356 host_impl->SetOverdrawBottomHeight(overdraw_bottom_height_); | 355 host_impl->SetOverdrawBottomHeight(overdraw_bottom_height_); |
357 host_impl->SetDeviceScaleFactor(device_scale_factor_); | 356 host_impl->SetDeviceScaleFactor(device_scale_factor_); |
358 host_impl->SetDebugState(debug_state_); | 357 host_impl->SetDebugState(debug_state_); |
359 if (pending_page_scale_animation_) { | 358 if (pending_page_scale_animation_) { |
360 host_impl->StartPageScaleAnimation( | 359 host_impl->StartPageScaleAnimation( |
361 pending_page_scale_animation_->target_offset, | 360 pending_page_scale_animation_->target_offset, |
362 pending_page_scale_animation_->use_anchor, | 361 pending_page_scale_animation_->use_anchor, |
363 pending_page_scale_animation_->scale, | 362 pending_page_scale_animation_->scale, |
364 pending_page_scale_animation_->duration); | 363 pending_page_scale_animation_->duration); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 scoped_ptr<LayerTreeHostImpl> LayerTreeHost::CreateLayerTreeHostImpl( | 426 scoped_ptr<LayerTreeHostImpl> LayerTreeHost::CreateLayerTreeHostImpl( |
428 LayerTreeHostImplClient* client) { | 427 LayerTreeHostImplClient* client) { |
429 DCHECK(proxy_->IsImplThread()); | 428 DCHECK(proxy_->IsImplThread()); |
430 scoped_ptr<LayerTreeHostImpl> host_impl = | 429 scoped_ptr<LayerTreeHostImpl> host_impl = |
431 LayerTreeHostImpl::Create(settings_, | 430 LayerTreeHostImpl::Create(settings_, |
432 client, | 431 client, |
433 proxy_.get(), | 432 proxy_.get(), |
434 rendering_stats_instrumentation_.get(), | 433 rendering_stats_instrumentation_.get(), |
435 shared_bitmap_manager_, | 434 shared_bitmap_manager_, |
436 id_); | 435 id_); |
| 436 host_impl->SetUseGpuRasterization(UseGpuRasterization()); |
437 shared_bitmap_manager_ = NULL; | 437 shared_bitmap_manager_ = NULL; |
438 if (settings_.calculate_top_controls_position && | 438 if (settings_.calculate_top_controls_position && |
439 host_impl->top_controls_manager()) { | 439 host_impl->top_controls_manager()) { |
440 top_controls_manager_weak_ptr_ = | 440 top_controls_manager_weak_ptr_ = |
441 host_impl->top_controls_manager()->AsWeakPtr(); | 441 host_impl->top_controls_manager()->AsWeakPtr(); |
442 } | 442 } |
443 input_handler_weak_ptr_ = host_impl->AsWeakPtr(); | 443 input_handler_weak_ptr_ = host_impl->AsWeakPtr(); |
444 return host_impl.Pass(); | 444 return host_impl.Pass(); |
445 } | 445 } |
446 | 446 |
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1264 swap_promise_list_.push_back(swap_promise.Pass()); | 1264 swap_promise_list_.push_back(swap_promise.Pass()); |
1265 } | 1265 } |
1266 | 1266 |
1267 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { | 1267 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { |
1268 for (size_t i = 0; i < swap_promise_list_.size(); i++) | 1268 for (size_t i = 0; i < swap_promise_list_.size(); i++) |
1269 swap_promise_list_[i]->DidNotSwap(reason); | 1269 swap_promise_list_[i]->DidNotSwap(reason); |
1270 swap_promise_list_.clear(); | 1270 swap_promise_list_.clear(); |
1271 } | 1271 } |
1272 | 1272 |
1273 } // namespace cc | 1273 } // namespace cc |
OLD | NEW |