OLD | NEW |
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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/atomic_sequence_num.h" | 9 #include "base/atomic_sequence_num.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 is_root_for_isolated_group_(false), | 67 is_root_for_isolated_group_(false), |
68 is_container_for_fixed_position_layers_(false), | 68 is_container_for_fixed_position_layers_(false), |
69 is_drawable_(false), | 69 is_drawable_(false), |
70 draws_content_(false), | 70 draws_content_(false), |
71 hide_layer_and_subtree_(false), | 71 hide_layer_and_subtree_(false), |
72 masks_to_bounds_(false), | 72 masks_to_bounds_(false), |
73 contents_opaque_(false), | 73 contents_opaque_(false), |
74 double_sided_(true), | 74 double_sided_(true), |
75 should_flatten_transform_(true), | 75 should_flatten_transform_(true), |
76 use_parent_backface_visibility_(false), | 76 use_parent_backface_visibility_(false), |
77 draw_checkerboard_for_missing_tiles_(false), | |
78 force_render_surface_(false), | 77 force_render_surface_(false), |
79 transform_is_invertible_(true), | 78 transform_is_invertible_(true), |
80 has_render_surface_(false), | 79 has_render_surface_(false), |
81 scroll_blocks_on_(SCROLL_BLOCKS_ON_NONE), | 80 scroll_blocks_on_(SCROLL_BLOCKS_ON_NONE), |
82 background_color_(0), | 81 background_color_(0), |
83 opacity_(1.f), | 82 opacity_(1.f), |
84 blend_mode_(SkXfermode::kSrcOver_Mode), | 83 blend_mode_(SkXfermode::kSrcOver_Mode), |
85 scroll_parent_(nullptr), | 84 scroll_parent_(nullptr), |
86 layer_or_descendant_is_drawn_tracker_(0), | 85 layer_or_descendant_is_drawn_tracker_(0), |
87 sorted_for_recursion_tracker_(0), | 86 sorted_for_recursion_tracker_(0), |
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
996 } | 995 } |
997 | 996 |
998 void Layer::SetScrollBlocksOn(ScrollBlocksOn scroll_blocks_on) { | 997 void Layer::SetScrollBlocksOn(ScrollBlocksOn scroll_blocks_on) { |
999 DCHECK(IsPropertyChangeAllowed()); | 998 DCHECK(IsPropertyChangeAllowed()); |
1000 if (scroll_blocks_on_ == scroll_blocks_on) | 999 if (scroll_blocks_on_ == scroll_blocks_on) |
1001 return; | 1000 return; |
1002 scroll_blocks_on_ = scroll_blocks_on; | 1001 scroll_blocks_on_ = scroll_blocks_on; |
1003 SetNeedsCommit(); | 1002 SetNeedsCommit(); |
1004 } | 1003 } |
1005 | 1004 |
1006 void Layer::SetDrawCheckerboardForMissingTiles(bool checkerboard) { | |
1007 DCHECK(IsPropertyChangeAllowed()); | |
1008 if (draw_checkerboard_for_missing_tiles_ == checkerboard) | |
1009 return; | |
1010 draw_checkerboard_for_missing_tiles_ = checkerboard; | |
1011 SetNeedsCommit(); | |
1012 } | |
1013 | |
1014 void Layer::SetForceRenderSurface(bool force) { | 1005 void Layer::SetForceRenderSurface(bool force) { |
1015 DCHECK(IsPropertyChangeAllowed()); | 1006 DCHECK(IsPropertyChangeAllowed()); |
1016 if (force_render_surface_ == force) | 1007 if (force_render_surface_ == force) |
1017 return; | 1008 return; |
1018 force_render_surface_ = force; | 1009 force_render_surface_ = force; |
1019 SetNeedsCommit(); | 1010 SetNeedsCommit(); |
1020 } | 1011 } |
1021 | 1012 |
1022 void Layer::SetDoubleSided(bool double_sided) { | 1013 void Layer::SetDoubleSided(bool double_sided) { |
1023 DCHECK(IsPropertyChangeAllowed()); | 1014 DCHECK(IsPropertyChangeAllowed()); |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1189 : bounds_); | 1180 : bounds_); |
1190 | 1181 |
1191 if (frame_viewer_instrumentation::IsTracingLayerTreeSnapshots()) | 1182 if (frame_viewer_instrumentation::IsTracingLayerTreeSnapshots()) |
1192 layer->SetDebugInfo(TakeDebugInfo()); | 1183 layer->SetDebugInfo(TakeDebugInfo()); |
1193 | 1184 |
1194 layer->SetTransformTreeIndex(transform_tree_index()); | 1185 layer->SetTransformTreeIndex(transform_tree_index()); |
1195 layer->SetOpacityTreeIndex(opacity_tree_index()); | 1186 layer->SetOpacityTreeIndex(opacity_tree_index()); |
1196 layer->SetClipTreeIndex(clip_tree_index()); | 1187 layer->SetClipTreeIndex(clip_tree_index()); |
1197 layer->set_offset_to_transform_parent(offset_to_transform_parent_); | 1188 layer->set_offset_to_transform_parent(offset_to_transform_parent_); |
1198 layer->SetDoubleSided(double_sided_); | 1189 layer->SetDoubleSided(double_sided_); |
1199 layer->SetDrawCheckerboardForMissingTiles( | |
1200 draw_checkerboard_for_missing_tiles_); | |
1201 layer->SetDrawsContent(DrawsContent()); | 1190 layer->SetDrawsContent(DrawsContent()); |
1202 layer->SetHideLayerAndSubtree(hide_layer_and_subtree_); | 1191 layer->SetHideLayerAndSubtree(hide_layer_and_subtree_); |
1203 layer->SetHasRenderSurface(has_render_surface_); | 1192 layer->SetHasRenderSurface(has_render_surface_); |
1204 if (!layer->FilterIsAnimatingOnImplOnly() && !FilterIsAnimating()) | 1193 if (!layer->FilterIsAnimatingOnImplOnly() && !FilterIsAnimating()) |
1205 layer->SetFilters(filters_); | 1194 layer->SetFilters(filters_); |
1206 DCHECK(!(FilterIsAnimating() && layer->FilterIsAnimatingOnImplOnly())); | 1195 DCHECK(!(FilterIsAnimating() && layer->FilterIsAnimatingOnImplOnly())); |
1207 layer->SetBackgroundFilters(background_filters()); | 1196 layer->SetBackgroundFilters(background_filters()); |
1208 layer->SetMasksToBounds(masks_to_bounds_); | 1197 layer->SetMasksToBounds(masks_to_bounds_); |
1209 layer->SetShouldScrollOnMainThread(should_scroll_on_main_thread_); | 1198 layer->SetShouldScrollOnMainThread(should_scroll_on_main_thread_); |
1210 layer->SetHaveWheelEventHandlers(have_wheel_event_handlers_); | 1199 layer->SetHaveWheelEventHandlers(have_wheel_event_handlers_); |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1686 ? layer_tree_host()->meta_information_sequence_number() | 1675 ? layer_tree_host()->meta_information_sequence_number() |
1687 : 0; | 1676 : 0; |
1688 } | 1677 } |
1689 | 1678 |
1690 bool Layer::sorted_for_recursion() { | 1679 bool Layer::sorted_for_recursion() { |
1691 return sorted_for_recursion_tracker_ == | 1680 return sorted_for_recursion_tracker_ == |
1692 layer_tree_host()->meta_information_sequence_number(); | 1681 layer_tree_host()->meta_information_sequence_number(); |
1693 } | 1682 } |
1694 | 1683 |
1695 } // namespace cc | 1684 } // namespace cc |
OLD | NEW |