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/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
10 #include "base/trace_event/trace_event_argument.h" | 10 #include "base/trace_event/trace_event_argument.h" |
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 children_[i]->NoteLayerPropertyChangedForDescendantsInternal(); | 739 children_[i]->NoteLayerPropertyChangedForDescendantsInternal(); |
740 } | 740 } |
741 | 741 |
742 void LayerImpl::NoteLayerPropertyChangedForDescendants() { | 742 void LayerImpl::NoteLayerPropertyChangedForDescendants() { |
743 layer_tree_impl()->set_needs_update_draw_properties(); | 743 layer_tree_impl()->set_needs_update_draw_properties(); |
744 for (size_t i = 0; i < children_.size(); ++i) | 744 for (size_t i = 0; i < children_.size(); ++i) |
745 children_[i]->NoteLayerPropertyChangedForDescendantsInternal(); | 745 children_[i]->NoteLayerPropertyChangedForDescendantsInternal(); |
746 SetNeedsPushProperties(); | 746 SetNeedsPushProperties(); |
747 } | 747 } |
748 | 748 |
| 749 #if DCHECK_IS_ON() |
| 750 // Verify that the resource id is valid. |
| 751 static ResourceProvider::ResourceId ValidateResource( |
| 752 const ResourceProvider* provider, |
| 753 ResourceProvider::ResourceId id) { |
| 754 provider->ValidateResource(id); |
| 755 return id; |
| 756 } |
| 757 #endif |
| 758 |
| 759 void LayerImpl::ValidateQuadResourcesInternal(DrawQuad* quad) const { |
| 760 #if DCHECK_IS_ON() |
| 761 quad->IterateResources( |
| 762 base::Bind(&ValidateResource, layer_tree_impl_->resource_provider())); |
| 763 #endif |
| 764 } |
| 765 |
749 const char* LayerImpl::LayerTypeAsString() const { | 766 const char* LayerImpl::LayerTypeAsString() const { |
750 return "cc::LayerImpl"; | 767 return "cc::LayerImpl"; |
751 } | 768 } |
752 | 769 |
753 void LayerImpl::ResetAllChangeTrackingForSubtree() { | 770 void LayerImpl::ResetAllChangeTrackingForSubtree() { |
754 layer_property_changed_ = false; | 771 layer_property_changed_ = false; |
755 | 772 |
756 update_rect_ = gfx::Rect(); | 773 update_rect_ = gfx::Rect(); |
757 damage_rect_ = gfx::RectF(); | 774 damage_rect_ = gfx::RectF(); |
758 | 775 |
(...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1618 gfx::Transform scaled_draw_transform = | 1635 gfx::Transform scaled_draw_transform = |
1619 draw_properties_.target_space_transform; | 1636 draw_properties_.target_space_transform; |
1620 scaled_draw_transform.Scale(SK_MScalar1 / scale, SK_MScalar1 / scale); | 1637 scaled_draw_transform.Scale(SK_MScalar1 / scale, SK_MScalar1 / scale); |
1621 gfx::Size scaled_content_bounds = | 1638 gfx::Size scaled_content_bounds = |
1622 gfx::ToCeiledSize(gfx::ScaleSize(content_bounds(), scale)); | 1639 gfx::ToCeiledSize(gfx::ScaleSize(content_bounds(), scale)); |
1623 return MathUtil::MapEnclosingClippedRect(scaled_draw_transform, | 1640 return MathUtil::MapEnclosingClippedRect(scaled_draw_transform, |
1624 gfx::Rect(scaled_content_bounds)); | 1641 gfx::Rect(scaled_content_bounds)); |
1625 } | 1642 } |
1626 | 1643 |
1627 } // namespace cc | 1644 } // namespace cc |
OLD | NEW |