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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 masks_to_bounds_(false), | 81 masks_to_bounds_(false), |
82 contents_opaque_(false), | 82 contents_opaque_(false), |
83 double_sided_(true), | 83 double_sided_(true), |
84 should_flatten_transform_(true), | 84 should_flatten_transform_(true), |
85 use_parent_backface_visibility_(false), | 85 use_parent_backface_visibility_(false), |
86 use_local_transform_for_backface_visibility_(false), | 86 use_local_transform_for_backface_visibility_(false), |
87 should_check_backface_visibility_(false), | 87 should_check_backface_visibility_(false), |
88 force_render_surface_(false), | 88 force_render_surface_(false), |
89 transform_is_invertible_(true), | 89 transform_is_invertible_(true), |
90 has_render_surface_(false), | 90 has_render_surface_(false), |
| 91 subtree_property_changed_(false), |
91 background_color_(0), | 92 background_color_(0), |
92 opacity_(1.f), | 93 opacity_(1.f), |
93 blend_mode_(SkXfermode::kSrcOver_Mode), | 94 blend_mode_(SkXfermode::kSrcOver_Mode), |
94 draw_blend_mode_(SkXfermode::kSrcOver_Mode), | 95 draw_blend_mode_(SkXfermode::kSrcOver_Mode), |
95 scroll_parent_(nullptr), | 96 scroll_parent_(nullptr), |
96 layer_or_descendant_is_drawn_tracker_(0), | 97 layer_or_descendant_is_drawn_tracker_(0), |
97 sorted_for_recursion_tracker_(0), | 98 sorted_for_recursion_tracker_(0), |
98 visited_tracker_(0), | 99 visited_tracker_(0), |
99 clip_parent_(nullptr), | 100 clip_parent_(nullptr), |
100 replica_layer_(nullptr), | 101 replica_layer_(nullptr), |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 auto it = std::find_if(copy_requests_.begin(), copy_requests_.end(), | 418 auto it = std::find_if(copy_requests_.begin(), copy_requests_.end(), |
418 [source](const scoped_ptr<CopyOutputRequest>& x) { | 419 [source](const scoped_ptr<CopyOutputRequest>& x) { |
419 return x->source() == source; | 420 return x->source() == source; |
420 }); | 421 }); |
421 if (it != copy_requests_.end()) | 422 if (it != copy_requests_.end()) |
422 copy_requests_.erase(it); | 423 copy_requests_.erase(it); |
423 } | 424 } |
424 if (request->IsEmpty()) | 425 if (request->IsEmpty()) |
425 return; | 426 return; |
426 copy_requests_.push_back(std::move(request)); | 427 copy_requests_.push_back(std::move(request)); |
| 428 SetSubtreePropertyChanged(); |
427 SetNeedsCommit(); | 429 SetNeedsCommit(); |
428 } | 430 } |
429 | 431 |
430 void Layer::SetBackgroundColor(SkColor background_color) { | 432 void Layer::SetBackgroundColor(SkColor background_color) { |
431 DCHECK(IsPropertyChangeAllowed()); | 433 DCHECK(IsPropertyChangeAllowed()); |
432 if (background_color_ == background_color) | 434 if (background_color_ == background_color) |
433 return; | 435 return; |
434 background_color_ = background_color; | 436 background_color_ = background_color; |
435 SetNeedsCommit(); | 437 SetNeedsCommit(); |
436 } | 438 } |
(...skipping 16 matching lines...) Expand all Loading... |
453 } | 455 } |
454 return color; | 456 return color; |
455 } | 457 } |
456 | 458 |
457 void Layer::SetMasksToBounds(bool masks_to_bounds) { | 459 void Layer::SetMasksToBounds(bool masks_to_bounds) { |
458 DCHECK(IsPropertyChangeAllowed()); | 460 DCHECK(IsPropertyChangeAllowed()); |
459 if (masks_to_bounds_ == masks_to_bounds) | 461 if (masks_to_bounds_ == masks_to_bounds) |
460 return; | 462 return; |
461 masks_to_bounds_ = masks_to_bounds; | 463 masks_to_bounds_ = masks_to_bounds; |
462 SetNeedsCommit(); | 464 SetNeedsCommit(); |
| 465 SetSubtreePropertyChanged(); |
463 } | 466 } |
464 | 467 |
465 void Layer::SetMaskLayer(Layer* mask_layer) { | 468 void Layer::SetMaskLayer(Layer* mask_layer) { |
466 DCHECK(IsPropertyChangeAllowed()); | 469 DCHECK(IsPropertyChangeAllowed()); |
467 if (mask_layer_.get() == mask_layer) | 470 if (mask_layer_.get() == mask_layer) |
468 return; | 471 return; |
469 if (mask_layer_.get()) { | 472 if (mask_layer_.get()) { |
470 DCHECK_EQ(this, mask_layer_->parent()); | 473 DCHECK_EQ(this, mask_layer_->parent()); |
471 mask_layer_->RemoveFromParent(); | 474 mask_layer_->RemoveFromParent(); |
472 } | 475 } |
473 mask_layer_ = mask_layer; | 476 mask_layer_ = mask_layer; |
474 if (mask_layer_.get()) { | 477 if (mask_layer_.get()) { |
475 DCHECK(!mask_layer_->parent()); | 478 DCHECK(!mask_layer_->parent()); |
476 mask_layer_->RemoveFromParent(); | 479 mask_layer_->RemoveFromParent(); |
477 mask_layer_->SetParent(this); | 480 mask_layer_->SetParent(this); |
478 mask_layer_->SetIsMask(true); | 481 mask_layer_->SetIsMask(true); |
479 } | 482 } |
| 483 SetSubtreePropertyChanged(); |
480 SetNeedsFullTreeSync(); | 484 SetNeedsFullTreeSync(); |
481 } | 485 } |
482 | 486 |
483 void Layer::SetReplicaLayer(Layer* layer) { | 487 void Layer::SetReplicaLayer(Layer* layer) { |
484 DCHECK(IsPropertyChangeAllowed()); | 488 DCHECK(IsPropertyChangeAllowed()); |
485 if (replica_layer_.get() == layer) | 489 if (replica_layer_.get() == layer) |
486 return; | 490 return; |
487 if (replica_layer_.get()) { | 491 if (replica_layer_.get()) { |
488 DCHECK_EQ(this, replica_layer_->parent()); | 492 DCHECK_EQ(this, replica_layer_->parent()); |
489 replica_layer_->RemoveFromParent(); | 493 replica_layer_->RemoveFromParent(); |
490 } | 494 } |
491 replica_layer_ = layer; | 495 replica_layer_ = layer; |
492 if (replica_layer_.get()) { | 496 if (replica_layer_.get()) { |
493 DCHECK(!replica_layer_->parent()); | 497 DCHECK(!replica_layer_->parent()); |
494 replica_layer_->RemoveFromParent(); | 498 replica_layer_->RemoveFromParent(); |
495 replica_layer_->SetParent(this); | 499 replica_layer_->SetParent(this); |
496 } | 500 } |
| 501 SetSubtreePropertyChanged(); |
497 SetNeedsFullTreeSync(); | 502 SetNeedsFullTreeSync(); |
498 } | 503 } |
499 | 504 |
500 void Layer::SetFilters(const FilterOperations& filters) { | 505 void Layer::SetFilters(const FilterOperations& filters) { |
501 DCHECK(IsPropertyChangeAllowed()); | 506 DCHECK(IsPropertyChangeAllowed()); |
502 if (filters_ == filters) | 507 if (filters_ == filters) |
503 return; | 508 return; |
504 filters_ = filters; | 509 filters_ = filters; |
505 SetNeedsCommit(); | 510 SetNeedsCommit(); |
506 } | 511 } |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 case SkXfermode::kPlus_Mode: | 608 case SkXfermode::kPlus_Mode: |
604 case SkXfermode::kModulate_Mode: | 609 case SkXfermode::kModulate_Mode: |
605 // Porter Duff Compositing Operators are not yet supported | 610 // Porter Duff Compositing Operators are not yet supported |
606 // http://dev.w3.org/fxtf/compositing-1/#porterduffcompositingoperators | 611 // http://dev.w3.org/fxtf/compositing-1/#porterduffcompositingoperators |
607 NOTREACHED(); | 612 NOTREACHED(); |
608 return; | 613 return; |
609 } | 614 } |
610 | 615 |
611 blend_mode_ = blend_mode; | 616 blend_mode_ = blend_mode; |
612 SetNeedsCommit(); | 617 SetNeedsCommit(); |
| 618 SetSubtreePropertyChanged(); |
613 } | 619 } |
614 | 620 |
615 void Layer::SetIsRootForIsolatedGroup(bool root) { | 621 void Layer::SetIsRootForIsolatedGroup(bool root) { |
616 DCHECK(IsPropertyChangeAllowed()); | 622 DCHECK(IsPropertyChangeAllowed()); |
617 if (is_root_for_isolated_group_ == root) | 623 if (is_root_for_isolated_group_ == root) |
618 return; | 624 return; |
619 is_root_for_isolated_group_ = root; | 625 is_root_for_isolated_group_ = root; |
620 SetNeedsCommit(); | 626 SetNeedsCommit(); |
621 } | 627 } |
622 | 628 |
623 void Layer::SetContentsOpaque(bool opaque) { | 629 void Layer::SetContentsOpaque(bool opaque) { |
624 DCHECK(IsPropertyChangeAllowed()); | 630 DCHECK(IsPropertyChangeAllowed()); |
625 if (contents_opaque_ == opaque) | 631 if (contents_opaque_ == opaque) |
626 return; | 632 return; |
627 contents_opaque_ = opaque; | 633 contents_opaque_ = opaque; |
628 SetNeedsCommit(); | 634 SetNeedsCommit(); |
| 635 SetSubtreePropertyChanged(); |
629 } | 636 } |
630 | 637 |
631 void Layer::SetPosition(const gfx::PointF& position) { | 638 void Layer::SetPosition(const gfx::PointF& position) { |
632 DCHECK(IsPropertyChangeAllowed()); | 639 DCHECK(IsPropertyChangeAllowed()); |
633 if (position_ == position) | 640 if (position_ == position) |
634 return; | 641 return; |
635 position_ = position; | 642 position_ = position; |
636 | 643 |
637 if (!layer_tree_host_) | 644 if (!layer_tree_host_) |
638 return; | 645 return; |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
995 force_render_surface_ = force; | 1002 force_render_surface_ = force; |
996 SetNeedsCommit(); | 1003 SetNeedsCommit(); |
997 } | 1004 } |
998 | 1005 |
999 void Layer::SetDoubleSided(bool double_sided) { | 1006 void Layer::SetDoubleSided(bool double_sided) { |
1000 DCHECK(IsPropertyChangeAllowed()); | 1007 DCHECK(IsPropertyChangeAllowed()); |
1001 if (double_sided_ == double_sided) | 1008 if (double_sided_ == double_sided) |
1002 return; | 1009 return; |
1003 double_sided_ = double_sided; | 1010 double_sided_ = double_sided; |
1004 SetNeedsCommit(); | 1011 SetNeedsCommit(); |
| 1012 SetSubtreePropertyChanged(); |
1005 } | 1013 } |
1006 | 1014 |
1007 void Layer::Set3dSortingContextId(int id) { | 1015 void Layer::Set3dSortingContextId(int id) { |
1008 DCHECK(IsPropertyChangeAllowed()); | 1016 DCHECK(IsPropertyChangeAllowed()); |
1009 if (id == sorting_context_id_) | 1017 if (id == sorting_context_id_) |
1010 return; | 1018 return; |
1011 sorting_context_id_ = id; | 1019 sorting_context_id_ = id; |
1012 SetNeedsCommit(); | 1020 SetNeedsCommit(); |
| 1021 SetSubtreePropertyChanged(); |
1013 } | 1022 } |
1014 | 1023 |
1015 void Layer::SetTransformTreeIndex(int index) { | 1024 void Layer::SetTransformTreeIndex(int index) { |
1016 DCHECK(IsPropertyChangeAllowed()); | 1025 DCHECK(IsPropertyChangeAllowed()); |
1017 if (transform_tree_index_ == index) | 1026 if (transform_tree_index_ == index) |
1018 return; | 1027 return; |
1019 transform_tree_index_ = index; | 1028 transform_tree_index_ = index; |
1020 SetNeedsPushProperties(); | 1029 SetNeedsPushProperties(); |
1021 } | 1030 } |
1022 | 1031 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1086 SetClipTreeIndex(invalid_property_tree_index); | 1095 SetClipTreeIndex(invalid_property_tree_index); |
1087 SetEffectTreeIndex(invalid_property_tree_index); | 1096 SetEffectTreeIndex(invalid_property_tree_index); |
1088 } | 1097 } |
1089 | 1098 |
1090 void Layer::SetShouldFlattenTransform(bool should_flatten) { | 1099 void Layer::SetShouldFlattenTransform(bool should_flatten) { |
1091 DCHECK(IsPropertyChangeAllowed()); | 1100 DCHECK(IsPropertyChangeAllowed()); |
1092 if (should_flatten_transform_ == should_flatten) | 1101 if (should_flatten_transform_ == should_flatten) |
1093 return; | 1102 return; |
1094 should_flatten_transform_ = should_flatten; | 1103 should_flatten_transform_ = should_flatten; |
1095 SetNeedsCommit(); | 1104 SetNeedsCommit(); |
| 1105 SetSubtreePropertyChanged(); |
1096 } | 1106 } |
1097 | 1107 |
1098 void Layer::SetUseParentBackfaceVisibility(bool use) { | 1108 void Layer::SetUseParentBackfaceVisibility(bool use) { |
1099 DCHECK(IsPropertyChangeAllowed()); | 1109 DCHECK(IsPropertyChangeAllowed()); |
1100 if (use_parent_backface_visibility_ == use) | 1110 if (use_parent_backface_visibility_ == use) |
1101 return; | 1111 return; |
1102 use_parent_backface_visibility_ = use; | 1112 use_parent_backface_visibility_ = use; |
1103 SetNeedsPushProperties(); | 1113 SetNeedsPushProperties(); |
1104 } | 1114 } |
1105 | 1115 |
(...skipping 21 matching lines...) Expand all Loading... |
1127 UpdateDrawsContent(HasDrawableContent()); | 1137 UpdateDrawsContent(HasDrawableContent()); |
1128 } | 1138 } |
1129 | 1139 |
1130 void Layer::SetHideLayerAndSubtree(bool hide) { | 1140 void Layer::SetHideLayerAndSubtree(bool hide) { |
1131 DCHECK(IsPropertyChangeAllowed()); | 1141 DCHECK(IsPropertyChangeAllowed()); |
1132 if (hide_layer_and_subtree_ == hide) | 1142 if (hide_layer_and_subtree_ == hide) |
1133 return; | 1143 return; |
1134 | 1144 |
1135 hide_layer_and_subtree_ = hide; | 1145 hide_layer_and_subtree_ = hide; |
1136 SetNeedsCommit(); | 1146 SetNeedsCommit(); |
| 1147 SetSubtreePropertyChanged(); |
1137 } | 1148 } |
1138 | 1149 |
1139 void Layer::SetNeedsDisplayRect(const gfx::Rect& dirty_rect) { | 1150 void Layer::SetNeedsDisplayRect(const gfx::Rect& dirty_rect) { |
1140 if (dirty_rect.IsEmpty()) | 1151 if (dirty_rect.IsEmpty()) |
1141 return; | 1152 return; |
1142 | 1153 |
1143 SetNeedsPushProperties(); | 1154 SetNeedsPushProperties(); |
1144 update_rect_.Union(dirty_rect); | 1155 update_rect_.Union(dirty_rect); |
1145 | 1156 |
1146 if (DrawsContent()) | 1157 if (DrawsContent()) |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1215 | 1226 |
1216 layer->SetTransformTreeIndex(transform_tree_index()); | 1227 layer->SetTransformTreeIndex(transform_tree_index()); |
1217 layer->SetEffectTreeIndex(effect_tree_index()); | 1228 layer->SetEffectTreeIndex(effect_tree_index()); |
1218 layer->SetClipTreeIndex(clip_tree_index()); | 1229 layer->SetClipTreeIndex(clip_tree_index()); |
1219 layer->SetScrollTreeIndex(scroll_tree_index()); | 1230 layer->SetScrollTreeIndex(scroll_tree_index()); |
1220 layer->set_offset_to_transform_parent(offset_to_transform_parent_); | 1231 layer->set_offset_to_transform_parent(offset_to_transform_parent_); |
1221 layer->SetDoubleSided(double_sided_); | 1232 layer->SetDoubleSided(double_sided_); |
1222 layer->SetDrawsContent(DrawsContent()); | 1233 layer->SetDrawsContent(DrawsContent()); |
1223 layer->SetHideLayerAndSubtree(hide_layer_and_subtree_); | 1234 layer->SetHideLayerAndSubtree(hide_layer_and_subtree_); |
1224 layer->SetHasRenderSurface(has_render_surface_); | 1235 layer->SetHasRenderSurface(has_render_surface_); |
| 1236 // subtree_property_changed_ is propagated to all descendants while building |
| 1237 // property trees. So, it is enough to check it only for the current layer. |
| 1238 if (subtree_property_changed_) |
| 1239 layer->NoteLayerPropertyChanged(); |
1225 layer->SetForceRenderSurface(force_render_surface_); | 1240 layer->SetForceRenderSurface(force_render_surface_); |
1226 if (!layer->FilterIsAnimatingOnImplOnly() && !FilterIsAnimating()) | 1241 if (!layer->FilterIsAnimatingOnImplOnly() && !FilterIsAnimating()) |
1227 layer->SetFilters(filters_); | 1242 layer->SetFilters(filters_); |
1228 DCHECK(!(FilterIsAnimating() && layer->FilterIsAnimatingOnImplOnly())); | 1243 DCHECK(!(FilterIsAnimating() && layer->FilterIsAnimatingOnImplOnly())); |
1229 layer->SetBackgroundFilters(background_filters()); | 1244 layer->SetBackgroundFilters(background_filters()); |
1230 layer->SetMasksToBounds(masks_to_bounds_); | 1245 layer->SetMasksToBounds(masks_to_bounds_); |
1231 layer->set_main_thread_scrolling_reasons(main_thread_scrolling_reasons_); | 1246 layer->set_main_thread_scrolling_reasons(main_thread_scrolling_reasons_); |
1232 layer->SetNonFastScrollableRegion(non_fast_scrollable_region_); | 1247 layer->SetNonFastScrollableRegion(non_fast_scrollable_region_); |
1233 layer->SetTouchEventHandlerRegion(touch_event_handler_region_); | 1248 layer->SetTouchEventHandlerRegion(touch_event_handler_region_); |
1234 layer->SetContentsOpaque(contents_opaque_); | 1249 layer->SetContentsOpaque(contents_opaque_); |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1352 layer_animation_controller_->PushAnimationUpdatesTo( | 1367 layer_animation_controller_->PushAnimationUpdatesTo( |
1353 layer->layer_animation_controller()); | 1368 layer->layer_animation_controller()); |
1354 | 1369 |
1355 if (frame_timing_requests_dirty_) { | 1370 if (frame_timing_requests_dirty_) { |
1356 layer->SetFrameTimingRequests(frame_timing_requests_); | 1371 layer->SetFrameTimingRequests(frame_timing_requests_); |
1357 frame_timing_requests_dirty_ = false; | 1372 frame_timing_requests_dirty_ = false; |
1358 } | 1373 } |
1359 | 1374 |
1360 // Reset any state that should be cleared for the next update. | 1375 // Reset any state that should be cleared for the next update. |
1361 stacking_order_changed_ = false; | 1376 stacking_order_changed_ = false; |
| 1377 subtree_property_changed_ = false; |
1362 update_rect_ = gfx::Rect(); | 1378 update_rect_ = gfx::Rect(); |
1363 | 1379 |
1364 needs_push_properties_ = false; | 1380 needs_push_properties_ = false; |
1365 num_dependents_need_push_properties_ = 0; | 1381 num_dependents_need_push_properties_ = 0; |
1366 } | 1382 } |
1367 | 1383 |
1368 void Layer::SetTypeForProtoSerialization(proto::LayerNode* proto) const { | 1384 void Layer::SetTypeForProtoSerialization(proto::LayerNode* proto) const { |
1369 proto->set_type(proto::LayerType::LAYER); | 1385 proto->set_type(proto::LayerType::LAYER); |
1370 } | 1386 } |
1371 | 1387 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1487 base->set_transform_free_index(transform_tree_index_); | 1503 base->set_transform_free_index(transform_tree_index_); |
1488 base->set_effect_tree_index(effect_tree_index_); | 1504 base->set_effect_tree_index(effect_tree_index_); |
1489 base->set_clip_tree_index(clip_tree_index_); | 1505 base->set_clip_tree_index(clip_tree_index_); |
1490 base->set_scroll_tree_index(scroll_tree_index_); | 1506 base->set_scroll_tree_index(scroll_tree_index_); |
1491 Vector2dFToProto(offset_to_transform_parent_, | 1507 Vector2dFToProto(offset_to_transform_parent_, |
1492 base->mutable_offset_to_transform_parent()); | 1508 base->mutable_offset_to_transform_parent()); |
1493 base->set_double_sided(double_sided_); | 1509 base->set_double_sided(double_sided_); |
1494 base->set_draws_content(draws_content_); | 1510 base->set_draws_content(draws_content_); |
1495 base->set_hide_layer_and_subtree(hide_layer_and_subtree_); | 1511 base->set_hide_layer_and_subtree(hide_layer_and_subtree_); |
1496 base->set_has_render_surface(has_render_surface_); | 1512 base->set_has_render_surface(has_render_surface_); |
| 1513 base->set_subtree_property_changed(subtree_property_changed_); |
1497 | 1514 |
1498 // TODO(nyquist): Add support for serializing FilterOperations for | 1515 // TODO(nyquist): Add support for serializing FilterOperations for |
1499 // |filters_| and |background_filters_|. See crbug.com/541321. | 1516 // |filters_| and |background_filters_|. See crbug.com/541321. |
1500 | 1517 |
1501 base->set_masks_to_bounds(masks_to_bounds_); | 1518 base->set_masks_to_bounds(masks_to_bounds_); |
1502 base->set_main_thread_scrolling_reasons(main_thread_scrolling_reasons_); | 1519 base->set_main_thread_scrolling_reasons(main_thread_scrolling_reasons_); |
1503 RegionToProto(non_fast_scrollable_region_, | 1520 RegionToProto(non_fast_scrollable_region_, |
1504 base->mutable_non_fast_scrollable_region()); | 1521 base->mutable_non_fast_scrollable_region()); |
1505 RegionToProto(touch_event_handler_region_, | 1522 RegionToProto(touch_event_handler_region_, |
1506 base->mutable_touch_event_handler_region()); | 1523 base->mutable_touch_event_handler_region()); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1575 transform_tree_index_ = base.transform_free_index(); | 1592 transform_tree_index_ = base.transform_free_index(); |
1576 effect_tree_index_ = base.effect_tree_index(); | 1593 effect_tree_index_ = base.effect_tree_index(); |
1577 clip_tree_index_ = base.clip_tree_index(); | 1594 clip_tree_index_ = base.clip_tree_index(); |
1578 scroll_tree_index_ = base.scroll_tree_index(); | 1595 scroll_tree_index_ = base.scroll_tree_index(); |
1579 offset_to_transform_parent_ = | 1596 offset_to_transform_parent_ = |
1580 ProtoToVector2dF(base.offset_to_transform_parent()); | 1597 ProtoToVector2dF(base.offset_to_transform_parent()); |
1581 double_sided_ = base.double_sided(); | 1598 double_sided_ = base.double_sided(); |
1582 draws_content_ = base.draws_content(); | 1599 draws_content_ = base.draws_content(); |
1583 hide_layer_and_subtree_ = base.hide_layer_and_subtree(); | 1600 hide_layer_and_subtree_ = base.hide_layer_and_subtree(); |
1584 has_render_surface_ = base.has_render_surface(); | 1601 has_render_surface_ = base.has_render_surface(); |
| 1602 subtree_property_changed_ = base.subtree_property_changed(); |
1585 masks_to_bounds_ = base.masks_to_bounds(); | 1603 masks_to_bounds_ = base.masks_to_bounds(); |
1586 main_thread_scrolling_reasons_ = base.main_thread_scrolling_reasons(); | 1604 main_thread_scrolling_reasons_ = base.main_thread_scrolling_reasons(); |
1587 non_fast_scrollable_region_ = | 1605 non_fast_scrollable_region_ = |
1588 RegionFromProto(base.non_fast_scrollable_region()); | 1606 RegionFromProto(base.non_fast_scrollable_region()); |
1589 touch_event_handler_region_ = | 1607 touch_event_handler_region_ = |
1590 RegionFromProto(base.touch_event_handler_region()); | 1608 RegionFromProto(base.touch_event_handler_region()); |
1591 contents_opaque_ = base.contents_opaque(); | 1609 contents_opaque_ = base.contents_opaque(); |
1592 opacity_ = base.opacity(); | 1610 opacity_ = base.opacity(); |
1593 blend_mode_ = SkXfermodeModeFromProto(base.blend_mode()); | 1611 blend_mode_ = SkXfermodeModeFromProto(base.blend_mode()); |
1594 is_root_for_isolated_group_ = base.is_root_for_isolated_group(); | 1612 is_root_for_isolated_group_ = base.is_root_for_isolated_group(); |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1726 | 1744 |
1727 void Layer::SetHasRenderSurface(bool has_render_surface) { | 1745 void Layer::SetHasRenderSurface(bool has_render_surface) { |
1728 if (has_render_surface_ == has_render_surface) | 1746 if (has_render_surface_ == has_render_surface) |
1729 return; | 1747 return; |
1730 has_render_surface_ = has_render_surface; | 1748 has_render_surface_ = has_render_surface; |
1731 // We do not need SetNeedsCommit here, since this is only ever called | 1749 // We do not need SetNeedsCommit here, since this is only ever called |
1732 // during a commit, from CalculateDrawProperties using property trees. | 1750 // during a commit, from CalculateDrawProperties using property trees. |
1733 SetNeedsPushProperties(); | 1751 SetNeedsPushProperties(); |
1734 } | 1752 } |
1735 | 1753 |
| 1754 void Layer::SetSubtreePropertyChanged() { |
| 1755 if (subtree_property_changed_) |
| 1756 return; |
| 1757 subtree_property_changed_ = true; |
| 1758 SetNeedsPushProperties(); |
| 1759 } |
| 1760 |
1736 gfx::ScrollOffset Layer::ScrollOffsetForAnimation() const { | 1761 gfx::ScrollOffset Layer::ScrollOffsetForAnimation() const { |
1737 return CurrentScrollOffset(); | 1762 return CurrentScrollOffset(); |
1738 } | 1763 } |
1739 | 1764 |
1740 // On<Property>Animated is called due to an ongoing accelerated animation. | 1765 // On<Property>Animated is called due to an ongoing accelerated animation. |
1741 // Since this animation is also being run on the compositor thread, there | 1766 // Since this animation is also being run on the compositor thread, there |
1742 // is no need to request a commit to push this value over, so the value is | 1767 // is no need to request a commit to push this value over, so the value is |
1743 // set directly rather than by calling Set<Property>. | 1768 // set directly rather than by calling Set<Property>. |
1744 void Layer::OnFilterAnimated(const FilterOperations& filters) { | 1769 void Layer::OnFilterAnimated(const FilterOperations& filters) { |
1745 filters_ = filters; | 1770 filters_ = filters; |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2039 this, layer_tree_host_->property_trees()->transform_tree); | 2064 this, layer_tree_host_->property_trees()->transform_tree); |
2040 } | 2065 } |
2041 | 2066 |
2042 gfx::Transform Layer::screen_space_transform() const { | 2067 gfx::Transform Layer::screen_space_transform() const { |
2043 DCHECK_NE(transform_tree_index_, -1); | 2068 DCHECK_NE(transform_tree_index_, -1); |
2044 return ScreenSpaceTransformFromPropertyTrees( | 2069 return ScreenSpaceTransformFromPropertyTrees( |
2045 this, layer_tree_host_->property_trees()->transform_tree); | 2070 this, layer_tree_host_->property_trees()->transform_tree); |
2046 } | 2071 } |
2047 | 2072 |
2048 } // namespace cc | 2073 } // namespace cc |
OLD | NEW |