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 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 if (settings_.gpu_rasterization_forced) { | 612 if (settings_.gpu_rasterization_forced) { |
613 return true; | 613 return true; |
614 } else if (settings_.gpu_rasterization_enabled) { | 614 } else if (settings_.gpu_rasterization_enabled) { |
615 return has_gpu_rasterization_trigger_ && | 615 return has_gpu_rasterization_trigger_ && |
616 content_is_suitable_for_gpu_rasterization_; | 616 content_is_suitable_for_gpu_rasterization_; |
617 } else { | 617 } else { |
618 return false; | 618 return false; |
619 } | 619 } |
620 } | 620 } |
621 | 621 |
| 622 void LayerTreeHost::SetHasGpuRasterizationTrigger(bool has_trigger) { |
| 623 if (has_trigger == has_gpu_rasterization_trigger_) |
| 624 return; |
| 625 |
| 626 has_gpu_rasterization_trigger_ = has_trigger; |
| 627 TRACE_EVENT_INSTANT1("cc", |
| 628 "LayerTreeHost::SetHasGpuRasterizationTrigger", |
| 629 TRACE_EVENT_SCOPE_THREAD, |
| 630 "has_trigger", |
| 631 has_gpu_rasterization_trigger_); |
| 632 } |
| 633 |
622 void LayerTreeHost::SetViewportSize(const gfx::Size& device_viewport_size) { | 634 void LayerTreeHost::SetViewportSize(const gfx::Size& device_viewport_size) { |
623 if (device_viewport_size == device_viewport_size_) | 635 if (device_viewport_size == device_viewport_size_) |
624 return; | 636 return; |
625 | 637 |
626 device_viewport_size_ = device_viewport_size; | 638 device_viewport_size_ = device_viewport_size; |
627 | 639 |
628 SetNeedsCommit(); | 640 SetNeedsCommit(); |
629 } | 641 } |
630 | 642 |
631 void LayerTreeHost::SetOverdrawBottomHeight(float overdraw_bottom_height) { | 643 void LayerTreeHost::SetOverdrawBottomHeight(float overdraw_bottom_height) { |
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1280 swap_promise_list_.push_back(swap_promise.Pass()); | 1292 swap_promise_list_.push_back(swap_promise.Pass()); |
1281 } | 1293 } |
1282 | 1294 |
1283 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { | 1295 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { |
1284 for (size_t i = 0; i < swap_promise_list_.size(); i++) | 1296 for (size_t i = 0; i < swap_promise_list_.size(); i++) |
1285 swap_promise_list_[i]->DidNotSwap(reason); | 1297 swap_promise_list_[i]->DidNotSwap(reason); |
1286 swap_promise_list_.clear(); | 1298 swap_promise_list_.clear(); |
1287 } | 1299 } |
1288 | 1300 |
1289 } // namespace cc | 1301 } // namespace cc |
OLD | NEW |