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

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

Issue 1096703006: cc: Some more cleanup and removing TODOs for validating resources. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup2: const Created 5 years, 8 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
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/layers/nine_patch_layer_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 728 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/layers/nine_patch_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698