OLD | NEW |
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/embedder.h" | 5 #include "mojo/examples/surfaces_app/embedder.h" |
6 | 6 |
7 #include "cc/output/compositor_frame.h" | 7 #include "cc/output/compositor_frame.h" |
8 #include "cc/output/delegated_frame_data.h" | 8 #include "cc/output/delegated_frame_data.h" |
9 #include "cc/quads/render_pass.h" | 9 #include "cc/quads/render_pass.h" |
10 #include "cc/quads/solid_color_draw_quad.h" | 10 #include "cc/quads/solid_color_draw_quad.h" |
11 #include "cc/quads/surface_draw_quad.h" | 11 #include "cc/quads/surface_draw_quad.h" |
12 #include "mojo/examples/surfaces_app/surfaces_util.h" | 12 #include "mojo/examples/surfaces_app/surfaces_util.h" |
13 #include "mojo/services/public/cpp/surfaces/surfaces_type_converters.h" | 13 #include "mojo/services/public/cpp/surfaces/surfaces_type_converters.h" |
14 #include "mojo/services/public/interfaces/surfaces/surface_id.mojom.h" | 14 #include "mojo/services/public/interfaces/surfaces/surface_id.mojom.h" |
15 #include "ui/gfx/rect.h" | 15 #include "ui/gfx/rect.h" |
16 #include "ui/gfx/size.h" | 16 #include "ui/gfx/size.h" |
17 #include "ui/gfx/transform.h" | 17 #include "ui/gfx/transform.h" |
18 | 18 |
19 namespace mojo { | 19 namespace mojo { |
20 namespace examples { | 20 namespace examples { |
21 | 21 |
22 using cc::RenderPass; | 22 using cc::RenderPass; |
23 using cc::SurfaceDrawQuad; | 23 using cc::SurfaceDrawQuad; |
24 using cc::DrawQuad; | 24 using cc::DrawQuad; |
25 using cc::SolidColorDrawQuad; | 25 using cc::SolidColorDrawQuad; |
26 using cc::DelegatedFrameData; | 26 using cc::DelegatedFrameData; |
27 using cc::CompositorFrame; | 27 using cc::CompositorFrame; |
28 | 28 |
29 Embedder::Embedder(surfaces::Surface* surface) : surface_(surface) { | 29 Embedder::Embedder(Surface* surface) : surface_(surface) { |
30 } | 30 } |
31 | 31 |
32 Embedder::~Embedder() { | 32 Embedder::~Embedder() { |
33 } | 33 } |
34 | 34 |
35 void Embedder::ProduceFrame(cc::SurfaceId child_one, | 35 void Embedder::ProduceFrame(cc::SurfaceId child_one, |
36 cc::SurfaceId child_two, | 36 cc::SurfaceId child_two, |
37 const gfx::Size& child_size, | 37 const gfx::Size& child_size, |
38 const gfx::Size& size, | 38 const gfx::Size& size, |
39 double rotation_degrees) { | 39 double rotation_degrees) { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 rect, | 77 rect, |
78 SK_ColorYELLOW, | 78 SK_ColorYELLOW, |
79 force_anti_aliasing_off); | 79 force_anti_aliasing_off); |
80 | 80 |
81 scoped_ptr<DelegatedFrameData> delegated_frame_data(new DelegatedFrameData); | 81 scoped_ptr<DelegatedFrameData> delegated_frame_data(new DelegatedFrameData); |
82 delegated_frame_data->render_pass_list.push_back(pass.Pass()); | 82 delegated_frame_data->render_pass_list.push_back(pass.Pass()); |
83 | 83 |
84 scoped_ptr<CompositorFrame> frame(new CompositorFrame); | 84 scoped_ptr<CompositorFrame> frame(new CompositorFrame); |
85 frame->delegated_frame_data = delegated_frame_data.Pass(); | 85 frame->delegated_frame_data = delegated_frame_data.Pass(); |
86 | 86 |
87 surface_->SubmitFrame(mojo::surfaces::SurfaceId::From(id_), | 87 surface_->SubmitFrame(mojo::SurfaceId::From(id_), |
88 mojo::surfaces::Frame::From(*frame)); | 88 mojo::Frame::From(*frame)); |
89 } | 89 } |
90 | 90 |
91 } // namespace examples | 91 } // namespace examples |
92 } // namespace mojo | 92 } // namespace mojo |
OLD | NEW |