OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "examples/ui/noodles/noodles_view.h" | 5 #include "examples/ui/noodles/noodles_view.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include <cstdlib> | 9 #include <cstdlib> |
10 #include <utility> | 10 #include <utility> |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 rasterizer_thread_.reset(new base::Thread("noodles_rasterizer")); | 62 rasterizer_thread_.reset(new base::Thread("noodles_rasterizer")); |
63 rasterizer_thread_->StartWithOptions(options); | 63 rasterizer_thread_->StartWithOptions(options); |
64 rasterizer_task_runner_ = rasterizer_thread_->message_loop()->task_runner(); | 64 rasterizer_task_runner_ = rasterizer_thread_->message_loop()->task_runner(); |
65 | 65 |
66 rasterizer_task_runner_->PostTask( | 66 rasterizer_task_runner_->PostTask( |
67 FROM_HERE, | 67 FROM_HERE, |
68 base::Bind(&RasterizerDelegate::CreateRasterizer, | 68 base::Bind(&RasterizerDelegate::CreateRasterizer, |
69 base::Unretained(rasterizer_delegate_.get()), | 69 base::Unretained(rasterizer_delegate_.get()), |
70 base::Passed(app_impl->CreateApplicationConnector()), | 70 base::Passed(app_impl->CreateApplicationConnector()), |
71 base::Passed(TakeScene().PassInterface()))); | 71 base::Passed(TakeScene().PassInterfaceHandle()))); |
72 } | 72 } |
73 | 73 |
74 NoodlesView::~NoodlesView() { | 74 NoodlesView::~NoodlesView() { |
75 // Ensure destruction happens on the correct thread. | 75 // Ensure destruction happens on the correct thread. |
76 rasterizer_task_runner_->PostTask( | 76 rasterizer_task_runner_->PostTask( |
77 FROM_HERE, base::Bind(&Drop<RasterizerDelegate>, | 77 FROM_HERE, base::Bind(&Drop<RasterizerDelegate>, |
78 base::Passed(&rasterizer_delegate_))); | 78 base::Passed(&rasterizer_delegate_))); |
79 } | 79 } |
80 | 80 |
81 void NoodlesView::OnLayout(mojo::ui::ViewLayoutParamsPtr layout_params, | 81 void NoodlesView::OnLayout(mojo::ui::ViewLayoutParamsPtr layout_params, |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 mojo::gfx::composition::ScenePtr::Create(std::move(scene_info)))); | 176 mojo::gfx::composition::ScenePtr::Create(std::move(scene_info)))); |
177 } | 177 } |
178 | 178 |
179 void NoodlesView::RasterizerDelegate::PublishNextFrame() { | 179 void NoodlesView::RasterizerDelegate::PublishNextFrame() { |
180 std::unique_ptr<Frame> frame(frame_queue_->TakeFrame()); | 180 std::unique_ptr<Frame> frame(frame_queue_->TakeFrame()); |
181 DCHECK(frame); | 181 DCHECK(frame); |
182 rasterizer_->PublishFrame(std::move(frame)); | 182 rasterizer_->PublishFrame(std::move(frame)); |
183 } | 183 } |
184 | 184 |
185 } // namespace examples | 185 } // namespace examples |
OLD | NEW |