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; |
} |