Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(811)

Side by Side Diff: cc/layers/layer_impl.cc

Issue 1152473006: cc: Remove DrawQuad::IterateResoruces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 747 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 children_[i]->NoteLayerPropertyChangedForDescendantsInternal(); 758 children_[i]->NoteLayerPropertyChangedForDescendantsInternal();
759 } 759 }
760 760
761 void LayerImpl::NoteLayerPropertyChangedForDescendants() { 761 void LayerImpl::NoteLayerPropertyChangedForDescendants() {
762 layer_tree_impl()->set_needs_update_draw_properties(); 762 layer_tree_impl()->set_needs_update_draw_properties();
763 for (size_t i = 0; i < children_.size(); ++i) 763 for (size_t i = 0; i < children_.size(); ++i)
764 children_[i]->NoteLayerPropertyChangedForDescendantsInternal(); 764 children_[i]->NoteLayerPropertyChangedForDescendantsInternal();
765 SetNeedsPushProperties(); 765 SetNeedsPushProperties();
766 } 766 }
767 767
768 void LayerImpl::ValidateQuadResources(DrawQuad* quad) const {
768 #if DCHECK_IS_ON() 769 #if DCHECK_IS_ON()
769 // Verify that the resource id is valid. 770 const ResourceProvider* resource_provider =
770 static ResourceId ValidateResource(const ResourceProvider* provider, 771 layer_tree_impl_->resource_provider();
771 ResourceId id) { 772 quad->IterateResources([resource_provider](ResourceId resource_id) {
772 provider->ValidateResource(id); 773 resource_provider->ValidateResource(resource_id);
773 return id; 774 return resource_id;
774 } 775 });
775 #endif
776
777 void LayerImpl::ValidateQuadResourcesInternal(DrawQuad* quad) const {
778 #if DCHECK_IS_ON()
779 quad->IterateResources(
780 base::Bind(&ValidateResource, layer_tree_impl_->resource_provider()));
781 #endif 776 #endif
782 } 777 }
783 778
784 const char* LayerImpl::LayerTypeAsString() const { 779 const char* LayerImpl::LayerTypeAsString() const {
785 return "cc::LayerImpl"; 780 return "cc::LayerImpl";
786 } 781 }
787 782
788 void LayerImpl::ResetAllChangeTrackingForSubtree() { 783 void LayerImpl::ResetAllChangeTrackingForSubtree() {
789 layer_property_changed_ = false; 784 layer_property_changed_ = false;
790 785
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after
1703 gfx::Transform scaled_draw_transform = 1698 gfx::Transform scaled_draw_transform =
1704 draw_properties_.target_space_transform; 1699 draw_properties_.target_space_transform;
1705 scaled_draw_transform.Scale(SK_MScalar1 / scale, SK_MScalar1 / scale); 1700 scaled_draw_transform.Scale(SK_MScalar1 / scale, SK_MScalar1 / scale);
1706 gfx::Size scaled_content_bounds = 1701 gfx::Size scaled_content_bounds =
1707 gfx::ToCeiledSize(gfx::ScaleSize(content_bounds(), scale)); 1702 gfx::ToCeiledSize(gfx::ScaleSize(content_bounds(), scale));
1708 return MathUtil::MapEnclosingClippedRect(scaled_draw_transform, 1703 return MathUtil::MapEnclosingClippedRect(scaled_draw_transform,
1709 gfx::Rect(scaled_content_bounds)); 1704 gfx::Rect(scaled_content_bounds));
1710 } 1705 }
1711 1706
1712 } // namespace cc 1707 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698