Chromium Code Reviews| 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_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::AddLayerDamageRect(const gfx::RectF& damage_rect) { | |
|
reveman
2014/04/17 05:18:34
should this be AddDamageRect or should SetUpdateRe
danakj
2014/04/17 14:14:34
SetUpdateRect should be renamed, so should update_
reveman
2014/04/18 14:30:56
Ok, I would then name this AddDamageRect right now
| |
| 1022 damage_rect_ = gfx::UnionRects(damage_rect_, damage_rect); | |
| 1023 } | |
| 1024 | |
| 1020 void LayerImpl::SetContentBounds(const gfx::Size& content_bounds) { | 1025 void LayerImpl::SetContentBounds(const gfx::Size& content_bounds) { |
| 1021 if (this->content_bounds() == content_bounds) | 1026 if (this->content_bounds() == content_bounds) |
| 1022 return; | 1027 return; |
| 1023 | 1028 |
| 1024 draw_properties_.content_bounds = content_bounds; | 1029 draw_properties_.content_bounds = content_bounds; |
| 1025 NoteLayerPropertyChanged(); | 1030 NoteLayerPropertyChanged(); |
| 1026 } | 1031 } |
| 1027 | 1032 |
| 1028 void LayerImpl::SetContentsScale(float contents_scale_x, | 1033 void LayerImpl::SetContentsScale(float contents_scale_x, |
| 1029 float contents_scale_y) { | 1034 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 { | 1505 scoped_ptr<base::Value> LayerImpl::AsValue() const { |
| 1501 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 1506 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
| 1502 AsValueInto(state.get()); | 1507 AsValueInto(state.get()); |
| 1503 return state.PassAs<base::Value>(); | 1508 return state.PassAs<base::Value>(); |
| 1504 } | 1509 } |
| 1505 | 1510 |
| 1506 void LayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { | 1511 void LayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { |
| 1507 benchmark->RunOnLayer(this); | 1512 benchmark->RunOnLayer(this); |
| 1508 } | 1513 } |
| 1509 } // namespace cc | 1514 } // namespace cc |
| OLD | NEW |