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

Side by Side Diff: examples/ui/noodles/frame.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/README.md ('k') | examples/ui/noodles/frame.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_FRAME_H_
6 #define EXAMPLES_UI_NOODLES_FRAME_H_
7
8 #include "base/macros.h"
9 #include "mojo/services/geometry/interfaces/geometry.mojom.h"
10 #include "mojo/services/gfx/composition/interfaces/scenes.mojom.h"
11 #include "skia/ext/refptr.h"
12
13 class SkCanvas;
14 class SkPicture;
15
16 namespace examples {
17
18 // A frame of content to be rasterized.
19 // Instances of this object are created by the view's thread and sent to
20 // the rasterizer's thread to be drawn.
21 class Frame {
22 public:
23 Frame(const mojo::Size& size,
24 skia::RefPtr<SkPicture> picture,
25 mojo::gfx::composition::SceneMetadataPtr scene_metadata);
26 ~Frame();
27
28 const mojo::Size& size() { return size_; }
29
30 mojo::gfx::composition::SceneMetadataPtr TakeSceneMetadata() {
31 return scene_metadata_.Pass();
32 }
33
34 void Paint(SkCanvas* canvas);
35
36 private:
37 mojo::Size size_;
38 skia::RefPtr<SkPicture> picture_;
39 mojo::gfx::composition::SceneMetadataPtr scene_metadata_;
40
41 DISALLOW_COPY_AND_ASSIGN(Frame);
42 };
43
44 } // namespace examples
45
46 #endif // EXAMPLES_UI_NOODLES_FRAME_H_
OLDNEW
« no previous file with comments | « examples/ui/noodles/README.md ('k') | examples/ui/noodles/frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698