Flutter Engine
flutter::PictureRecorder Class Reference

#include <picture_recorder.h>

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

Public Member Functions

 ~PictureRecorder () override
 
SkCanvas * BeginRecording (SkRect bounds)
 
fml::RefPtr< PictureendRecording (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< PictureRecorder >
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 size_t GetAllocationSize () const
 
Dart_Handle CreateDartWrapper (DartState *dart_state)
 
void AssociateWithDartWrapper (Dart_Handle wrappable)
 
void ClearDartWrapper ()
 
Dart_WeakPersistentHandle dart_wrapper () const
 

Static Public Member Functions

static fml::RefPtr< PictureRecorderCreate ()
 
static void RegisterNatives (tonic::DartLibraryNatives *natives)
 

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ ~PictureRecorder()

flutter::PictureRecorder::~PictureRecorder ( )
override

Definition at line 39 of file picture_recorder.cc.

39 {}

Member Function Documentation

◆ BeginRecording()

SkCanvas * flutter::PictureRecorder::BeginRecording ( SkRect  bounds)

Definition at line 41 of file picture_recorder.cc.

Referenced by flutter::Canvas::Create().

41  {
42  return picture_recorder_.beginRecording(bounds, &rtree_factory_);
43 }

◆ Create()

fml::RefPtr< PictureRecorder > flutter::PictureRecorder::Create ( )
static

Definition at line 33 of file picture_recorder.cc.

Referenced by flutter::PictureRecorder_constructor().

33  {
34  return fml::MakeRefCounted<PictureRecorder>();
35 }

◆ endRecording()

fml::RefPtr< Picture > flutter::PictureRecorder::endRecording ( Dart_Handle  dart_picture)

Definition at line 45 of file picture_recorder.cc.

References tonic::DartWrappable::ClearDartWrapper(), flutter::Picture::Create(), and flutter::UIDartState::CreateGPUObject().

45  {
46  if (!canvas_) {
47  return nullptr;
48  }
49 
51  dart_picture, UIDartState::CreateGPUObject(
52  picture_recorder_.finishRecordingAsPicture()));
53 
54  canvas_->Invalidate();
55  canvas_ = nullptr;
57  return picture;
58 }
static fml::RefPtr< Picture > Create(Dart_Handle dart_handle, flutter::SkiaGPUObject< SkPicture > picture)
Definition: picture.cc:31
static flutter::SkiaGPUObject< T > CreateGPUObject(sk_sp< T > object)
Definition: ui_dart_state.h:78

◆ RegisterNatives()

void flutter::PictureRecorder::RegisterNatives ( tonic::DartLibraryNatives natives)
static

Definition at line 27 of file picture_recorder.cc.

References DART_REGISTER_NATIVE, FOR_EACH_BINDING, and flutter::PictureRecorder_constructor().

Referenced by flutter::DartUI::InitForGlobal().

27  {
28  natives->Register(
29  {{"PictureRecorder_constructor", PictureRecorder_constructor, 1, true},
31 }
#define FOR_EACH_BINDING(V)
void Register(std::initializer_list< Entry > entries)
static void PictureRecorder_constructor(Dart_NativeArguments args)
#define DART_REGISTER_NATIVE(CLASS, METHOD)

◆ set_canvas()

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

Definition at line 31 of file picture_recorder.h.

Referenced by flutter::Canvas::Create().

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

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