Add the ability to create child scenes

This patch contains Dart bindings for adding a child scene when running in
Mozart. The child scene is currently ignored, but a later patch will actually
incoporate it into the tree.
This commit is contained in:
Adam Barth
2016-01-28 14:15:19 -08:00
parent ac100db2c4
commit fd3b3e110f
3 changed files with 61 additions and 0 deletions

View File

@@ -16,6 +16,8 @@ source_set("flow") {
"color_filter_layer.h",
"container_layer.cc",
"container_layer.h",
"child_scene_layer.cc",
"child_scene_layer.h",
"instrumentation.cc",
"instrumentation.h",
"layer.cc",
@@ -41,5 +43,6 @@ source_set("flow") {
deps = [
"//base",
"//skia",
"//mojo/services/gfx/composition/interfaces",
]
}

View File

@@ -0,0 +1,18 @@
// Copyright 2016 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 "flow/child_scene_layer.h"
namespace flow {
ChildSceneLayer::ChildSceneLayer() {
}
ChildSceneLayer::~ChildSceneLayer() {
}
void ChildSceneLayer::Paint(PaintContext::ScopedFrame& frame) {
}
} // namespace flow

View File

@@ -0,0 +1,40 @@
// Copyright 2016 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 FLOW_CHILD_SCENE_LAYER_H_
#define FLOW_CHILD_SCENE_LAYER_H_
#include "flow/layer.h"
#include "mojo/services/gfx/composition/interfaces/scenes.mojom.h"
namespace flow {
class ChildSceneLayer : public Layer {
public:
ChildSceneLayer();
~ChildSceneLayer() override;
void set_offset(const SkPoint& offset) { offset_ = offset; }
void set_physical_size(const SkISize& physical_size) {
physical_size_ = physical_size;
}
void set_scene_token(mojo::gfx::composition::SceneTokenPtr scene_token) {
scene_token_ = scene_token.Pass();
}
void Paint(PaintContext::ScopedFrame& frame) override;
private:
SkPoint offset_;
SkISize physical_size_;
mojo::gfx::composition::SceneTokenPtr scene_token_;
DISALLOW_COPY_AND_ASSIGN(ChildSceneLayer);
};
} // namespace flow
#endif // FLOW_CHILD_SCENE_LAYER_H_