| 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 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 } | 700 } |
| 701 | 701 |
| 702 const char* LayerImpl::LayerTypeAsString() const { | 702 const char* LayerImpl::LayerTypeAsString() const { |
| 703 return "cc::LayerImpl"; | 703 return "cc::LayerImpl"; |
| 704 } | 704 } |
| 705 | 705 |
| 706 void LayerImpl::ResetAllChangeTrackingForSubtree() { | 706 void LayerImpl::ResetAllChangeTrackingForSubtree() { |
| 707 layer_property_changed_ = false; | 707 layer_property_changed_ = false; |
| 708 | 708 |
| 709 update_rect_ = gfx::RectF(); | 709 update_rect_ = gfx::RectF(); |
| 710 damage_rect_ = gfx::RectF(); |
| 710 | 711 |
| 711 if (draw_properties_.render_surface) | 712 if (draw_properties_.render_surface) |
| 712 draw_properties_.render_surface->ResetPropertyChangedFlag(); | 713 draw_properties_.render_surface->ResetPropertyChangedFlag(); |
| 713 | 714 |
| 714 if (mask_layer_) | 715 if (mask_layer_) |
| 715 mask_layer_->ResetAllChangeTrackingForSubtree(); | 716 mask_layer_->ResetAllChangeTrackingForSubtree(); |
| 716 | 717 |
| 717 if (replica_layer_) { | 718 if (replica_layer_) { |
| 718 // This also resets the replica mask, if it exists. | 719 // This also resets the replica mask, if it exists. |
| 719 replica_layer_->ResetAllChangeTrackingForSubtree(); | 720 replica_layer_->ResetAllChangeTrackingForSubtree(); |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1029 Animation* transform_animation = | 1030 Animation* transform_animation = |
| 1030 layer_animation_controller_->GetAnimation(Animation::Transform); | 1031 layer_animation_controller_->GetAnimation(Animation::Transform); |
| 1031 return transform_animation && transform_animation->is_impl_only(); | 1032 return transform_animation && transform_animation->is_impl_only(); |
| 1032 } | 1033 } |
| 1033 | 1034 |
| 1034 void LayerImpl::SetUpdateRect(const gfx::RectF& update_rect) { | 1035 void LayerImpl::SetUpdateRect(const gfx::RectF& update_rect) { |
| 1035 update_rect_ = update_rect; | 1036 update_rect_ = update_rect; |
| 1036 SetNeedsPushProperties(); | 1037 SetNeedsPushProperties(); |
| 1037 } | 1038 } |
| 1038 | 1039 |
| 1040 void LayerImpl::AddDamageRect(const gfx::RectF& damage_rect) { |
| 1041 damage_rect_ = gfx::UnionRects(damage_rect_, damage_rect); |
| 1042 } |
| 1043 |
| 1039 void LayerImpl::SetContentBounds(const gfx::Size& content_bounds) { | 1044 void LayerImpl::SetContentBounds(const gfx::Size& content_bounds) { |
| 1040 if (this->content_bounds() == content_bounds) | 1045 if (this->content_bounds() == content_bounds) |
| 1041 return; | 1046 return; |
| 1042 | 1047 |
| 1043 draw_properties_.content_bounds = content_bounds; | 1048 draw_properties_.content_bounds = content_bounds; |
| 1044 NoteLayerPropertyChanged(); | 1049 NoteLayerPropertyChanged(); |
| 1045 } | 1050 } |
| 1046 | 1051 |
| 1047 void LayerImpl::SetContentsScale(float contents_scale_x, | 1052 void LayerImpl::SetContentsScale(float contents_scale_x, |
| 1048 float contents_scale_y) { | 1053 float contents_scale_y) { |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1531 scoped_ptr<base::Value> LayerImpl::AsValue() const { | 1536 scoped_ptr<base::Value> LayerImpl::AsValue() const { |
| 1532 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 1537 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
| 1533 AsValueInto(state.get()); | 1538 AsValueInto(state.get()); |
| 1534 return state.PassAs<base::Value>(); | 1539 return state.PassAs<base::Value>(); |
| 1535 } | 1540 } |
| 1536 | 1541 |
| 1537 void LayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { | 1542 void LayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { |
| 1538 benchmark->RunOnLayer(this); | 1543 benchmark->RunOnLayer(this); |
| 1539 } | 1544 } |
| 1540 } // namespace cc | 1545 } // namespace cc |
| OLD | NEW |