container_layer.h 1.0 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.

A
Adam Barth 已提交
5 6
#ifndef FLOW_LAYERS_CONTAINER_LAYER_H_
#define FLOW_LAYERS_CONTAINER_LAYER_H_
7

8
#include <vector>
A
Adam Barth 已提交
9
#include "flow/layers/layer.h"
10

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

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

  void Add(std::unique_ptr<Layer> layer);

20 21
  void Preroll(PrerollContext* context, const SkMatrix& matrix) override;
  void PrerollChildren(PrerollContext* context, const SkMatrix& matrix);
A
Adam Barth 已提交
22

23
  void PaintChildren(PaintContext::ScopedFrame& frame) const;
24

25 26 27
  void UpdateScene(mojo::gfx::composition::SceneUpdate* update,
                   mojo::gfx::composition::Node* container) override;

28 29
  const std::vector<std::unique_ptr<Layer>>& layers() const { return layers_; }

30 31 32 33 34 35
 private:
  std::vector<std::unique_ptr<Layer>> layers_;

  DISALLOW_COPY_AND_ASSIGN(ContainerLayer);
};

A
Adam Barth 已提交
36
}  // namespace flow
37

A
Adam Barth 已提交
38
#endif  // FLOW_LAYERS_CONTAINER_LAYER_H_