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 "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/debug/trace_event_argument.h" | 8 #include "base/debug/trace_event_argument.h" |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 transform_is_invertible_(true), | 62 transform_is_invertible_(true), |
63 is_container_for_fixed_position_layers_(false), | 63 is_container_for_fixed_position_layers_(false), |
64 background_color_(0), | 64 background_color_(0), |
65 opacity_(1.0), | 65 opacity_(1.0), |
66 blend_mode_(SkXfermode::kSrcOver_Mode), | 66 blend_mode_(SkXfermode::kSrcOver_Mode), |
67 num_descendants_that_draw_content_(0), | 67 num_descendants_that_draw_content_(0), |
68 draw_depth_(0.f), | 68 draw_depth_(0.f), |
69 needs_push_properties_(false), | 69 needs_push_properties_(false), |
70 num_dependents_need_push_properties_(0), | 70 num_dependents_need_push_properties_(0), |
71 sorting_context_id_(0), | 71 sorting_context_id_(0), |
72 current_draw_mode_(DRAW_MODE_NONE) { | 72 current_draw_mode_(DRAW_MODE_NONE), |
| 73 includes_first_paint_invalidation_(false) { |
73 DCHECK_GT(layer_id_, 0); | 74 DCHECK_GT(layer_id_, 0); |
74 DCHECK(layer_tree_impl_); | 75 DCHECK(layer_tree_impl_); |
75 layer_tree_impl_->RegisterLayer(this); | 76 layer_tree_impl_->RegisterLayer(this); |
76 AnimationRegistrar* registrar = layer_tree_impl_->animationRegistrar(); | 77 AnimationRegistrar* registrar = layer_tree_impl_->animationRegistrar(); |
77 layer_animation_controller_ = | 78 layer_animation_controller_ = |
78 registrar->GetAnimationControllerForId(layer_id_); | 79 registrar->GetAnimationControllerForId(layer_id_); |
79 layer_animation_controller_->AddValueObserver(this); | 80 layer_animation_controller_->AddValueObserver(this); |
80 if (IsActive()) { | 81 if (IsActive()) { |
81 layer_animation_controller_->set_value_provider(this); | 82 layer_animation_controller_->set_value_provider(this); |
82 layer_animation_controller_->set_layer_animation_delegate(this); | 83 layer_animation_controller_->set_layer_animation_delegate(this); |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 } | 585 } |
585 | 586 |
586 layer->PassCopyRequests(©_requests_); | 587 layer->PassCopyRequests(©_requests_); |
587 | 588 |
588 // If the main thread commits multiple times before the impl thread actually | 589 // If the main thread commits multiple times before the impl thread actually |
589 // draws, then damage tracking will become incorrect if we simply clobber the | 590 // draws, then damage tracking will become incorrect if we simply clobber the |
590 // update_rect here. The LayerImpl's update_rect needs to accumulate (i.e. | 591 // update_rect here. The LayerImpl's update_rect needs to accumulate (i.e. |
591 // union) any update changes that have occurred on the main thread. | 592 // union) any update changes that have occurred on the main thread. |
592 update_rect_.Union(layer->update_rect()); | 593 update_rect_.Union(layer->update_rect()); |
593 layer->SetUpdateRect(update_rect_); | 594 layer->SetUpdateRect(update_rect_); |
| 595 layer->SetIncludesFirstPaintInvalidation(includes_first_paint_invalidation_); |
594 | 596 |
595 layer->SetStackingOrderChanged(stacking_order_changed_); | 597 layer->SetStackingOrderChanged(stacking_order_changed_); |
596 layer->SetDebugInfo(debug_info_); | 598 layer->SetDebugInfo(debug_info_); |
597 | 599 |
598 // Reset any state that should be cleared for the next update. | 600 // Reset any state that should be cleared for the next update. |
599 stacking_order_changed_ = false; | 601 stacking_order_changed_ = false; |
600 update_rect_ = gfx::RectF(); | 602 update_rect_ = gfx::RectF(); |
601 needs_push_properties_ = false; | 603 needs_push_properties_ = false; |
602 num_dependents_need_push_properties_ = 0; | 604 num_dependents_need_push_properties_ = 0; |
603 } | 605 } |
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1535 } | 1537 } |
1536 | 1538 |
1537 void LayerImpl::NotifyAnimationFinished( | 1539 void LayerImpl::NotifyAnimationFinished( |
1538 base::TimeTicks monotonic_time, | 1540 base::TimeTicks monotonic_time, |
1539 Animation::TargetProperty target_property) { | 1541 Animation::TargetProperty target_property) { |
1540 if (target_property == Animation::ScrollOffset) | 1542 if (target_property == Animation::ScrollOffset) |
1541 layer_tree_impl_->InputScrollAnimationFinished(); | 1543 layer_tree_impl_->InputScrollAnimationFinished(); |
1542 } | 1544 } |
1543 | 1545 |
1544 } // namespace cc | 1546 } // namespace cc |
OLD | NEW |