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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « examples/ui/noodles/README.md ('k') | examples/ui/noodles/frame.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: examples/ui/noodles/frame.h
diff --git a/examples/ui/noodles/frame.h b/examples/ui/noodles/frame.h
new file mode 100644
index 0000000000000000000000000000000000000000..6c3858da5c79e3b5cea2130b2c0c21244b01d9ec
--- /dev/null
+++ b/examples/ui/noodles/frame.h
@@ -0,0 +1,46 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef EXAMPLES_UI_NOODLES_FRAME_H_
+#define EXAMPLES_UI_NOODLES_FRAME_H_
+
+#include "base/macros.h"
+#include "mojo/services/geometry/interfaces/geometry.mojom.h"
+#include "mojo/services/gfx/composition/interfaces/scenes.mojom.h"
+#include "skia/ext/refptr.h"
+
+class SkCanvas;
+class SkPicture;
+
+namespace examples {
+
+// A frame of content to be rasterized.
+// Instances of this object are created by the view's thread and sent to
+// the rasterizer's thread to be drawn.
+class Frame {
+ public:
+ Frame(const mojo::Size& size,
+ skia::RefPtr<SkPicture> picture,
+ mojo::gfx::composition::SceneMetadataPtr scene_metadata);
+ ~Frame();
+
+ const mojo::Size& size() { return size_; }
+
+ mojo::gfx::composition::SceneMetadataPtr TakeSceneMetadata() {
+ return scene_metadata_.Pass();
+ }
+
+ void Paint(SkCanvas* canvas);
+
+ private:
+ mojo::Size size_;
+ skia::RefPtr<SkPicture> picture_;
+ mojo::gfx::composition::SceneMetadataPtr scene_metadata_;
+
+ DISALLOW_COPY_AND_ASSIGN(Frame);
+};
+
+} // namespace examples
+
+#endif // EXAMPLES_UI_NOODLES_FRAME_H_
« 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