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 
11 namespace tonic {
12 class DartLibraryNatives;
13 } // namespace tonic
14 
15 namespace flutter {
16 
17 class EngineLayer;
18 
19 class EngineLayer : public RefCountedDartWrappable<EngineLayer> {
21 
22  public:
23  ~EngineLayer() override;
24 
25  static void MakeRetained(Dart_Handle dart_handle,
26  std::shared_ptr<flutter::ContainerLayer> layer) {
27  auto engine_layer = fml::MakeRefCounted<EngineLayer>(layer);
28  engine_layer->AssociateWithDartWrapper(dart_handle);
29  }
30 
31  static void RegisterNatives(tonic::DartLibraryNatives* natives);
32 
33  void dispose();
34 
35  std::shared_ptr<flutter::ContainerLayer> Layer() const { return layer_; }
36 
37  private:
38  explicit EngineLayer(std::shared_ptr<flutter::ContainerLayer> layer);
39  std::shared_ptr<flutter::ContainerLayer> layer_;
40 
42 };
43 
44 } // namespace flutter
45 
46 #endif // FLUTTER_LIB_UI_PAINTING_ENGINE_LAYER_H_
std::shared_ptr< flutter::ContainerLayer > Layer() const
Definition: engine_layer.h:35
#define DEFINE_WRAPPERTYPEINFO()
#define FML_FRIEND_MAKE_REF_COUNTED(T)
Definition: ref_counted.h:131
static void MakeRetained(Dart_Handle dart_handle, std::shared_ptr< flutter::ContainerLayer > layer)
Definition: engine_layer.h:25