OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_impl.h" | 5 #include "cc/layers/layer_impl.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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 should_check_backface_visibility_(false), | 67 should_check_backface_visibility_(false), |
68 draws_content_(false), | 68 draws_content_(false), |
69 is_drawn_render_surface_layer_list_member_(false), | 69 is_drawn_render_surface_layer_list_member_(false), |
70 was_ever_ready_since_last_transform_animation_(true), | 70 was_ever_ready_since_last_transform_animation_(true), |
71 background_color_(0), | 71 background_color_(0), |
72 safe_opaque_background_color_(0), | 72 safe_opaque_background_color_(0), |
73 draw_blend_mode_(SkBlendMode::kSrcOver), | 73 draw_blend_mode_(SkBlendMode::kSrcOver), |
74 transform_tree_index_(TransformTree::kInvalidNodeId), | 74 transform_tree_index_(TransformTree::kInvalidNodeId), |
75 effect_tree_index_(EffectTree::kInvalidNodeId), | 75 effect_tree_index_(EffectTree::kInvalidNodeId), |
76 clip_tree_index_(ClipTree::kInvalidNodeId), | 76 clip_tree_index_(ClipTree::kInvalidNodeId), |
| 77 new_clip_tree_index_(ClipTree::kInvalidNodeId), |
77 scroll_tree_index_(ScrollTree::kInvalidNodeId), | 78 scroll_tree_index_(ScrollTree::kInvalidNodeId), |
78 sorting_context_id_(0), | 79 sorting_context_id_(0), |
79 current_draw_mode_(DRAW_MODE_NONE), | 80 current_draw_mode_(DRAW_MODE_NONE), |
80 mutable_properties_(MutableProperty::kNone), | 81 mutable_properties_(MutableProperty::kNone), |
81 debug_info_(nullptr), | 82 debug_info_(nullptr), |
82 has_preferred_raster_bounds_(false), | 83 has_preferred_raster_bounds_(false), |
83 has_will_change_transform_hint_(false), | 84 has_will_change_transform_hint_(false), |
84 needs_push_properties_(false), | 85 needs_push_properties_(false), |
85 scrollbars_hidden_(false) { | 86 scrollbars_hidden_(false) { |
86 DCHECK_GT(layer_id_, 0); | 87 DCHECK_GT(layer_id_, 0); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 } | 142 } |
142 | 143 |
143 void LayerImpl::SetTransformTreeIndex(int index) { | 144 void LayerImpl::SetTransformTreeIndex(int index) { |
144 transform_tree_index_ = index; | 145 transform_tree_index_ = index; |
145 } | 146 } |
146 | 147 |
147 void LayerImpl::SetClipTreeIndex(int index) { | 148 void LayerImpl::SetClipTreeIndex(int index) { |
148 clip_tree_index_ = index; | 149 clip_tree_index_ = index; |
149 } | 150 } |
150 | 151 |
| 152 void LayerImpl::SetNewClipTreeIndex(int index) { |
| 153 new_clip_tree_index_ = index; |
| 154 } |
| 155 |
151 void LayerImpl::SetEffectTreeIndex(int index) { | 156 void LayerImpl::SetEffectTreeIndex(int index) { |
152 effect_tree_index_ = index; | 157 effect_tree_index_ = index; |
153 } | 158 } |
154 | 159 |
155 int LayerImpl::render_target_effect_tree_index() const { | 160 int LayerImpl::render_target_effect_tree_index() const { |
156 EffectNode* effect_node = | 161 EffectNode* effect_node = |
157 layer_tree_impl_->property_trees()->effect_tree.Node(effect_tree_index_); | 162 layer_tree_impl_->property_trees()->effect_tree.Node(effect_tree_index_); |
158 if (effect_node->render_surface) | 163 if (effect_node->render_surface) |
159 return effect_node->id; | 164 return effect_node->id; |
160 else | 165 else |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 layer->draws_content_ = draws_content_; | 350 layer->draws_content_ = draws_content_; |
346 layer->non_fast_scrollable_region_ = non_fast_scrollable_region_; | 351 layer->non_fast_scrollable_region_ = non_fast_scrollable_region_; |
347 layer->touch_event_handler_region_ = touch_event_handler_region_; | 352 layer->touch_event_handler_region_ = touch_event_handler_region_; |
348 layer->background_color_ = background_color_; | 353 layer->background_color_ = background_color_; |
349 layer->safe_opaque_background_color_ = safe_opaque_background_color_; | 354 layer->safe_opaque_background_color_ = safe_opaque_background_color_; |
350 layer->draw_blend_mode_ = draw_blend_mode_; | 355 layer->draw_blend_mode_ = draw_blend_mode_; |
351 layer->position_ = position_; | 356 layer->position_ = position_; |
352 layer->transform_tree_index_ = transform_tree_index_; | 357 layer->transform_tree_index_ = transform_tree_index_; |
353 layer->effect_tree_index_ = effect_tree_index_; | 358 layer->effect_tree_index_ = effect_tree_index_; |
354 layer->clip_tree_index_ = clip_tree_index_; | 359 layer->clip_tree_index_ = clip_tree_index_; |
| 360 layer->new_clip_tree_index_ = new_clip_tree_index_; |
355 layer->scroll_tree_index_ = scroll_tree_index_; | 361 layer->scroll_tree_index_ = scroll_tree_index_; |
356 layer->sorting_context_id_ = sorting_context_id_; | 362 layer->sorting_context_id_ = sorting_context_id_; |
357 layer->has_will_change_transform_hint_ = has_will_change_transform_hint_; | 363 layer->has_will_change_transform_hint_ = has_will_change_transform_hint_; |
358 layer->scrollbars_hidden_ = scrollbars_hidden_; | 364 layer->scrollbars_hidden_ = scrollbars_hidden_; |
359 | 365 |
360 if (layer_property_changed_) { | 366 if (layer_property_changed_) { |
361 layer->layer_tree_impl()->set_needs_update_draw_properties(); | 367 layer->layer_tree_impl()->set_needs_update_draw_properties(); |
362 layer->layer_property_changed_ = true; | 368 layer->layer_property_changed_ = true; |
363 } | 369 } |
364 | 370 |
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1099 .layer_transforms_should_scale_layer_contents) { | 1105 .layer_transforms_should_scale_layer_contents) { |
1100 return default_scale; | 1106 return default_scale; |
1101 } | 1107 } |
1102 | 1108 |
1103 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( | 1109 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( |
1104 ScreenSpaceTransform(), default_scale); | 1110 ScreenSpaceTransform(), default_scale); |
1105 return std::max(transform_scales.x(), transform_scales.y()); | 1111 return std::max(transform_scales.x(), transform_scales.y()); |
1106 } | 1112 } |
1107 | 1113 |
1108 } // namespace cc | 1114 } // namespace cc |
OLD | NEW |