Flutter Engine
The Flutter Engine
engine_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_LIB_UI_PAINTING_ENGINE_LAYER_H_
6#define FLUTTER_LIB_UI_PAINTING_ENGINE_LAYER_H_
7
8#include "flutter/flow/layers/container_layer.h"
9#include "flutter/lib/ui/dart_wrapper.h"
10
11namespace flutter {
12
13class EngineLayer;
14
15class EngineLayer : public RefCountedDartWrappable<EngineLayer> {
16 DEFINE_WRAPPERTYPEINFO();
17
18 public:
19 ~EngineLayer() override;
20
21 static void MakeRetained(
22 Dart_Handle dart_handle,
23 const std::shared_ptr<flutter::ContainerLayer>& layer) {
24 auto engine_layer = fml::MakeRefCounted<EngineLayer>(layer);
25 engine_layer->AssociateWithDartWrapper(dart_handle);
26 }
27
28 void dispose();
29
30 std::shared_ptr<flutter::ContainerLayer> Layer() const { return layer_; }
31
32 private:
33 explicit EngineLayer(std::shared_ptr<flutter::ContainerLayer> layer);
34 std::shared_ptr<flutter::ContainerLayer> layer_;
35
36 FML_FRIEND_MAKE_REF_COUNTED(EngineLayer);
37};
38
39} // namespace flutter
40
41#endif // FLUTTER_LIB_UI_PAINTING_ENGINE_LAYER_H_
~EngineLayer() override
static void MakeRetained(Dart_Handle dart_handle, const std::shared_ptr< flutter::ContainerLayer > &layer)
Definition: engine_layer.h:21
std::shared_ptr< flutter::ContainerLayer > Layer() const
Definition: engine_layer.h:30
struct _Dart_Handle * Dart_Handle
Definition: dart_api.h:258