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

Side by Side Diff: cc/layers/layer.cc

Issue 2873593002: Force use of and cache render surface. (Closed)
Patch Set: Calculate damage of |force_render_surface|. Created 3 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
OLDNEW
1 // Copyright 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 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/layers/layer.h" 5 #include "cc/layers/layer.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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 num_descendants_that_draw_content_(0), 81 num_descendants_that_draw_content_(0),
82 transform_tree_index_(TransformTree::kInvalidNodeId), 82 transform_tree_index_(TransformTree::kInvalidNodeId),
83 effect_tree_index_(EffectTree::kInvalidNodeId), 83 effect_tree_index_(EffectTree::kInvalidNodeId),
84 clip_tree_index_(ClipTree::kInvalidNodeId), 84 clip_tree_index_(ClipTree::kInvalidNodeId),
85 scroll_tree_index_(ScrollTree::kInvalidNodeId), 85 scroll_tree_index_(ScrollTree::kInvalidNodeId),
86 property_tree_sequence_number_(-1), 86 property_tree_sequence_number_(-1),
87 should_flatten_transform_from_property_tree_(false), 87 should_flatten_transform_from_property_tree_(false),
88 draws_content_(false), 88 draws_content_(false),
89 use_local_transform_for_backface_visibility_(false), 89 use_local_transform_for_backface_visibility_(false),
90 should_check_backface_visibility_(false), 90 should_check_backface_visibility_(false),
91 force_render_surface_for_testing_(false), 91 force_render_surface_(false),
92 subtree_property_changed_(false), 92 subtree_property_changed_(false),
93 may_contain_video_(false), 93 may_contain_video_(false),
94 is_scroll_clip_layer_(false), 94 is_scroll_clip_layer_(false),
95 needs_show_scrollbars_(false), 95 needs_show_scrollbars_(false),
96 subtree_has_copy_request_(false), 96 subtree_has_copy_request_(false),
97 safe_opaque_background_color_(0), 97 safe_opaque_background_color_(0),
98 num_unclipped_descendants_(0) {} 98 num_unclipped_descendants_(0) {}
99 99
100 Layer::~Layer() { 100 Layer::~Layer() {
101 // Our parent should be holding a reference to us so there should be no 101 // Our parent should be holding a reference to us so there should be no
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 void Layer::SetTouchEventHandlerRegion(const Region& region) { 885 void Layer::SetTouchEventHandlerRegion(const Region& region) {
886 DCHECK(IsPropertyChangeAllowed()); 886 DCHECK(IsPropertyChangeAllowed());
887 if (inputs_.touch_event_handler_region == region) 887 if (inputs_.touch_event_handler_region == region)
888 return; 888 return;
889 889
890 inputs_.touch_event_handler_region = region; 890 inputs_.touch_event_handler_region = region;
891 SetPropertyTreesNeedRebuild(); 891 SetPropertyTreesNeedRebuild();
892 SetNeedsCommit(); 892 SetNeedsCommit();
893 } 893 }
894 894
895 void Layer::SetForceRenderSurfaceForTesting(bool force) { 895 void Layer::SetForceRenderSurface(bool force) {
896 DCHECK(IsPropertyChangeAllowed()); 896 DCHECK(IsPropertyChangeAllowed());
897 if (force_render_surface_for_testing_ == force) 897 if (force_render_surface_ == force)
898 return; 898 return;
899 force_render_surface_for_testing_ = force; 899 force_render_surface_ = force;
900 SetPropertyTreesNeedRebuild(); 900 SetPropertyTreesNeedRebuild();
901 SetNeedsCommit(); 901 SetNeedsCommit();
902 } 902 }
903 903
904 void Layer::SetDoubleSided(bool double_sided) { 904 void Layer::SetDoubleSided(bool double_sided) {
905 DCHECK(IsPropertyChangeAllowed()); 905 DCHECK(IsPropertyChangeAllowed());
906 if (inputs_.double_sided == double_sided) 906 if (inputs_.double_sided == double_sided)
907 return; 907 return;
908 inputs_.double_sided = double_sided; 908 inputs_.double_sided = double_sided;
909 SetNeedsCommit(); 909 SetNeedsCommit();
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
1427 ->subtree_has_copy_request; 1427 ->subtree_has_copy_request;
1428 } 1428 }
1429 1429
1430 gfx::Transform Layer::ScreenSpaceTransform() const { 1430 gfx::Transform Layer::ScreenSpaceTransform() const {
1431 DCHECK_NE(transform_tree_index_, TransformTree::kInvalidNodeId); 1431 DCHECK_NE(transform_tree_index_, TransformTree::kInvalidNodeId);
1432 return draw_property_utils::ScreenSpaceTransform( 1432 return draw_property_utils::ScreenSpaceTransform(
1433 this, layer_tree_host_->property_trees()->transform_tree); 1433 this, layer_tree_host_->property_trees()->transform_tree);
1434 } 1434 }
1435 1435
1436 } // namespace cc 1436 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698