Flutter Engine
flutter::SkiaGPUObject< T > Class Template Reference

#include <skia_gpu_object.h>

Public Types

using SkiaObjectType = T
 

Public Member Functions

 SkiaGPUObject ()=default
 
 SkiaGPUObject (sk_sp< SkiaObjectType > object, fml::RefPtr< SkiaUnrefQueue > queue)
 
 SkiaGPUObject (SkiaGPUObject &&)=default
 
 ~SkiaGPUObject ()
 
SkiaGPUObjectoperator= (SkiaGPUObject &&)=default
 
sk_sp< SkiaObjectTypeget () const
 
void reset ()
 

Detailed Description

template<class T>
class flutter::SkiaGPUObject< T >

An object whose deallocation needs to be performed on an specific unref queue. The template argument U need to have a call operator that returns that unref queue.

Definition at line 58 of file skia_gpu_object.h.

Member Typedef Documentation

◆ SkiaObjectType

template<class T>
using flutter::SkiaGPUObject< T >::SkiaObjectType = T

Definition at line 60 of file skia_gpu_object.h.

Constructor & Destructor Documentation

◆ SkiaGPUObject() [1/3]

template<class T>
flutter::SkiaGPUObject< T >::SkiaGPUObject ( )
default

◆ SkiaGPUObject() [2/3]

template<class T>
flutter::SkiaGPUObject< T >::SkiaGPUObject ( sk_sp< SkiaObjectType object,
fml::RefPtr< SkiaUnrefQueue queue 
)
inline

Definition at line 63 of file skia_gpu_object.h.

64  : object_(std::move(object)), queue_(std::move(queue)) {
65  FML_DCHECK(object_);
66  }
#define FML_DCHECK(condition)
Definition: logging.h:86

◆ SkiaGPUObject() [3/3]

template<class T>
flutter::SkiaGPUObject< T >::SkiaGPUObject ( SkiaGPUObject< T > &&  )
default

◆ ~SkiaGPUObject()

template<class T>
flutter::SkiaGPUObject< T >::~SkiaGPUObject ( )
inline

Definition at line 68 of file skia_gpu_object.h.

68 { reset(); }

Member Function Documentation

◆ get()

◆ operator=()

template<class T>
SkiaGPUObject& flutter::SkiaGPUObject< T >::operator= ( SkiaGPUObject< T > &&  )
default

◆ reset()

template<class T>
void flutter::SkiaGPUObject< T >::reset ( )
inline

Definition at line 74 of file skia_gpu_object.h.

Referenced by flutter::CanvasImage::dispose(), flutter::Picture::dispose(), and flutter::testing::TEST_F().

74  {
75  if (object_ && queue_) {
76  queue_->Unref(object_.release());
77  }
78  queue_ = nullptr;
79  FML_DCHECK(object_ == nullptr);
80  }
#define FML_DCHECK(condition)
Definition: logging.h:86

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