Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
flutter::PictureRecorder Class Reference

#include <picture_recorder.h>

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

Public Member Functions

 ~PictureRecorder () override
 
sk_sp< DisplayListBuilderBeginRecording (SkRect bounds)
 
void endRecording (Dart_Handle dart_picture)
 
void set_canvas (fml::RefPtr< Canvas > canvas)
 
- Public Member Functions inherited from flutter::RefCountedDartWrappable< PictureRecorder >
virtual void RetainDartWrappableReference () const override
 
virtual void ReleaseDartWrappableReference () const override
 
- Public Member Functions inherited from fml::RefCountedThreadSafe< T >
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
 
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 wrapper)
 

Additional Inherited Members

- Public Types inherited from tonic::DartWrappable
enum  DartNativeFields { kPeerIndex , kNumberOfNativeFields }
 
- Protected Member Functions inherited from fml::RefCountedThreadSafe< T >
 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 15 of file picture_recorder.h.

Constructor & Destructor Documentation

◆ ~PictureRecorder()

flutter::PictureRecorder::~PictureRecorder ( )
override

Definition at line 26 of file picture_recorder.cc.

26{}

Member Function Documentation

◆ BeginRecording()

sk_sp< DisplayListBuilder > flutter::PictureRecorder::BeginRecording ( SkRect  bounds)

Definition at line 28 of file picture_recorder.cc.

28 {
29 display_list_builder_ =
30 sk_make_sp<DisplayListBuilder>(bounds, /*prepare_rtree=*/true);
31 return display_list_builder_;
32}

◆ Create()

void flutter::PictureRecorder::Create ( Dart_Handle  wrapper)
static

Definition at line 18 of file picture_recorder.cc.

18 {
20 auto res = fml::MakeRefCounted<PictureRecorder>();
21 res->AssociateWithDartWrapper(wrapper);
22}
static void ThrowIfUIOperationsProhibited()

◆ endRecording()

void flutter::PictureRecorder::endRecording ( Dart_Handle  dart_picture)

Definition at line 34 of file picture_recorder.cc.

34 {
35 if (!canvas_) {
36 return;
37 }
38
39 auto display_list = display_list_builder_->Build();
40 display_list_builder_ = nullptr;
41
42 FML_DCHECK(display_list->has_rtree());
43 Picture::CreateAndAssociateWithDartWrapper(dart_picture, display_list);
44
45 canvas_->Invalidate();
46 canvas_ = nullptr;
48}
static void CreateAndAssociateWithDartWrapper(Dart_Handle dart_handle, sk_sp< DisplayList > display_list)
Definition picture.cc:29
#define FML_DCHECK(condition)
Definition logging.h:103

◆ set_canvas()

void flutter::PictureRecorder::set_canvas ( fml::RefPtr< Canvas canvas)
inline

Definition at line 27 of file picture_recorder.h.

27{ canvas_ = std::move(canvas); }

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