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

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

Issue 2108033004: cc: Re-enable GPU rasterization after content veto. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update Created 4 years, 5 months 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_unittest.cc » ('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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after
1043 draw_property_utils::FindLayersThatNeedUpdates( 1043 draw_property_utils::FindLayersThatNeedUpdates(
1044 this, property_trees_.transform_tree, property_trees_.effect_tree, 1044 this, property_trees_.transform_tree, property_trees_.effect_tree,
1045 &update_layer_list); 1045 &update_layer_list);
1046 } 1046 }
1047 1047
1048 for (const auto& layer : update_layer_list) 1048 for (const auto& layer : update_layer_list)
1049 layer->SavePaintProperties(); 1049 layer->SavePaintProperties();
1050 1050
1051 base::AutoReset<bool> painting(&in_paint_layer_contents_, true); 1051 base::AutoReset<bool> painting(&in_paint_layer_contents_, true);
1052 bool did_paint_content = false; 1052 bool did_paint_content = false;
1053 bool content_is_suitable_for_gpu = true;
1053 for (const auto& layer : update_layer_list) { 1054 for (const auto& layer : update_layer_list) {
1054 did_paint_content |= layer->Update(); 1055 did_paint_content |= layer->Update();
1055 content_is_suitable_for_gpu_rasterization_ &= 1056 content_is_suitable_for_gpu &= layer->IsSuitableForGpuRasterization();
1056 layer->IsSuitableForGpuRasterization(); 1057 }
1058
1059 if (content_is_suitable_for_gpu) {
1060 ++num_consecutive_frames_suitable_for_gpu_;
1061 if (num_consecutive_frames_suitable_for_gpu_ >=
1062 kNumFramesToConsiderBeforeGpuRasterization) {
1063 content_is_suitable_for_gpu_rasterization_ = true;
1064 }
1065 } else {
1066 num_consecutive_frames_suitable_for_gpu_ = 0;
1067 content_is_suitable_for_gpu_rasterization_ = false;
1057 } 1068 }
1058 return did_paint_content; 1069 return did_paint_content;
1059 } 1070 }
1060 1071
1061 void LayerTreeHost::ApplyScrollAndScale(ScrollAndScaleSet* info) { 1072 void LayerTreeHost::ApplyScrollAndScale(ScrollAndScaleSet* info) {
1062 for (auto& swap_promise : info->swap_promises) { 1073 for (auto& swap_promise : info->swap_promises) {
1063 TRACE_EVENT_WITH_FLOW1("input,benchmark", 1074 TRACE_EVENT_WITH_FLOW1("input,benchmark",
1064 "LatencyInfo.Flow", 1075 "LatencyInfo.Flow",
1065 TRACE_ID_DONT_MANGLE(swap_promise->TraceId()), 1076 TRACE_ID_DONT_MANGLE(swap_promise->TraceId()),
1066 TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, 1077 TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT,
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after
1762 int seq_num = property_trees_.sequence_number; 1773 int seq_num = property_trees_.sequence_number;
1763 LayerTreeHostCommon::CallFunctionForEveryLayer(this, [seq_num](Layer* layer) { 1774 LayerTreeHostCommon::CallFunctionForEveryLayer(this, [seq_num](Layer* layer) {
1764 layer->set_property_tree_sequence_number(seq_num); 1775 layer->set_property_tree_sequence_number(seq_num);
1765 }); 1776 });
1766 1777
1767 surface_id_namespace_ = proto.surface_id_namespace(); 1778 surface_id_namespace_ = proto.surface_id_namespace();
1768 next_surface_sequence_ = proto.next_surface_sequence(); 1779 next_surface_sequence_ = proto.next_surface_sequence();
1769 } 1780 }
1770 1781
1771 } // namespace cc 1782 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698