Flutter Engine
The Flutter Engine
container_layer.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter 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#ifndef FLUTTER_FLOW_LAYERS_CONTAINER_LAYER_H_
6#define FLUTTER_FLOW_LAYERS_CONTAINER_LAYER_H_
7
8#include <vector>
9
10#include "flutter/flow/layers/layer.h"
11
12namespace flutter {
13
14class ContainerLayer : public Layer {
15 public:
17
18 void Diff(DiffContext* context, const Layer* old_layer) override;
19 void PreservePaintRegion(DiffContext* context) override;
20
21 virtual void Add(std::shared_ptr<Layer> layer);
22
23 void Preroll(PrerollContext* context) override;
24 void Paint(PaintContext& context) const override;
25
26 const std::vector<std::shared_ptr<Layer>>& layers() const { return layers_; }
27
28 virtual void DiffChildren(DiffContext* context,
29 const ContainerLayer* old_layer);
30
31 void PaintChildren(PaintContext& context) const override;
32
33 const ContainerLayer* as_container_layer() const override { return this; }
34
35 const SkRect& child_paint_bounds() const { return child_paint_bounds_; }
37 child_paint_bounds_ = bounds;
38 }
39
41 return children_renderable_state_flags_;
42 }
44 children_renderable_state_flags_ = flags;
45 }
46
47 protected:
49
50 private:
51 std::vector<std::shared_ptr<Layer>> layers_;
52 SkRect child_paint_bounds_;
53 int children_renderable_state_flags_ = 0;
54
55 FML_DISALLOW_COPY_AND_ASSIGN(ContainerLayer);
56};
57
58} // namespace flutter
59
60#endif // FLUTTER_FLOW_LAYERS_CONTAINER_LAYER_H_
void set_children_renderable_state_flags(int flags)
int children_renderable_state_flags() const
void Preroll(PrerollContext *context) override
void PrerollChildren(PrerollContext *context, SkRect *child_paint_bounds)
void Paint(PaintContext &context) const override
void PreservePaintRegion(DiffContext *context) override
virtual void Add(std::shared_ptr< Layer > layer)
void PaintChildren(PaintContext &context) const override
void Diff(DiffContext *context, const Layer *old_layer) override
const std::vector< std::shared_ptr< Layer > > & layers() const
void set_child_paint_bounds(const SkRect &bounds)
virtual void DiffChildren(DiffContext *context, const ContainerLayer *old_layer)
const SkRect & child_paint_bounds() const
const ContainerLayer * as_container_layer() const override
FlutterSemanticsFlag flags
Optional< SkRect > bounds
Definition: SkRecords.h:189