OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/stringprintf.h" | 8 #include "base/stringprintf.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "cc/animation/animation_registrar.h" | 10 #include "cc/animation/animation_registrar.h" |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 NoteLayerPropertyChanged(); | 521 NoteLayerPropertyChanged(); |
522 NoteLayerPropertyChangedForDescendants(); | 522 NoteLayerPropertyChangedForDescendants(); |
523 } | 523 } |
524 | 524 |
525 void LayerImpl::NoteLayerPropertyChangedForDescendants() { | 525 void LayerImpl::NoteLayerPropertyChangedForDescendants() { |
526 layer_tree_impl()->set_needs_update_draw_properties(); | 526 layer_tree_impl()->set_needs_update_draw_properties(); |
527 for (size_t i = 0; i < children_.size(); ++i) | 527 for (size_t i = 0; i < children_.size(); ++i) |
528 children_[i]->NoteLayerPropertyChangedForSubtree(); | 528 children_[i]->NoteLayerPropertyChangedForSubtree(); |
529 } | 529 } |
530 | 530 |
| 531 bool LayerImpl::CanDrawDirectlyToBackbuffer() const { |
| 532 return render_target() == layer_tree_impl_->root_layer() && |
| 533 draw_opacity() == 1.f && !draw_opacity_is_animating(); |
| 534 } |
| 535 |
531 const char* LayerImpl::LayerTypeAsString() const { | 536 const char* LayerImpl::LayerTypeAsString() const { |
532 return "Layer"; | 537 return "Layer"; |
533 } | 538 } |
534 | 539 |
535 void LayerImpl::ResetAllChangeTrackingForSubtree() { | 540 void LayerImpl::ResetAllChangeTrackingForSubtree() { |
536 layer_property_changed_ = false; | 541 layer_property_changed_ = false; |
537 layer_surface_property_changed_ = false; | 542 layer_surface_property_changed_ = false; |
538 | 543 |
539 update_rect_ = gfx::RectF(); | 544 update_rect_ = gfx::RectF(); |
540 | 545 |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
963 dict->Set("layer_quad", MathUtil::AsValue(layer_quad).release()); | 968 dict->Set("layer_quad", MathUtil::AsValue(layer_quad).release()); |
964 } | 969 } |
965 | 970 |
966 scoped_ptr<base::Value> LayerImpl::AsValue() const { | 971 scoped_ptr<base::Value> LayerImpl::AsValue() const { |
967 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 972 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
968 AsValueInto(state.get()); | 973 AsValueInto(state.get()); |
969 return state.PassAs<base::Value>(); | 974 return state.PassAs<base::Value>(); |
970 } | 975 } |
971 | 976 |
972 } // namespace cc | 977 } // namespace cc |
OLD | NEW |