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

Side by Side 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, 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
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 #include "services/gfx/compositor/render/render_frame.h"
6
7 #include "base/logging.h"
8 #include "services/gfx/compositor/render/render_layer.h"
9 #include "skia/ext/refptr.h"
10 #include "third_party/skia/include/core/SkCanvas.h"
11 #include "third_party/skia/include/core/SkPicture.h"
12 #include "third_party/skia/include/core/SkPoint.h"
13
14 namespace compositor {
15
16 RenderFrame::RenderFrame(const std::shared_ptr<RenderLayer>& root_layer,
17 const SkRect& viewport,
18 const mojo::gfx::composition::FrameInfo& frame_info)
19 : root_layer_(root_layer), viewport_(viewport), frame_info_(frame_info) {
20 DCHECK(root_layer_);
21 }
22
23 RenderFrame::~RenderFrame() {}
24
25 void RenderFrame::Paint(const PaintingScope& painting_scope,
26 SkCanvas* canvas) const {
27 skia::RefPtr<SkPicture> picture =
28 painting_scope.painting_cache()->GetSkPicture(painting_scope,
29 root_layer_);
30 DCHECK(picture);
31
32 // TODO: Consider using GrDrawContext instead of SkCanvas.
33 canvas->clear(SK_ColorBLACK);
34 canvas->drawPicture(picture.get());
35 canvas->flush();
36 }
37
38 mojo::gfx::composition::HitTestResultPtr RenderFrame::HitTest(
39 const SkPoint& point) const {
40 // TODO: implement me
41 auto result = mojo::gfx::composition::HitTestResult::New();
42 result->hits.resize(0u);
43 return result.Pass();
44 }
45
46 } // namespace compositor
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698