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

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

Issue 270823003: cc: Move gpu rasterization flag from LayerImpl to LayerTreeImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: inline use-gpu-rasterization Created 6 years, 7 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 | Annotate | Revision Log
« cc/trees/layer_tree_host_impl.cc ('K') | « cc/trees/layer_tree_impl.h ('k') | no next file » | 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_impl.h" 5 #include "cc/trees/layer_tree_impl.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "cc/animation/keyframed_animation_curve.h" 8 #include "cc/animation/keyframed_animation_curve.h"
9 #include "cc/animation/scrollbar_animation_controller.h" 9 #include "cc/animation/scrollbar_animation_controller.h"
10 #include "cc/animation/scrollbar_animation_controller_linear_fade.h" 10 #include "cc/animation/scrollbar_animation_controller_linear_fade.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 has_transparent_background_(false), 85 has_transparent_background_(false),
86 page_scale_layer_(NULL), 86 page_scale_layer_(NULL),
87 inner_viewport_scroll_layer_(NULL), 87 inner_viewport_scroll_layer_(NULL),
88 outer_viewport_scroll_layer_(NULL), 88 outer_viewport_scroll_layer_(NULL),
89 page_scale_factor_(1), 89 page_scale_factor_(1),
90 page_scale_delta_(1), 90 page_scale_delta_(1),
91 sent_page_scale_delta_(1), 91 sent_page_scale_delta_(1),
92 min_page_scale_factor_(0), 92 min_page_scale_factor_(0),
93 max_page_scale_factor_(0), 93 max_page_scale_factor_(0),
94 scrolling_layer_id_from_previous_tree_(0), 94 scrolling_layer_id_from_previous_tree_(0),
95 use_gpu_rasterization_(false),
95 contents_textures_purged_(false), 96 contents_textures_purged_(false),
96 requires_high_res_to_draw_(false), 97 requires_high_res_to_draw_(false),
97 viewport_size_invalid_(false), 98 viewport_size_invalid_(false),
98 needs_update_draw_properties_(true), 99 needs_update_draw_properties_(true),
99 needs_full_tree_sync_(true), 100 needs_full_tree_sync_(true),
100 next_activation_forces_redraw_(false) {} 101 next_activation_forces_redraw_(false) {
102 }
101 103
102 LayerTreeImpl::~LayerTreeImpl() { 104 LayerTreeImpl::~LayerTreeImpl() {
103 // Need to explicitly clear the tree prior to destroying this so that 105 // Need to explicitly clear the tree prior to destroying this so that
104 // the LayerTreeImpl pointer is still valid in the LayerImpl dtor. 106 // the LayerTreeImpl pointer is still valid in the LayerImpl dtor.
105 DCHECK(!root_layer_); 107 DCHECK(!root_layer_);
106 DCHECK(layers_with_copy_output_request_.empty()); 108 DCHECK(layers_with_copy_output_request_.empty());
107 } 109 }
108 110
109 void LayerTreeImpl::Shutdown() { root_layer_.reset(); } 111 void LayerTreeImpl::Shutdown() { root_layer_.reset(); }
110 112
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 : Layer::INVALID_ID); 213 : Layer::INVALID_ID);
212 } else { 214 } else {
213 target_tree->ClearViewportLayers(); 215 target_tree->ClearViewportLayers();
214 } 216 }
215 // This should match the property synchronization in 217 // This should match the property synchronization in
216 // LayerTreeHost::finishCommitOnImplThread(). 218 // LayerTreeHost::finishCommitOnImplThread().
217 target_tree->set_source_frame_number(source_frame_number()); 219 target_tree->set_source_frame_number(source_frame_number());
218 target_tree->set_background_color(background_color()); 220 target_tree->set_background_color(background_color());
219 target_tree->set_has_transparent_background(has_transparent_background()); 221 target_tree->set_has_transparent_background(has_transparent_background());
220 222
223 target_tree->set_use_gpu_rasterization(use_gpu_rasterization());
224
221 if (ContentsTexturesPurged()) 225 if (ContentsTexturesPurged())
222 target_tree->SetContentsTexturesPurged(); 226 target_tree->SetContentsTexturesPurged();
223 else 227 else
224 target_tree->ResetContentsTexturesPurged(); 228 target_tree->ResetContentsTexturesPurged();
225 229
226 // Always reset this flag on activation, as we would only have activated 230 // Always reset this flag on activation, as we would only have activated
227 // if we were in a good state. 231 // if we were in a good state.
228 target_tree->ResetRequiresHighResToDraw(); 232 target_tree->ResetRequiresHighResToDraw();
229 233
230 if (ViewportSizeInvalid()) 234 if (ViewportSizeInvalid())
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after
984 const std::vector<LayerImpl*>& LayerTreeImpl::LayersWithCopyOutputRequest() 988 const std::vector<LayerImpl*>& LayerTreeImpl::LayersWithCopyOutputRequest()
985 const { 989 const {
986 // Only the active tree needs to know about layers with copy requests, as 990 // Only the active tree needs to know about layers with copy requests, as
987 // they are aborted if not serviced during draw. 991 // they are aborted if not serviced during draw.
988 DCHECK(IsActiveTree()); 992 DCHECK(IsActiveTree());
989 993
990 return layers_with_copy_output_request_; 994 return layers_with_copy_output_request_;
991 } 995 }
992 996
993 } // namespace cc 997 } // namespace cc
OLDNEW
« cc/trees/layer_tree_host_impl.cc ('K') | « cc/trees/layer_tree_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698