Chromium Code Reviews| 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), | 77 draw_checkerboard_for_missing_tiles_(false), |
|
vmpstr
2015/08/03 23:53:38
ditto
danakj
2015/08/03 23:58:05
Done.
| |
| 78 force_render_surface_(false), | 78 force_render_surface_(false), |
| 79 transform_is_invertible_(true), | 79 transform_is_invertible_(true), |
| 80 has_render_surface_(false), | 80 has_render_surface_(false), |
| 81 scroll_blocks_on_(SCROLL_BLOCKS_ON_NONE), | 81 scroll_blocks_on_(SCROLL_BLOCKS_ON_NONE), |
| 82 background_color_(0), | 82 background_color_(0), |
| 83 opacity_(1.f), | 83 opacity_(1.f), |
| 84 blend_mode_(SkXfermode::kSrcOver_Mode), | 84 blend_mode_(SkXfermode::kSrcOver_Mode), |
| 85 scroll_parent_(nullptr), | 85 scroll_parent_(nullptr), |
| 86 layer_or_descendant_is_drawn_tracker_(0), | 86 layer_or_descendant_is_drawn_tracker_(0), |
| 87 sorted_for_recursion_tracker_(0), | 87 sorted_for_recursion_tracker_(0), |
| (...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 988 } | 988 } |
| 989 | 989 |
| 990 void Layer::SetScrollBlocksOn(ScrollBlocksOn scroll_blocks_on) { | 990 void Layer::SetScrollBlocksOn(ScrollBlocksOn scroll_blocks_on) { |
| 991 DCHECK(IsPropertyChangeAllowed()); | 991 DCHECK(IsPropertyChangeAllowed()); |
| 992 if (scroll_blocks_on_ == scroll_blocks_on) | 992 if (scroll_blocks_on_ == scroll_blocks_on) |
| 993 return; | 993 return; |
| 994 scroll_blocks_on_ = scroll_blocks_on; | 994 scroll_blocks_on_ = scroll_blocks_on; |
| 995 SetNeedsCommit(); | 995 SetNeedsCommit(); |
| 996 } | 996 } |
| 997 | 997 |
| 998 void Layer::SetDrawCheckerboardForMissingTiles(bool checkerboard) { | |
| 999 DCHECK(IsPropertyChangeAllowed()); | |
| 1000 if (draw_checkerboard_for_missing_tiles_ == checkerboard) | |
| 1001 return; | |
| 1002 draw_checkerboard_for_missing_tiles_ = checkerboard; | |
| 1003 SetNeedsCommit(); | |
| 1004 } | |
| 1005 | |
| 1006 void Layer::SetForceRenderSurface(bool force) { | 998 void Layer::SetForceRenderSurface(bool force) { |
| 1007 DCHECK(IsPropertyChangeAllowed()); | 999 DCHECK(IsPropertyChangeAllowed()); |
| 1008 if (force_render_surface_ == force) | 1000 if (force_render_surface_ == force) |
| 1009 return; | 1001 return; |
| 1010 force_render_surface_ = force; | 1002 force_render_surface_ = force; |
| 1011 SetNeedsCommit(); | 1003 SetNeedsCommit(); |
| 1012 } | 1004 } |
| 1013 | 1005 |
| 1014 void Layer::SetDoubleSided(bool double_sided) { | 1006 void Layer::SetDoubleSided(bool double_sided) { |
| 1015 DCHECK(IsPropertyChangeAllowed()); | 1007 DCHECK(IsPropertyChangeAllowed()); |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1181 : bounds_); | 1173 : bounds_); |
| 1182 | 1174 |
| 1183 if (frame_viewer_instrumentation::IsTracingLayerTreeSnapshots()) | 1175 if (frame_viewer_instrumentation::IsTracingLayerTreeSnapshots()) |
| 1184 layer->SetDebugInfo(TakeDebugInfo()); | 1176 layer->SetDebugInfo(TakeDebugInfo()); |
| 1185 | 1177 |
| 1186 layer->SetTransformTreeIndex(transform_tree_index()); | 1178 layer->SetTransformTreeIndex(transform_tree_index()); |
| 1187 layer->SetOpacityTreeIndex(opacity_tree_index()); | 1179 layer->SetOpacityTreeIndex(opacity_tree_index()); |
| 1188 layer->SetClipTreeIndex(clip_tree_index()); | 1180 layer->SetClipTreeIndex(clip_tree_index()); |
| 1189 layer->set_offset_to_transform_parent(offset_to_transform_parent_); | 1181 layer->set_offset_to_transform_parent(offset_to_transform_parent_); |
| 1190 layer->SetDoubleSided(double_sided_); | 1182 layer->SetDoubleSided(double_sided_); |
| 1191 layer->SetDrawCheckerboardForMissingTiles( | |
| 1192 draw_checkerboard_for_missing_tiles_); | |
| 1193 layer->SetDrawsContent(DrawsContent()); | 1183 layer->SetDrawsContent(DrawsContent()); |
| 1194 layer->SetHideLayerAndSubtree(hide_layer_and_subtree_); | 1184 layer->SetHideLayerAndSubtree(hide_layer_and_subtree_); |
| 1195 layer->SetHasRenderSurface(has_render_surface_); | 1185 layer->SetHasRenderSurface(has_render_surface_); |
| 1196 if (!layer->FilterIsAnimatingOnImplOnly() && !FilterIsAnimating()) | 1186 if (!layer->FilterIsAnimatingOnImplOnly() && !FilterIsAnimating()) |
| 1197 layer->SetFilters(filters_); | 1187 layer->SetFilters(filters_); |
| 1198 DCHECK(!(FilterIsAnimating() && layer->FilterIsAnimatingOnImplOnly())); | 1188 DCHECK(!(FilterIsAnimating() && layer->FilterIsAnimatingOnImplOnly())); |
| 1199 layer->SetBackgroundFilters(background_filters()); | 1189 layer->SetBackgroundFilters(background_filters()); |
| 1200 layer->SetMasksToBounds(masks_to_bounds_); | 1190 layer->SetMasksToBounds(masks_to_bounds_); |
| 1201 layer->SetShouldScrollOnMainThread(should_scroll_on_main_thread_); | 1191 layer->SetShouldScrollOnMainThread(should_scroll_on_main_thread_); |
| 1202 layer->SetHaveWheelEventHandlers(have_wheel_event_handlers_); | 1192 layer->SetHaveWheelEventHandlers(have_wheel_event_handlers_); |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1663 ? layer_tree_host()->meta_information_sequence_number() | 1653 ? layer_tree_host()->meta_information_sequence_number() |
| 1664 : 0; | 1654 : 0; |
| 1665 } | 1655 } |
| 1666 | 1656 |
| 1667 bool Layer::sorted_for_recursion() { | 1657 bool Layer::sorted_for_recursion() { |
| 1668 return sorted_for_recursion_tracker_ == | 1658 return sorted_for_recursion_tracker_ == |
| 1669 layer_tree_host()->meta_information_sequence_number(); | 1659 layer_tree_host()->meta_information_sequence_number(); |
| 1670 } | 1660 } |
| 1671 | 1661 |
| 1672 } // namespace cc | 1662 } // namespace cc |
| OLD | NEW |