OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef EXAMPLES_UI_NOODLES_RASTERIZER_H_ |
| 6 #define EXAMPLES_UI_NOODLES_RASTERIZER_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "mojo/gpu/gl_context.h" |
| 11 #include "mojo/gpu/gl_context_owner.h" |
| 12 #include "mojo/public/interfaces/application/application_connector.mojom.h" |
| 13 #include "mojo/services/gfx/composition/interfaces/scenes.mojom.h" |
| 14 #include "mojo/skia/ganesh_context.h" |
| 15 #include "mojo/ui/ganesh_renderer.h" |
| 16 |
| 17 namespace examples { |
| 18 |
| 19 class Frame; |
| 20 |
| 21 // Ganesh-based rasterizer which runs on a separate thread from the view. |
| 22 // Calls into this object, including its creation, must be posted to the |
| 23 // correct message loop by the view. |
| 24 class Rasterizer { |
| 25 public: |
| 26 Rasterizer(mojo::ApplicationConnectorPtr connector, |
| 27 mojo::gfx::composition::ScenePtr scene); |
| 28 |
| 29 ~Rasterizer(); |
| 30 |
| 31 void PublishFrame(std::unique_ptr<Frame> frame); |
| 32 |
| 33 private: |
| 34 mojo::GLContextOwner gl_context_owner_; |
| 35 mojo::skia::GaneshContext ganesh_context_; |
| 36 mojo::ui::GaneshRenderer ganesh_renderer_; |
| 37 mojo::gfx::composition::ScenePtr scene_; |
| 38 |
| 39 DISALLOW_COPY_AND_ASSIGN(Rasterizer); |
| 40 }; |
| 41 |
| 42 } // namespace examples |
| 43 |
| 44 #endif // EXAMPLES_UI_NOODLES_RASTERIZER_H_ |
OLD | NEW |