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

Side by Side Diff: mojo/examples/surfaces_app/child_impl.cc

Issue 398533002: Make DrawQuad constructors public, rm DQ::Create() function (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: get rid of make_scoped_ptr Created 6 years, 5 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 unified diff | Download patch
« no previous file with comments | « content/common/cc_messages.cc ('k') | mojo/examples/surfaces_app/embedder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/examples/surfaces_app/child_impl.h" 5 #include "mojo/examples/surfaces_app/child_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "cc/output/compositor_frame.h" 8 #include "cc/output/compositor_frame.h"
9 #include "cc/output/delegated_frame_data.h" 9 #include "cc/output/delegated_frame_data.h"
10 #include "cc/quads/render_pass.h" 10 #include "cc/quads/render_pass.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 id_ = allocator_->GenerateId(); 78 id_ = allocator_->GenerateId();
79 surface_->CreateSurface(mojo::surfaces::SurfaceId::From(id_), 79 surface_->CreateSurface(mojo::surfaces::SurfaceId::From(id_),
80 mojo::Size::From(size_)); 80 mojo::Size::From(size_));
81 gfx::Rect rect(size_); 81 gfx::Rect rect(size_);
82 RenderPass::Id id(1, 1); 82 RenderPass::Id id(1, 1);
83 scoped_ptr<RenderPass> pass = RenderPass::Create(); 83 scoped_ptr<RenderPass> pass = RenderPass::Create();
84 pass->SetNew(id, rect, rect, gfx::Transform()); 84 pass->SetNew(id, rect, rect, gfx::Transform());
85 85
86 CreateAndAppendSimpleSharedQuadState(pass.get(), gfx::Transform(), size_); 86 CreateAndAppendSimpleSharedQuadState(pass.get(), gfx::Transform(), size_);
87 87
88 scoped_ptr<SolidColorDrawQuad> color_quad = SolidColorDrawQuad::Create(); 88 SolidColorDrawQuad* color_quad =
89 pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>();
89 bool force_anti_aliasing_off = false; 90 bool force_anti_aliasing_off = false;
90 color_quad->SetNew(pass->shared_quad_state_list.back(), 91 color_quad->SetNew(pass->shared_quad_state_list.back(),
91 rect, 92 rect,
92 rect, 93 rect,
93 color_, 94 color_,
94 force_anti_aliasing_off); 95 force_anti_aliasing_off);
95 pass->quad_list.push_back(color_quad.PassAs<DrawQuad>());
96 96
97 scoped_ptr<DelegatedFrameData> delegated_frame_data(new DelegatedFrameData); 97 scoped_ptr<DelegatedFrameData> delegated_frame_data(new DelegatedFrameData);
98 delegated_frame_data->render_pass_list.push_back(pass.Pass()); 98 delegated_frame_data->render_pass_list.push_back(pass.Pass());
99 99
100 scoped_ptr<CompositorFrame> frame(new CompositorFrame); 100 scoped_ptr<CompositorFrame> frame(new CompositorFrame);
101 frame->delegated_frame_data = delegated_frame_data.Pass(); 101 frame->delegated_frame_data = delegated_frame_data.Pass();
102 102
103 surface_->SubmitFrame(mojo::surfaces::SurfaceId::From(id_), 103 surface_->SubmitFrame(mojo::surfaces::SurfaceId::From(id_),
104 mojo::surfaces::Frame::From(*frame)); 104 mojo::surfaces::Frame::From(*frame));
105 produce_callback_.Run(surfaces::SurfaceId::From(id_)); 105 produce_callback_.Run(surfaces::SurfaceId::From(id_));
106 } 106 }
107 107
108 } // namespace examples 108 } // namespace examples
109 } // namespace mojo 109 } // namespace mojo
OLDNEW
« no previous file with comments | « content/common/cc_messages.cc ('k') | mojo/examples/surfaces_app/embedder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698