diff options
author | weiliangc@chromium.org <weiliangc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-16 07:51:53 +0000 |
---|---|---|
committer | weiliangc@chromium.org <weiliangc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-16 07:51:53 +0000 |
commit | cb3203581fe6dc48fa6be548d4d662c0cb4260ae (patch) | |
tree | 296dabf33a416d07760954fa66cc8662bca56c58 /mojo/examples/surfaces_app | |
parent | 3ba3eb71cda723a64fe7e71ef55cc91b8291c01e (diff) | |
download | chromium_src-cb3203581fe6dc48fa6be548d4d662c0cb4260ae.zip chromium_src-cb3203581fe6dc48fa6be548d4d662c0cb4260ae.tar.gz chromium_src-cb3203581fe6dc48fa6be548d4d662c0cb4260ae.tar.bz2 |
Make DrawQuad constructors public, rm DQ::Create() function
In order to let RenderPass control allocation of DrawQuads, public DQ
constructors, and make all use of DQ::Create function to make_scoped_ptr
of public constructors.
Similar to 271683004, and follow 380893004.
BUG=344962
Review URL: https://codereview.chromium.org/398533002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283389 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'mojo/examples/surfaces_app')
-rw-r--r-- | mojo/examples/surfaces_app/child_impl.cc | 4 | ||||
-rw-r--r-- | mojo/examples/surfaces_app/embedder.cc | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/mojo/examples/surfaces_app/child_impl.cc b/mojo/examples/surfaces_app/child_impl.cc index 52118f0..2d5140a 100644 --- a/mojo/examples/surfaces_app/child_impl.cc +++ b/mojo/examples/surfaces_app/child_impl.cc @@ -85,14 +85,14 @@ void ChildImpl::Draw() { CreateAndAppendSimpleSharedQuadState(pass.get(), gfx::Transform(), size_); - scoped_ptr<SolidColorDrawQuad> color_quad = SolidColorDrawQuad::Create(); + SolidColorDrawQuad* color_quad = + pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); bool force_anti_aliasing_off = false; color_quad->SetNew(pass->shared_quad_state_list.back(), rect, rect, color_, force_anti_aliasing_off); - pass->quad_list.push_back(color_quad.PassAs<DrawQuad>()); scoped_ptr<DelegatedFrameData> delegated_frame_data(new DelegatedFrameData); delegated_frame_data->render_pass_list.push_back(pass.Pass()); diff --git a/mojo/examples/surfaces_app/embedder.cc b/mojo/examples/surfaces_app/embedder.cc index a525a18..1a620d0 100644 --- a/mojo/examples/surfaces_app/embedder.cc +++ b/mojo/examples/surfaces_app/embedder.cc @@ -49,11 +49,11 @@ void Embedder::ProduceFrame(cc::SurfaceId child_one, one_transform.Translate(-child_size.width() / 2, -child_size.height() / 2); CreateAndAppendSimpleSharedQuadState(pass.get(), one_transform, size); - scoped_ptr<SurfaceDrawQuad> surface_one_quad = SurfaceDrawQuad::Create(); + SurfaceDrawQuad* surface_one_quad = + pass->CreateAndAppendDrawQuad<SurfaceDrawQuad>(); gfx::Rect one_rect(child_size); surface_one_quad->SetNew( pass->shared_quad_state_list.back(), one_rect, one_rect, child_one); - pass->quad_list.push_back(surface_one_quad.PassAs<DrawQuad>()); gfx::Transform two_transform; two_transform.Translate(10 + size.width() / 2 + child_size.width() / 2, @@ -62,21 +62,21 @@ void Embedder::ProduceFrame(cc::SurfaceId child_one, two_transform.Translate(-child_size.width() / 2, -child_size.height() / 2); CreateAndAppendSimpleSharedQuadState(pass.get(), two_transform, size); - scoped_ptr<SurfaceDrawQuad> surface_two_quad = SurfaceDrawQuad::Create(); + SurfaceDrawQuad* surface_two_quad = + pass->CreateAndAppendDrawQuad<SurfaceDrawQuad>(); gfx::Rect two_rect(child_size); surface_two_quad->SetNew( pass->shared_quad_state_list.back(), two_rect, two_rect, child_two); - pass->quad_list.push_back(surface_two_quad.PassAs<DrawQuad>()); CreateAndAppendSimpleSharedQuadState(pass.get(), gfx::Transform(), size); - scoped_ptr<SolidColorDrawQuad> color_quad = SolidColorDrawQuad::Create(); + SolidColorDrawQuad* color_quad = + pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); bool force_anti_aliasing_off = false; color_quad->SetNew(pass->shared_quad_state_list.back(), rect, rect, SK_ColorYELLOW, force_anti_aliasing_off); - pass->quad_list.push_back(color_quad.PassAs<DrawQuad>()); scoped_ptr<DelegatedFrameData> delegated_frame_data(new DelegatedFrameData); delegated_frame_data->render_pass_list.push_back(pass.Pass()); |