container_layer.h 1.2 KB
Newer Older
1 2 3 4
// 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.

5 6
#ifndef FLUTTER_FLOW_LAYERS_CONTAINER_LAYER_H_
#define FLUTTER_FLOW_LAYERS_CONTAINER_LAYER_H_
7

8
#include <vector>
9
#include "flutter/flow/layers/layer.h"
10

A
Adam Barth 已提交
11
namespace flow {
12 13 14 15 16 17

class ContainerLayer : public Layer {
 public:
  ContainerLayer();
  ~ContainerLayer() override;

18
  void Add(std::shared_ptr<Layer> layer);
19

20
  void Preroll(PrerollContext* context, const SkMatrix& matrix) override;
21

J
Jeff Brown 已提交
22
#if defined(OS_FUCHSIA)
23
  void UpdateScene(SceneUpdateContext& context) override;
24
#endif  // defined(OS_FUCHSIA)
25

26
  const std::vector<std::shared_ptr<Layer>>& layers() const { return layers_; }
27

28
 protected:
29 30 31 32 33 34 35 36
  void PrerollChildren(PrerollContext* context,
                       const SkMatrix& child_matrix,
                       SkRect* child_paint_bounds);
  void PaintChildren(PaintContext& context) const;

#if defined(OS_FUCHSIA)
  void UpdateSceneChildren(SceneUpdateContext& context);
#endif  // defined(OS_FUCHSIA)
37

38
 private:
39
  std::vector<std::shared_ptr<Layer>> layers_;
40

41
  FML_DISALLOW_COPY_AND_ASSIGN(ContainerLayer);
42 43
};

A
Adam Barth 已提交
44
}  // namespace flow
45

46
#endif  // FLUTTER_FLOW_LAYERS_CONTAINER_LAYER_H_