| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 scroll_tree_index_(ScrollTree::kInvalidNodeId), | 77 scroll_tree_index_(ScrollTree::kInvalidNodeId), |
| 78 sorting_context_id_(0), | 78 sorting_context_id_(0), |
| 79 current_draw_mode_(DRAW_MODE_NONE), | 79 current_draw_mode_(DRAW_MODE_NONE), |
| 80 mutable_properties_(MutableProperty::kNone), | 80 mutable_properties_(MutableProperty::kNone), |
| 81 debug_info_(nullptr), | 81 debug_info_(nullptr), |
| 82 has_preferred_raster_bounds_(false), | 82 has_preferred_raster_bounds_(false), |
| 83 scrolls_drawn_descendant_(false), | 83 scrolls_drawn_descendant_(false), |
| 84 has_will_change_transform_hint_(false), | 84 has_will_change_transform_hint_(false), |
| 85 needs_push_properties_(false) { | 85 needs_push_properties_(false), |
| 86 scrollbars_hidden_(false) { |
| 86 DCHECK_GT(layer_id_, 0); | 87 DCHECK_GT(layer_id_, 0); |
| 87 | 88 |
| 88 DCHECK(layer_tree_impl_); | 89 DCHECK(layer_tree_impl_); |
| 89 layer_tree_impl_->RegisterLayer(this); | 90 layer_tree_impl_->RegisterLayer(this); |
| 90 layer_tree_impl_->AddToElementMap(this); | 91 layer_tree_impl_->AddToElementMap(this); |
| 91 | 92 |
| 92 SetNeedsPushProperties(); | 93 SetNeedsPushProperties(); |
| 93 } | 94 } |
| 94 | 95 |
| 95 LayerImpl::~LayerImpl() { | 96 LayerImpl::~LayerImpl() { |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 layer->background_color_ = background_color_; | 349 layer->background_color_ = background_color_; |
| 349 layer->safe_opaque_background_color_ = safe_opaque_background_color_; | 350 layer->safe_opaque_background_color_ = safe_opaque_background_color_; |
| 350 layer->draw_blend_mode_ = draw_blend_mode_; | 351 layer->draw_blend_mode_ = draw_blend_mode_; |
| 351 layer->position_ = position_; | 352 layer->position_ = position_; |
| 352 layer->transform_tree_index_ = transform_tree_index_; | 353 layer->transform_tree_index_ = transform_tree_index_; |
| 353 layer->effect_tree_index_ = effect_tree_index_; | 354 layer->effect_tree_index_ = effect_tree_index_; |
| 354 layer->clip_tree_index_ = clip_tree_index_; | 355 layer->clip_tree_index_ = clip_tree_index_; |
| 355 layer->scroll_tree_index_ = scroll_tree_index_; | 356 layer->scroll_tree_index_ = scroll_tree_index_; |
| 356 layer->sorting_context_id_ = sorting_context_id_; | 357 layer->sorting_context_id_ = sorting_context_id_; |
| 357 layer->has_will_change_transform_hint_ = has_will_change_transform_hint_; | 358 layer->has_will_change_transform_hint_ = has_will_change_transform_hint_; |
| 359 layer->scrollbars_hidden_ = scrollbars_hidden_; |
| 358 | 360 |
| 359 if (layer_property_changed_) { | 361 if (layer_property_changed_) { |
| 360 layer->layer_tree_impl()->set_needs_update_draw_properties(); | 362 layer->layer_tree_impl()->set_needs_update_draw_properties(); |
| 361 layer->layer_property_changed_ = true; | 363 layer->layer_property_changed_ = true; |
| 362 } | 364 } |
| 363 | 365 |
| 364 // If whether layer has render surface changes, we need to update draw | 366 // If whether layer has render surface changes, we need to update draw |
| 365 // properties. | 367 // properties. |
| 366 // TODO(weiliangc): Should be safely removed after impl side is able to | 368 // TODO(weiliangc): Should be safely removed after impl side is able to |
| 367 // update render surfaces without rebuilding property trees. | 369 // update render surfaces without rebuilding property trees. |
| (...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1097 .layer_transforms_should_scale_layer_contents) { | 1099 .layer_transforms_should_scale_layer_contents) { |
| 1098 return default_scale; | 1100 return default_scale; |
| 1099 } | 1101 } |
| 1100 | 1102 |
| 1101 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( | 1103 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( |
| 1102 ScreenSpaceTransform(), default_scale); | 1104 ScreenSpaceTransform(), default_scale); |
| 1103 return std::max(transform_scales.x(), transform_scales.y()); | 1105 return std::max(transform_scales.x(), transform_scales.y()); |
| 1104 } | 1106 } |
| 1105 | 1107 |
| 1106 } // namespace cc | 1108 } // namespace cc |
| OLD | NEW |