Chromium Code Reviews| 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 if (has_gpu_rasterization_trigger_) { | |
| 628 TRACE_EVENT_INSTANT0( | |
|
ernstm
2014/06/02 21:34:48
Could you issue a TRACE_EVENT_INSTANT1 with name "
ajuma
2014/06/03 14:47:11
Done.
| |
| 629 "cc", | |
| 630 "LayerTreeHost::SetHasGpuRasterizationTrigger trigger added", | |
| 631 TRACE_EVENT_SCOPE_THREAD); | |
| 632 } else { | |
| 633 TRACE_EVENT_INSTANT0( | |
| 634 "cc", | |
| 635 "LayerTreeHost::SetHasGpuRasterizationTrigger trigger removed", | |
| 636 TRACE_EVENT_SCOPE_THREAD); | |
| 637 } | |
| 638 } | |
| 639 | |
| 622 void LayerTreeHost::SetViewportSize(const gfx::Size& device_viewport_size) { | 640 void LayerTreeHost::SetViewportSize(const gfx::Size& device_viewport_size) { |
| 623 if (device_viewport_size == device_viewport_size_) | 641 if (device_viewport_size == device_viewport_size_) |
| 624 return; | 642 return; |
| 625 | 643 |
| 626 device_viewport_size_ = device_viewport_size; | 644 device_viewport_size_ = device_viewport_size; |
| 627 | 645 |
| 628 SetNeedsCommit(); | 646 SetNeedsCommit(); |
| 629 } | 647 } |
| 630 | 648 |
| 631 void LayerTreeHost::SetOverdrawBottomHeight(float overdraw_bottom_height) { | 649 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()); | 1298 swap_promise_list_.push_back(swap_promise.Pass()); |
| 1281 } | 1299 } |
| 1282 | 1300 |
| 1283 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { | 1301 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { |
| 1284 for (size_t i = 0; i < swap_promise_list_.size(); i++) | 1302 for (size_t i = 0; i < swap_promise_list_.size(); i++) |
| 1285 swap_promise_list_[i]->DidNotSwap(reason); | 1303 swap_promise_list_[i]->DidNotSwap(reason); |
| 1286 swap_promise_list_.clear(); | 1304 swap_promise_list_.clear(); |
| 1287 } | 1305 } |
| 1288 | 1306 |
| 1289 } // namespace cc | 1307 } // namespace cc |
| OLD | NEW |