Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: cc/trees/layer_tree_host.cc

Issue 774413002: Update from https://crrev.com/306724 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 370
371 sync_tree->PassSwapPromises(&swap_promise_list_); 371 sync_tree->PassSwapPromises(&swap_promise_list_);
372 372
373 sync_tree->set_top_controls_layout_height(top_controls_layout_height_); 373 sync_tree->set_top_controls_layout_height(top_controls_layout_height_);
374 sync_tree->set_top_controls_content_offset(top_controls_content_offset_); 374 sync_tree->set_top_controls_content_offset(top_controls_content_offset_);
375 sync_tree->set_top_controls_delta(sync_tree->top_controls_delta() - 375 sync_tree->set_top_controls_delta(sync_tree->top_controls_delta() -
376 sync_tree->sent_top_controls_delta()); 376 sync_tree->sent_top_controls_delta());
377 sync_tree->set_sent_top_controls_delta(0.f); 377 sync_tree->set_sent_top_controls_delta(0.f);
378 378
379 host_impl->SetUseGpuRasterization(UseGpuRasterization()); 379 host_impl->SetUseGpuRasterization(UseGpuRasterization());
380 host_impl->set_gpu_rasterization_status(GetGpuRasterizationStatus());
380 RecordGpuRasterizationHistogram(); 381 RecordGpuRasterizationHistogram();
381 382
382 host_impl->SetViewportSize(device_viewport_size_); 383 host_impl->SetViewportSize(device_viewport_size_);
383 host_impl->SetDeviceScaleFactor(device_scale_factor_); 384 host_impl->SetDeviceScaleFactor(device_scale_factor_);
384 host_impl->SetDebugState(debug_state_); 385 host_impl->SetDebugState(debug_state_);
385 if (pending_page_scale_animation_) { 386 if (pending_page_scale_animation_) {
386 sync_tree->SetPendingPageScaleAnimation( 387 sync_tree->SetPendingPageScaleAnimation(
387 pending_page_scale_animation_.Pass()); 388 pending_page_scale_animation_.Pass());
388 } 389 }
389 390
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 if (settings_.gpu_rasterization_forced) { 630 if (settings_.gpu_rasterization_forced) {
630 return true; 631 return true;
631 } else if (settings_.gpu_rasterization_enabled) { 632 } else if (settings_.gpu_rasterization_enabled) {
632 return has_gpu_rasterization_trigger_ && 633 return has_gpu_rasterization_trigger_ &&
633 content_is_suitable_for_gpu_rasterization_; 634 content_is_suitable_for_gpu_rasterization_;
634 } else { 635 } else {
635 return false; 636 return false;
636 } 637 }
637 } 638 }
638 639
640 GpuRasterizationStatus LayerTreeHost::GetGpuRasterizationStatus() const {
641 if (settings_.gpu_rasterization_forced) {
642 return GpuRasterizationStatus::ON_FORCED;
643 } else if (settings_.gpu_rasterization_enabled) {
644 if (!has_gpu_rasterization_trigger_) {
645 return GpuRasterizationStatus::OFF_VIEWPORT;
646 } else if (!content_is_suitable_for_gpu_rasterization_) {
647 return GpuRasterizationStatus::OFF_CONTENT;
648 } else {
649 return GpuRasterizationStatus::ON;
650 }
651 }
652 return GpuRasterizationStatus::OFF_DEVICE;
653 }
654
639 void LayerTreeHost::SetHasGpuRasterizationTrigger(bool has_trigger) { 655 void LayerTreeHost::SetHasGpuRasterizationTrigger(bool has_trigger) {
640 if (has_trigger == has_gpu_rasterization_trigger_) 656 if (has_trigger == has_gpu_rasterization_trigger_)
641 return; 657 return;
642 658
643 has_gpu_rasterization_trigger_ = has_trigger; 659 has_gpu_rasterization_trigger_ = has_trigger;
644 TRACE_EVENT_INSTANT1("cc", 660 TRACE_EVENT_INSTANT1("cc",
645 "LayerTreeHost::SetHasGpuRasterizationTrigger", 661 "LayerTreeHost::SetHasGpuRasterizationTrigger",
646 TRACE_EVENT_SCOPE_THREAD, 662 TRACE_EVENT_SCOPE_THREAD,
647 "has_trigger", 663 "has_trigger",
648 has_gpu_rasterization_trigger_); 664 has_gpu_rasterization_trigger_);
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
1357 bool children_need_begin_frames) const { 1373 bool children_need_begin_frames) const {
1358 proxy_->SetChildrenNeedBeginFrames(children_need_begin_frames); 1374 proxy_->SetChildrenNeedBeginFrames(children_need_begin_frames);
1359 } 1375 }
1360 1376
1361 void LayerTreeHost::SendBeginFramesToChildren( 1377 void LayerTreeHost::SendBeginFramesToChildren(
1362 const BeginFrameArgs& args) const { 1378 const BeginFrameArgs& args) const {
1363 client_->SendBeginFramesToChildren(args); 1379 client_->SendBeginFramesToChildren(args);
1364 } 1380 }
1365 1381
1366 } // namespace cc 1382 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698