| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 masks_to_bounds_(false), | 62 masks_to_bounds_(false), |
| 63 contents_opaque_(false), | 63 contents_opaque_(false), |
| 64 use_parent_backface_visibility_(false), | 64 use_parent_backface_visibility_(false), |
| 65 use_local_transform_for_backface_visibility_(false), | 65 use_local_transform_for_backface_visibility_(false), |
| 66 should_check_backface_visibility_(false), | 66 should_check_backface_visibility_(false), |
| 67 draws_content_(false), | 67 draws_content_(false), |
| 68 is_drawn_render_surface_layer_list_member_(false), | 68 is_drawn_render_surface_layer_list_member_(false), |
| 69 was_ever_ready_since_last_transform_animation_(true), | 69 was_ever_ready_since_last_transform_animation_(true), |
| 70 background_color_(0), | 70 background_color_(0), |
| 71 safe_opaque_background_color_(0), | 71 safe_opaque_background_color_(0), |
| 72 blend_mode_(SkXfermode::kSrcOver_Mode), | |
| 73 draw_blend_mode_(SkXfermode::kSrcOver_Mode), | 72 draw_blend_mode_(SkXfermode::kSrcOver_Mode), |
| 74 transform_tree_index_(-1), | 73 transform_tree_index_(-1), |
| 75 effect_tree_index_(-1), | 74 effect_tree_index_(-1), |
| 76 clip_tree_index_(-1), | 75 clip_tree_index_(-1), |
| 77 scroll_tree_index_(-1), | 76 scroll_tree_index_(-1), |
| 78 sorting_context_id_(0), | 77 sorting_context_id_(0), |
| 79 current_draw_mode_(DRAW_MODE_NONE), | 78 current_draw_mode_(DRAW_MODE_NONE), |
| 80 mutable_properties_(MutableProperty::kNone), | 79 mutable_properties_(MutableProperty::kNone), |
| 81 debug_info_(nullptr), | 80 debug_info_(nullptr), |
| 82 scrolls_drawn_descendant_(false), | 81 scrolls_drawn_descendant_(false), |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 layer->contents_opaque_ = contents_opaque_; | 342 layer->contents_opaque_ = contents_opaque_; |
| 344 layer->use_parent_backface_visibility_ = use_parent_backface_visibility_; | 343 layer->use_parent_backface_visibility_ = use_parent_backface_visibility_; |
| 345 layer->use_local_transform_for_backface_visibility_ = | 344 layer->use_local_transform_for_backface_visibility_ = |
| 346 use_local_transform_for_backface_visibility_; | 345 use_local_transform_for_backface_visibility_; |
| 347 layer->should_check_backface_visibility_ = should_check_backface_visibility_; | 346 layer->should_check_backface_visibility_ = should_check_backface_visibility_; |
| 348 layer->draws_content_ = draws_content_; | 347 layer->draws_content_ = draws_content_; |
| 349 layer->non_fast_scrollable_region_ = non_fast_scrollable_region_; | 348 layer->non_fast_scrollable_region_ = non_fast_scrollable_region_; |
| 350 layer->touch_event_handler_region_ = touch_event_handler_region_; | 349 layer->touch_event_handler_region_ = touch_event_handler_region_; |
| 351 layer->background_color_ = background_color_; | 350 layer->background_color_ = background_color_; |
| 352 layer->safe_opaque_background_color_ = safe_opaque_background_color_; | 351 layer->safe_opaque_background_color_ = safe_opaque_background_color_; |
| 353 layer->blend_mode_ = blend_mode_; | |
| 354 layer->draw_blend_mode_ = draw_blend_mode_; | 352 layer->draw_blend_mode_ = draw_blend_mode_; |
| 355 layer->position_ = position_; | 353 layer->position_ = position_; |
| 356 layer->transform_ = transform_; | 354 layer->transform_ = transform_; |
| 357 layer->transform_tree_index_ = transform_tree_index_; | 355 layer->transform_tree_index_ = transform_tree_index_; |
| 358 layer->effect_tree_index_ = effect_tree_index_; | 356 layer->effect_tree_index_ = effect_tree_index_; |
| 359 layer->clip_tree_index_ = clip_tree_index_; | 357 layer->clip_tree_index_ = clip_tree_index_; |
| 360 layer->scroll_tree_index_ = scroll_tree_index_; | 358 layer->scroll_tree_index_ = scroll_tree_index_; |
| 361 layer->sorting_context_id_ = sorting_context_id_; | 359 layer->sorting_context_id_ = sorting_context_id_; |
| 362 layer->has_will_change_transform_hint_ = has_will_change_transform_hint_; | 360 layer->has_will_change_transform_hint_ = has_will_change_transform_hint_; |
| 363 | 361 |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 855 return; | 853 return; |
| 856 | 854 |
| 857 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("compositor-worker"), | 855 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("compositor-worker"), |
| 858 "LayerImpl::SetMutableProperties", "properties", properties); | 856 "LayerImpl::SetMutableProperties", "properties", properties); |
| 859 | 857 |
| 860 mutable_properties_ = properties; | 858 mutable_properties_ = properties; |
| 861 // If this layer is already in the element map, update its properties. | 859 // If this layer is already in the element map, update its properties. |
| 862 layer_tree_impl_->AddToElementMap(this); | 860 layer_tree_impl_->AddToElementMap(this); |
| 863 } | 861 } |
| 864 | 862 |
| 865 void LayerImpl::SetBlendMode(SkXfermode::Mode blend_mode) { | |
| 866 blend_mode_ = blend_mode; | |
| 867 } | |
| 868 | |
| 869 void LayerImpl::SetPosition(const gfx::PointF& position) { | 863 void LayerImpl::SetPosition(const gfx::PointF& position) { |
| 870 position_ = position; | 864 position_ = position; |
| 871 } | 865 } |
| 872 | 866 |
| 873 void LayerImpl::Set3dSortingContextId(int id) { | 867 void LayerImpl::Set3dSortingContextId(int id) { |
| 874 sorting_context_id_ = id; | 868 sorting_context_id_ = id; |
| 875 } | 869 } |
| 876 | 870 |
| 877 void LayerImpl::SetTransform(const gfx::Transform& transform) { | 871 void LayerImpl::SetTransform(const gfx::Transform& transform) { |
| 878 transform_ = transform; | 872 transform_ = transform; |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1213 .layer_transforms_should_scale_layer_contents) { | 1207 .layer_transforms_should_scale_layer_contents) { |
| 1214 return default_scale; | 1208 return default_scale; |
| 1215 } | 1209 } |
| 1216 | 1210 |
| 1217 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( | 1211 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( |
| 1218 ScreenSpaceTransform(), default_scale); | 1212 ScreenSpaceTransform(), default_scale); |
| 1219 return std::max(transform_scales.x(), transform_scales.y()); | 1213 return std::max(transform_scales.x(), transform_scales.y()); |
| 1220 } | 1214 } |
| 1221 | 1215 |
| 1222 } // namespace cc | 1216 } // namespace cc |
| OLD | NEW |