Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
GpuSync Class Reference

Public Member Functions

 GpuSync ()
 
 ~GpuSync ()
 
void waitIfNeeded ()
 
sk_gpu_test::FlushFinishTrackernewFlushTracker (GrDirectContext *context)
 

Detailed Description

Definition at line 109 of file skpbench.cpp.

Constructor & Destructor Documentation

◆ GpuSync()

GpuSync::GpuSync ( )
inline

Definition at line 111 of file skpbench.cpp.

111{}

◆ ~GpuSync()

GpuSync::~GpuSync ( )
inline

Definition at line 112 of file skpbench.cpp.

112{}

Member Function Documentation

◆ newFlushTracker()

sk_gpu_test::FlushFinishTracker * GpuSync::newFlushTracker ( GrDirectContext context)

Definition at line 767 of file skpbench.cpp.

767 {
768 fFinishTrackers[fCurrentFlushIdx].reset(new sk_gpu_test::FlushFinishTracker(context));
769
770 sk_gpu_test::FlushFinishTracker* tracker = fFinishTrackers[fCurrentFlushIdx].get();
771 // We add an additional ref to the current flush tracker here. This ref is owned by the finish
772 // callback on the flush call. The finish callback will unref the tracker when called.
773 tracker->ref();
774
775 fCurrentFlushIdx = (fCurrentFlushIdx + 1) % std::size(fFinishTrackers);
776 return tracker;
777}
void ref() const
Definition SkRefCnt.h:62
T * get() const
Definition SkRefCnt.h:303
void reset(T *ptr=nullptr)
Definition SkRefCnt.h:310

◆ waitIfNeeded()

void GpuSync::waitIfNeeded ( )

Definition at line 761 of file skpbench.cpp.

761 {
762 if (fFinishTrackers[fCurrentFlushIdx]) {
763 fFinishTrackers[fCurrentFlushIdx]->waitTillFinished();
764 }
765}
void waitTillFinished(std::function< void()> tick={})

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