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

Unified Diff: services/gfx/compositor/render/render_frame.cc

Issue 1552963002: Initial checkin of the new Mozart compositor. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-11
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: services/gfx/compositor/render/render_frame.cc
diff --git a/services/gfx/compositor/render/render_frame.cc b/services/gfx/compositor/render/render_frame.cc
new file mode 100644
index 0000000000000000000000000000000000000000..10b4f3133a4dbbd41cb220926f33e8e073c505f4
--- /dev/null
+++ b/services/gfx/compositor/render/render_frame.cc
@@ -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.
+
+#include "services/gfx/compositor/render/render_frame.h"
+
+#include "base/logging.h"
+#include "services/gfx/compositor/render/render_layer.h"
+#include "skia/ext/refptr.h"
+#include "third_party/skia/include/core/SkCanvas.h"
+#include "third_party/skia/include/core/SkPicture.h"
+#include "third_party/skia/include/core/SkPoint.h"
+
+namespace compositor {
+
+RenderFrame::RenderFrame(const std::shared_ptr<RenderLayer>& root_layer,
+ const SkRect& viewport,
+ const mojo::gfx::composition::FrameInfo& frame_info)
+ : root_layer_(root_layer), viewport_(viewport), frame_info_(frame_info) {
+ DCHECK(root_layer_);
+}
+
+RenderFrame::~RenderFrame() {}
+
+void RenderFrame::Paint(const PaintingScope& painting_scope,
+ SkCanvas* canvas) const {
+ skia::RefPtr<SkPicture> picture =
+ painting_scope.painting_cache()->GetSkPicture(painting_scope,
+ root_layer_);
+ DCHECK(picture);
+
+ // TODO: Consider using GrDrawContext instead of SkCanvas.
+ canvas->clear(SK_ColorBLACK);
+ canvas->drawPicture(picture.get());
+ canvas->flush();
+}
+
+mojo::gfx::composition::HitTestResultPtr RenderFrame::HitTest(
+ const SkPoint& point) const {
+ // TODO: implement me
+ auto result = mojo::gfx::composition::HitTestResult::New();
+ result->hits.resize(0u);
+ return result.Pass();
+}
+
+} // namespace compositor

Powered by Google App Engine
This is Rietveld 408576698