Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | List of all members
flutter::Scene Class Reference

#include <scene.h>

Inheritance diagram for flutter::Scene:
flutter::RefCountedDartWrappable< Scene > fml::RefCountedThreadSafe< Scene > tonic::DartWrappable fml::internal::RefCountedThreadSafeBase

Public Member Functions

 ~Scene () override
 
std::unique_ptr< flutter::LayerTreetakeLayerTree (uint64_t width, uint64_t height)
 
Dart_Handle toImageSync (uint32_t width, uint32_t height, Dart_Handle raw_image_handle)
 
Dart_Handle toImage (uint32_t width, uint32_t height, Dart_Handle raw_image_handle)
 
void dispose ()
 
- Public Member Functions inherited from flutter::RefCountedDartWrappable< Scene >
virtual void RetainDartWrappableReference () const override
 
virtual void ReleaseDartWrappableReference () const override
 
- Public Member Functions inherited from fml::RefCountedThreadSafe< Scene >
void Release () const
 
- Public Member Functions inherited from fml::internal::RefCountedThreadSafeBase
void AddRef () const
 
bool HasOneRef () const
 
void AssertHasOneRef () const
 
- Public Member Functions inherited from tonic::DartWrappable
 DartWrappable ()
 
virtual const DartWrapperInfoGetDartWrapperInfo () const =0
 
virtual void RetainDartWrappableReference () const =0
 
virtual void ReleaseDartWrappableReference () const =0
 
Dart_Handle CreateDartWrapper (DartState *dart_state)
 
void AssociateWithDartWrapper (Dart_Handle wrappable)
 
void ClearDartWrapper ()
 
Dart_WeakPersistentHandle dart_wrapper () const
 

Static Public Member Functions

static void create (Dart_Handle scene_handle, std::shared_ptr< flutter::Layer > rootLayer)
 

Additional Inherited Members

- Public Types inherited from tonic::DartWrappable
enum  DartNativeFields { kPeerIndex , kNumberOfNativeFields }
 
- Protected Member Functions inherited from fml::RefCountedThreadSafe< Scene >
 RefCountedThreadSafe ()
 
 ~RefCountedThreadSafe ()
 
- Protected Member Functions inherited from fml::internal::RefCountedThreadSafeBase
 RefCountedThreadSafeBase ()
 
 ~RefCountedThreadSafeBase ()
 
bool Release () const
 
void Adopt ()
 
- Protected Member Functions inherited from tonic::DartWrappable
virtual ~DartWrappable ()
 
- Static Protected Member Functions inherited from tonic::DartWrappable
static Dart_PersistentHandle GetTypeForWrapper (tonic::DartState *dart_state, const tonic::DartWrapperInfo &wrapper_info)
 

Detailed Description

Definition at line 16 of file scene.h.

Constructor & Destructor Documentation

◆ ~Scene()

flutter::Scene::~Scene ( )
override

Definition at line 37 of file scene.cc.

37{}

Member Function Documentation

◆ create()

void flutter::Scene::create ( Dart_Handle  scene_handle,
std::shared_ptr< flutter::Layer rootLayer 
)
static

Definition at line 27 of file scene.cc.

28 {
29 auto scene = fml::MakeRefCounted<Scene>(std::move(rootLayer));
30 scene->AssociateWithDartWrapper(scene_handle);
31}

◆ dispose()

void flutter::Scene::dispose ( )

Definition at line 43 of file scene.cc.

43 {
44 layer_tree_root_layer_.reset();
46}

◆ takeLayerTree()

std::unique_ptr< flutter::LayerTree > flutter::Scene::takeLayerTree ( uint64_t  width,
uint64_t  height 
)

Definition at line 122 of file scene.cc.

123 {
124 return BuildLayerTree(width, height);
125}
int32_t height
int32_t width

◆ toImage()

Dart_Handle flutter::Scene::toImage ( uint32_t  width,
uint32_t  height,
Dart_Handle  raw_image_handle 
)

Definition at line 61 of file scene.cc.

63 {
64 TRACE_EVENT0("flutter", "Scene::toImage");
65
66 if (!valid()) {
67 return tonic::ToDart("Scene has been disposed.");
68 }
69
70 return Picture::RasterizeLayerTreeToImage(BuildLayerTree(width, height),
71 raw_image_callback);
72}
static Dart_Handle RasterizeLayerTreeToImage(std::unique_ptr< LayerTree > layer_tree, Dart_Handle raw_image_callback)
Definition: picture.cc:129
Dart_Handle ToDart(const T &object)
#define TRACE_EVENT0(category_group, name)
Definition: trace_event.h:131

◆ toImageSync()

Dart_Handle flutter::Scene::toImageSync ( uint32_t  width,
uint32_t  height,
Dart_Handle  raw_image_handle 
)

Definition at line 48 of file scene.cc.

50 {
51 TRACE_EVENT0("flutter", "Scene::toImageSync");
52
53 if (!valid()) {
54 return tonic::ToDart("Scene has been disposed.");
55 }
56
57 Scene::RasterizeToImage(width, height, raw_image_handle);
58 return Dart_Null();
59}
DART_EXPORT Dart_Handle Dart_Null(void)

The documentation for this class was generated from the following files: