Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | List of all members
GrWaitRenderTask Class Referencefinal

#include <GrWaitRenderTask.h>

Inheritance diagram for GrWaitRenderTask:
GrRenderTask SkRefCnt SkRefCntBase

Public Member Functions

 GrWaitRenderTask (GrSurfaceProxyView surfaceView, std::unique_ptr< std::unique_ptr< GrSemaphore >[]> semaphores, int numSemaphores)
 
- Public Member Functions inherited from GrRenderTask
 GrRenderTask ()
 
 SkDEBUGCODE (~GrRenderTask() override;) void makeClosed(GrRecordingContext *)
 
void prePrepare (GrRecordingContext *context)
 
void prepare (GrOpFlushState *flushState)
 
bool execute (GrOpFlushState *flushState)
 
virtual bool requiresExplicitCleanup () const
 
virtual void endFlush (GrDrawingManager *)
 
virtual void disown (GrDrawingManager *)
 
bool isClosed () const
 
void makeSkippable ()
 
bool isSkippable () const
 
bool blocksReordering () const
 
void addDependency (GrDrawingManager *, GrSurfaceProxy *dependedOn, skgpu::Mipmapped, GrTextureResolveManager, const GrCaps &caps)
 
void addDependenciesFromOtherTask (GrRenderTask *otherTask)
 
SkSpan< GrRenderTask * > dependencies ()
 
SkSpan< GrRenderTask * > dependents ()
 
void replaceDependency (const GrRenderTask *toReplace, GrRenderTask *replaceWith)
 
void replaceDependent (const GrRenderTask *toReplace, GrRenderTask *replaceWith)
 
bool dependsOn (const GrRenderTask *dependedOn) const
 
uint32_t uniqueID () const
 
int numTargets () const
 
GrSurfaceProxytarget (int i) const
 
virtual skgpu::ganesh::OpsTaskasOpsTask ()
 
bool isUsed (GrSurfaceProxy *proxy) const
 
bool isInstantiated () const
 
 SK_DECLARE_INTERNAL_LLIST_INTERFACE (GrRenderTask)
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Private Member Functions

bool onIsUsed (GrSurfaceProxy *proxy) const override
 
void gatherProxyIntervals (GrResourceAllocator *) const override
 
ExpectedOutcome onMakeClosed (GrRecordingContext *, SkIRect *) override
 
bool onExecute (GrOpFlushState *) override
 

Additional Inherited Members

- Protected Types inherited from GrRenderTask
enum class  ExpectedOutcome : bool { kTargetUnchanged , kTargetDirty }
 
enum  Flags {
  kClosed_Flag = 0x01 , kDisowned_Flag = 0x02 , kSkippable_Flag = 0x04 , kAtlas_Flag = 0x08 ,
  kBlocksReordering_Flag = 0x10 , kWasOutput_Flag = 0x20 , kTempMark_Flag = 0x40
}
 
- Protected Member Functions inherited from GrRenderTask
 SkDEBUGCODE (bool deferredProxiesAreInstantiated() const ;) void addTarget(GrDrawingManager *
 
void addTarget (GrDrawingManager *dm, const GrSurfaceProxyView &view)
 
void setFlag (uint32_t flag)
 
void resetFlag (uint32_t flag)
 
bool isSetFlag (uint32_t flag) const
 
void setIndex (uint32_t index)
 
uint32_t getIndex () const
 
- Protected Attributes inherited from GrRenderTask
 sk_sp< GrSurfaceProxy >
 
skia_private::STArray< 1, sk_sp< GrSurfaceProxy > > fTargets
 
skia_private::TArray< GrTextureProxy *, true > fDeferredProxies
 

Detailed Description

Definition at line 14 of file GrWaitRenderTask.h.

Constructor & Destructor Documentation

◆ GrWaitRenderTask()

GrWaitRenderTask::GrWaitRenderTask ( GrSurfaceProxyView  surfaceView,
std::unique_ptr< std::unique_ptr< GrSemaphore >[]>  semaphores,
int  numSemaphores 
)
inline

Definition at line 16 of file GrWaitRenderTask.h.

19 : GrRenderTask()
20 , fSemaphores(std::move(semaphores))
21 , fNumSemaphores(numSemaphores)
22 , fWaitedOn(std::move(surfaceView)) {}

Member Function Documentation

◆ gatherProxyIntervals()

void GrWaitRenderTask::gatherProxyIntervals ( GrResourceAllocator alloc) const
overrideprivatevirtual

Implements GrRenderTask.

Definition at line 14 of file GrWaitRenderTask.cpp.

14 {
15 // This renderTask doesn't have "normal" ops. In this case we still need to add an interval (so
16 // fEndOfOpsTaskOpIndices will remain in sync), so we create a fake op# to capture the fact that
17 // we manipulate our target's proxy.
18 SkASSERT(0 == this->numTargets());
19 auto fakeOp = alloc->curOp();
20 alloc->addInterval(fWaitedOn.proxy(), fakeOp, fakeOp,
23 alloc->incOps();
24}
#define SkASSERT(cond)
Definition SkAssert.h:116
int numTargets() const
void addInterval(GrSurfaceProxy *, unsigned int start, unsigned int end, ActualUse actualUse, AllowRecycling SkDEBUGCODE(, bool isDirectDstRead=false))
unsigned int curOp() const
GrSurfaceProxy * proxy() const

◆ onExecute()

bool GrWaitRenderTask::onExecute ( GrOpFlushState flushState)
overrideprivatevirtual

Implements GrRenderTask.

Definition at line 26 of file GrWaitRenderTask.cpp.

26 {
27 for (int i = 0; i < fNumSemaphores; ++i) {
28 // If we don't have a semaphore here it means we failed to wrap it. That happens if the
29 // client didn't give us a valid semaphore to begin with. Therefore, it is fine to not wait
30 // on it.
31 if (fSemaphores[i]) {
32 flushState->gpu()->waitSemaphore(fSemaphores[i].get());
33 }
34 }
35 return true;
36}
virtual void waitSemaphore(GrSemaphore *semaphore)=0
const myers::Point & get(const myers::Segment &)

◆ onIsUsed()

bool GrWaitRenderTask::onIsUsed ( GrSurfaceProxy proxy) const
inlineoverrideprivatevirtual

Implements GrRenderTask.

Definition at line 25 of file GrWaitRenderTask.h.

25 {
26 return proxy == fWaitedOn.proxy();
27 }

◆ onMakeClosed()

ExpectedOutcome GrWaitRenderTask::onMakeClosed ( GrRecordingContext ,
SkIRect  
)
inlineoverrideprivatevirtual

Implements GrRenderTask.

Definition at line 30 of file GrWaitRenderTask.h.


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