| 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 | 11 |
| 11 #include "base/bind.h" | 12 #include "base/bind.h" |
| 12 #include "base/logging.h" | 13 #include "base/logging.h" |
| 13 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
| 14 #include "examples/ui/noodles/frame.h" | 15 #include "examples/ui/noodles/frame.h" |
| 15 #include "examples/ui/noodles/rasterizer.h" | 16 #include "examples/ui/noodles/rasterizer.h" |
| 16 #include "third_party/skia/include/core/SkCanvas.h" | 17 #include "third_party/skia/include/core/SkCanvas.h" |
| 17 #include "third_party/skia/include/core/SkColor.h" | 18 #include "third_party/skia/include/core/SkColor.h" |
| 18 #include "third_party/skia/include/core/SkPath.h" | 19 #include "third_party/skia/include/core/SkPath.h" |
| 19 #include "third_party/skia/include/core/SkPicture.h" | 20 #include "third_party/skia/include/core/SkPicture.h" |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 const std::shared_ptr<FrameQueue>& frame_queue) | 164 const std::shared_ptr<FrameQueue>& frame_queue) |
| 164 : frame_queue_(frame_queue) { | 165 : frame_queue_(frame_queue) { |
| 165 DCHECK(frame_queue_); | 166 DCHECK(frame_queue_); |
| 166 } | 167 } |
| 167 | 168 |
| 168 NoodlesView::RasterizerDelegate::~RasterizerDelegate() {} | 169 NoodlesView::RasterizerDelegate::~RasterizerDelegate() {} |
| 169 | 170 |
| 170 void NoodlesView::RasterizerDelegate::CreateRasterizer( | 171 void NoodlesView::RasterizerDelegate::CreateRasterizer( |
| 171 mojo::InterfaceHandle<mojo::ApplicationConnector> connector_info, | 172 mojo::InterfaceHandle<mojo::ApplicationConnector> connector_info, |
| 172 mojo::InterfaceHandle<mojo::gfx::composition::Scene> scene_info) { | 173 mojo::InterfaceHandle<mojo::gfx::composition::Scene> scene_info) { |
| 173 rasterizer_.reset( | 174 rasterizer_.reset(new Rasterizer( |
| 174 new Rasterizer(mojo::MakeProxy(connector_info.Pass()).Pass(), | 175 mojo::ApplicationConnectorPtr::Create(std::move(connector_info)), |
| 175 mojo::MakeProxy(scene_info.Pass()).Pass())); | 176 mojo::gfx::composition::ScenePtr::Create(std::move(scene_info)))); |
| 176 } | 177 } |
| 177 | 178 |
| 178 void NoodlesView::RasterizerDelegate::PublishNextFrame() { | 179 void NoodlesView::RasterizerDelegate::PublishNextFrame() { |
| 179 std::unique_ptr<Frame> frame(frame_queue_->TakeFrame()); | 180 std::unique_ptr<Frame> frame(frame_queue_->TakeFrame()); |
| 180 DCHECK(frame); | 181 DCHECK(frame); |
| 181 rasterizer_->PublishFrame(std::move(frame)); | 182 rasterizer_->PublishFrame(std::move(frame)); |
| 182 } | 183 } |
| 183 | 184 |
| 184 } // namespace examples | 185 } // namespace examples |
| OLD | NEW |