summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordanakj <danakj@chromium.org>2015-04-08 13:09:33 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-08 20:10:12 +0000
commitf4bb78ba1e15f8be8a3943bedfe9a5f52c4ef42c (patch)
tree52f7eaac3e3c38d93a110d4974b1d7299f56f740
parent8ab013435b978213a2994af7da0c5193873bfd4b (diff)
downloadchromium_src-f4bb78ba1e15f8be8a3943bedfe9a5f52c4ef42c.zip
chromium_src-f4bb78ba1e15f8be8a3943bedfe9a5f52c4ef42c.tar.gz
chromium_src-f4bb78ba1e15f8be8a3943bedfe9a5f52c4ef42c.tar.bz2
cc: Move the quad validation checks to the place quads are inserted.
It's possible that DelegatedRendererLayerImpl decides to not append a quad if it's not valid. In that case it could crash trying to validate the non-existant quad. R=piman@chromium.org BUG=475099 Review URL: https://codereview.chromium.org/1072563002 Cr-Commit-Position: refs/heads/master@{#324278}
-rw-r--r--cc/layers/delegated_renderer_layer_impl.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/cc/layers/delegated_renderer_layer_impl.cc b/cc/layers/delegated_renderer_layer_impl.cc
index 0da4213..dfbb826 100644
--- a/cc/layers/delegated_renderer_layer_impl.cc
+++ b/cc/layers/delegated_renderer_layer_impl.cc
@@ -474,6 +474,9 @@ void DelegatedRendererLayerImpl::AppendRenderPassQuads(
DrawQuad* output_quad = render_pass->CopyFromAndAppendDrawQuad(
delegated_quad, output_shared_quad_state);
output_quad->visible_rect = quad_visible_rect;
+ // TODO(danakj): crbug.com/455931
+ output_quad->IterateResources(base::Bind(
+ &ValidateResource, layer_tree_impl()->resource_provider()));
} else {
RenderPassId delegated_contributing_render_pass_id =
RenderPassDrawQuad::MaterialCast(delegated_quad)->render_pass_id;
@@ -494,12 +497,12 @@ void DelegatedRendererLayerImpl::AppendRenderPassQuads(
output_shared_quad_state,
output_contributing_render_pass_id);
output_quad->visible_rect = quad_visible_rect;
+
+ // TODO(danakj): crbug.com/455931
+ output_quad->IterateResources(base::Bind(
+ &ValidateResource, layer_tree_impl()->resource_provider()));
}
}
-
- // TODO(danakj): crbug.com/455931
- render_pass->quad_list.back()->IterateResources(
- base::Bind(&ValidateResource, layer_tree_impl()->resource_provider()));
}
}