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

#include <GrDDLTask.h>

Inheritance diagram for GrDDLTask:
GrRenderTask SkRefCnt SkRefCntBase

Public Member Functions

 GrDDLTask (GrDrawingManager *, sk_sp< GrRenderTargetProxy > ddlTarget, sk_sp< const GrDeferredDisplayList >)
 
 ~GrDDLTask () override
 
bool requiresExplicitCleanup () const override
 
void endFlush (GrDrawingManager *) override
 
void disown (GrDrawingManager *) override
 
- 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)
 
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 *) const override
 
void gatherProxyIntervals (GrResourceAllocator *) const override
 
ExpectedOutcome onMakeClosed (GrRecordingContext *, SkIRect *targetUpdateBounds) override
 
void onPrePrepare (GrRecordingContext *) override
 
void onPrepare (GrOpFlushState *) 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

This render task isolates the DDL's tasks from the rest of the DAG. This means that the DDL's tasks cannot be reordered by the topological sort and are always executed as a single block. It almost entirely just forwards calls down to the DDL's render tasks.

Definition at line 23 of file GrDDLTask.h.

Constructor & Destructor Documentation

◆ GrDDLTask()

GrDDLTask::GrDDLTask ( GrDrawingManager drawingMgr,
sk_sp< GrRenderTargetProxy ddlTarget,
sk_sp< const GrDeferredDisplayList ddl 
)

Definition at line 15 of file GrDDLTask.cpp.

18 : fDDL(std::move(ddl))
19 , fDDLTarget(std::move(ddlTarget)) {
20
21 for (auto& task : fDDL->priv().renderTasks()) {
22 SkASSERT(task->isClosed());
23
24 for (int i = 0; i < task->numTargets(); ++i) {
25 drawingMgr->setLastRenderTask(task->target(i), task.get());
26 }
27 }
28
29 // The DDL task never accepts additional tasks
30 this->setFlag(kClosed_Flag);
31}
#define SkASSERT(cond)
Definition SkAssert.h:116
void setLastRenderTask(const GrSurfaceProxy *, GrRenderTask *)
void setFlag(uint32_t flag)
@ kClosed_Flag
This task can't accept any more dependencies.
FlPixelBufferTexturePrivate * priv

◆ ~GrDDLTask()

GrDDLTask::~GrDDLTask ( )
override

Definition at line 33 of file GrDDLTask.cpp.

33{ }

Member Function Documentation

◆ disown()

void GrDDLTask::disown ( GrDrawingManager drawingManager)
overridevirtual

Reimplemented from GrRenderTask.

Definition at line 43 of file GrDDLTask.cpp.

43 {
44 for (auto& task : fDDL->priv().renderTasks()) {
45 task->disown(drawingManager);
46 }
47
48 INHERITED::disown(drawingManager);
49}
virtual void disown(GrDrawingManager *)

◆ endFlush()

void GrDDLTask::endFlush ( GrDrawingManager drawingManager)
overridevirtual

Reimplemented from GrRenderTask.

Definition at line 35 of file GrDDLTask.cpp.

35 {
36 for (auto& task : fDDL->priv().renderTasks()) {
37 task->endFlush(drawingManager);
38 }
39
40 INHERITED::endFlush(drawingManager);
41}
virtual void endFlush(GrDrawingManager *)

◆ gatherProxyIntervals()

void GrDDLTask::gatherProxyIntervals ( GrResourceAllocator alloc) const
overrideprivatevirtual

Implements GrRenderTask.

Definition at line 65 of file GrDDLTask.cpp.

65 {
66 // We don't have any proxies, but the resource allocator will still bark
67 // if a task doesn't claim any op indices, so we oblige it.
68 alloc->incOps();
69
70 for (auto& task : fDDL->priv().renderTasks()) {
71 task->gatherProxyIntervals(alloc);
72 }
73}

◆ onExecute()

bool GrDDLTask::onExecute ( GrOpFlushState flushState)
overrideprivatevirtual

Implements GrRenderTask.

Definition at line 87 of file GrDDLTask.cpp.

87 {
88 bool anyCommandsIssued = false;
89 for (auto& task : fDDL->priv().renderTasks()) {
90 if (task->execute(flushState)) {
91 anyCommandsIssued = true;
92 }
93 }
94
95 return anyCommandsIssued;
96}

◆ onIsUsed()

bool GrDDLTask::onIsUsed ( GrSurfaceProxy proxy) const
overrideprivatevirtual

Implements GrRenderTask.

Definition at line 51 of file GrDDLTask.cpp.

51 {
52 if (proxy == fDDLTarget.get()) {
53 return true;
54 }
55
56 for (auto& task : fDDL->priv().renderTasks()) {
57 if (task->isUsed(proxy)) {
58 return true;
59 }
60 }
61
62 return false;
63}
T * get() const
Definition SkRefCnt.h:303

◆ onMakeClosed()

GrRenderTask::ExpectedOutcome GrDDLTask::onMakeClosed ( GrRecordingContext ,
SkIRect targetUpdateBounds 
)
overrideprivatevirtual

Implements GrRenderTask.

Definition at line 75 of file GrDDLTask.cpp.

◆ onPrepare()

void GrDDLTask::onPrepare ( GrOpFlushState flushState)
overrideprivatevirtual

Reimplemented from GrRenderTask.

Definition at line 81 of file GrDDLTask.cpp.

81 {
82 for (auto& task : fDDL->priv().renderTasks()) {
83 task->prepare(flushState);
84 }
85}

◆ onPrePrepare()

void GrDDLTask::onPrePrepare ( GrRecordingContext )
inlineoverrideprivatevirtual

Reimplemented from GrRenderTask.

Definition at line 46 of file GrDDLTask.h.

46 {
47 // This entry point is only called when a DDL is snapped off of a recorder.
48 // Since DDL tasks should never recursively appear within a DDL this should never
49 // be called.
50 SkASSERT(0);
51 }

◆ requiresExplicitCleanup()

bool GrDDLTask::requiresExplicitCleanup ( ) const
inlineoverridevirtual

Reimplemented from GrRenderTask.

Definition at line 33 of file GrDDLTask.h.

33{ return true; }

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