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/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "cc/animation/animation_registrar.h" | 10 #include "cc/animation/animation_registrar.h" |
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
694 } | 694 } |
695 | 695 |
696 const char* LayerImpl::LayerTypeAsString() const { | 696 const char* LayerImpl::LayerTypeAsString() const { |
697 return "cc::LayerImpl"; | 697 return "cc::LayerImpl"; |
698 } | 698 } |
699 | 699 |
700 void LayerImpl::ResetAllChangeTrackingForSubtree() { | 700 void LayerImpl::ResetAllChangeTrackingForSubtree() { |
701 layer_property_changed_ = false; | 701 layer_property_changed_ = false; |
702 | 702 |
703 update_rect_ = gfx::RectF(); | 703 update_rect_ = gfx::RectF(); |
| 704 damage_content_rect_ = gfx::RectF(); |
704 | 705 |
705 if (draw_properties_.render_surface) | 706 if (draw_properties_.render_surface) |
706 draw_properties_.render_surface->ResetPropertyChangedFlag(); | 707 draw_properties_.render_surface->ResetPropertyChangedFlag(); |
707 | 708 |
708 if (mask_layer_) | 709 if (mask_layer_) |
709 mask_layer_->ResetAllChangeTrackingForSubtree(); | 710 mask_layer_->ResetAllChangeTrackingForSubtree(); |
710 | 711 |
711 if (replica_layer_) { | 712 if (replica_layer_) { |
712 // This also resets the replica mask, if it exists. | 713 // This also resets the replica mask, if it exists. |
713 replica_layer_->ResetAllChangeTrackingForSubtree(); | 714 replica_layer_->ResetAllChangeTrackingForSubtree(); |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1010 Animation* transform_animation = | 1011 Animation* transform_animation = |
1011 layer_animation_controller_->GetAnimation(Animation::Transform); | 1012 layer_animation_controller_->GetAnimation(Animation::Transform); |
1012 return transform_animation && transform_animation->is_impl_only(); | 1013 return transform_animation && transform_animation->is_impl_only(); |
1013 } | 1014 } |
1014 | 1015 |
1015 void LayerImpl::SetUpdateRect(const gfx::RectF& update_rect) { | 1016 void LayerImpl::SetUpdateRect(const gfx::RectF& update_rect) { |
1016 update_rect_ = update_rect; | 1017 update_rect_ = update_rect; |
1017 SetNeedsPushProperties(); | 1018 SetNeedsPushProperties(); |
1018 } | 1019 } |
1019 | 1020 |
| 1021 void LayerImpl::UnionDamageContentRect(gfx::RectF damage_content_rect) { |
| 1022 damage_content_rect_ = |
| 1023 gfx::UnionRects(damage_content_rect_, damage_content_rect); |
| 1024 } |
| 1025 |
1020 void LayerImpl::SetContentBounds(const gfx::Size& content_bounds) { | 1026 void LayerImpl::SetContentBounds(const gfx::Size& content_bounds) { |
1021 if (this->content_bounds() == content_bounds) | 1027 if (this->content_bounds() == content_bounds) |
1022 return; | 1028 return; |
1023 | 1029 |
1024 draw_properties_.content_bounds = content_bounds; | 1030 draw_properties_.content_bounds = content_bounds; |
1025 NoteLayerPropertyChanged(); | 1031 NoteLayerPropertyChanged(); |
1026 } | 1032 } |
1027 | 1033 |
1028 void LayerImpl::SetContentsScale(float contents_scale_x, | 1034 void LayerImpl::SetContentsScale(float contents_scale_x, |
1029 float contents_scale_y) { | 1035 float contents_scale_y) { |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1500 scoped_ptr<base::Value> LayerImpl::AsValue() const { | 1506 scoped_ptr<base::Value> LayerImpl::AsValue() const { |
1501 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 1507 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
1502 AsValueInto(state.get()); | 1508 AsValueInto(state.get()); |
1503 return state.PassAs<base::Value>(); | 1509 return state.PassAs<base::Value>(); |
1504 } | 1510 } |
1505 | 1511 |
1506 void LayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { | 1512 void LayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { |
1507 benchmark->RunOnLayer(this); | 1513 benchmark->RunOnLayer(this); |
1508 } | 1514 } |
1509 } // namespace cc | 1515 } // namespace cc |
OLD | NEW |