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

Unified 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: 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 side-by-side diff with in-line comments
Download patch
Index: cc/layers/layer_impl.cc
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index 5655596d0eb4e79c5ea4b95c4789c2fcb9fd7c78..48d064fef37796637c1a29fcd2ce0eab594bd1d0 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -291,6 +291,23 @@ void LayerImpl::DidDraw(ResourceProvider* resource_provider) {
current_draw_mode_ = DRAW_MODE_NONE;
}
+#if DCHECK_IS_ON()
+// Verify that the resource id is valid.
+static ResourceProvider::ResourceId ValidateResource(
+ const ResourceProvider* provider,
+ ResourceProvider::ResourceId id) {
+ provider->ValidateResource(id);
+ return id;
+}
+#endif
+
+void LayerImpl::ValidateQuadResources(const DrawQuad* quad) const {
piman 2015/04/23 22:55:10 nit: do you think we could inline this? That way i
danakj 2015/04/23 22:58:06 Ya I can do this. I wanna keep the Bind call in th
+#if DCHECK_IS_ON()
+ output_quad->IterateResources(
+ base::Bind(&ValidateResource, layer_tree_impl_->resource_provider()));
+#endif
+}
+
bool LayerImpl::ShowDebugBorders() const {
return layer_tree_impl()->debug_state().show_debug_borders;
}

Powered by Google App Engine
This is Rietveld 408576698