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

Side by Side Diff: examples/ui/noodles/rasterizer.h

Issue 1558813002: Add a multi-threaded rendering example. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-15
Patch Set: address feedback Created 4 years, 11 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 | « examples/ui/noodles/noodles_view.cc ('k') | examples/ui/noodles/rasterizer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_
OLDNEW
« no previous file with comments | « examples/ui/noodles/noodles_view.cc ('k') | examples/ui/noodles/rasterizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698