Create DrawQuad in RenderPass and only give out raw pointer to layers
Instead of each layer calling Create function on DrawQuad and pass
ownership around, create DrawQuad in RenderPass and only pass the raw
pointer to layers.
BUG=344962
TEST=cc_unittests
Review URL: https://codereview.chromium.org/369623002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281306 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/cc/layers/render_surface_impl.cc b/cc/layers/render_surface_impl.cc
index 0133b388..04a4da4 100644
--- a/cc/layers/render_surface_impl.cc
+++ b/cc/layers/render_surface_impl.cc
@@ -172,11 +172,10 @@
owning_layer_->layer_tree_impl()) :
DebugColors::SurfaceBorderWidth(
owning_layer_->layer_tree_impl());
- scoped_ptr<DebugBorderDrawQuad> debug_border_quad =
- DebugBorderDrawQuad::Create();
+ DebugBorderDrawQuad* debug_border_quad =
+ render_pass->CreateAndAppendDrawQuad<DebugBorderDrawQuad>();
debug_border_quad->SetNew(
shared_quad_state, content_rect_, visible_content_rect, color, width);
- render_pass->AppendDrawQuad(debug_border_quad.PassAs<DrawQuad>());
}
// TODO(shawnsingh): By using the same RenderSurfaceImpl for both the content
@@ -225,7 +224,8 @@
gfx::Rect contents_changed_since_last_frame =
ContentsChanged() ? content_rect_ : gfx::Rect();
- scoped_ptr<RenderPassDrawQuad> quad = RenderPassDrawQuad::Create();
+ RenderPassDrawQuad* quad =
+ render_pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>();
quad->SetNew(shared_quad_state,
content_rect_,
visible_content_rect,
@@ -236,7 +236,6 @@
mask_uv_rect,
owning_layer_->filters(),
owning_layer_->background_filters());
- render_pass->AppendDrawQuad(quad.PassAs<DrawQuad>());
}
} // namespace cc