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

Unified Diff: examples/ui/noodles/frame.cc

Issue 1558813002: Add a multi-threaded rendering example. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-15
Patch Set: Created 4 years, 12 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
Index: examples/ui/noodles/frame.cc
diff --git a/examples/ui/noodles/frame.cc b/examples/ui/noodles/frame.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ca4faec308b7508a19ffbef72664f1c9670e8ead
--- /dev/null
+++ b/examples/ui/noodles/frame.cc
@@ -0,0 +1,31 @@
+// 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.
+
+#include "examples/ui/noodles/frame.h"
+
+#include "base/logging.h"
+#include "third_party/skia/include/core/SkCanvas.h"
+#include "third_party/skia/include/core/SkColor.h"
+#include "third_party/skia/include/core/SkPicture.h"
+
+namespace examples {
+
+Frame::Frame(const mojo::Size& size,
+ skia::RefPtr<SkPicture> picture,
+ mojo::gfx::composition::SceneMetadataPtr scene_metadata)
+ : size_(size), picture_(picture), scene_metadata_(scene_metadata.Pass()) {
+ DCHECK(picture_);
+}
+
+Frame::~Frame() {}
+
+void Frame::Paint(SkCanvas* canvas) {
+ DCHECK(canvas);
+
+ canvas->clear(SK_ColorBLACK);
+ canvas->drawPicture(picture_.get());
+ canvas->flush();
+}
+
+} // namespace examples

Powered by Google App Engine
This is Rietveld 408576698