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

#include <GrTransferFromRenderTask.h>

Inheritance diagram for GrTransferFromRenderTask:
GrRenderTask SkRefCnt SkRefCntBase

Public Member Functions

 GrTransferFromRenderTask (sk_sp< GrSurfaceProxy > srcProxy, const SkIRect &srcRect, GrColorType surfaceColorType, GrColorType dstColorType, sk_sp< GrGpuBuffer > dstBuffer, size_t dstOffset)
 
- 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 27 of file GrTransferFromRenderTask.h.

Constructor & Destructor Documentation

◆ GrTransferFromRenderTask()

GrTransferFromRenderTask::GrTransferFromRenderTask ( sk_sp< GrSurfaceProxy srcProxy,
const SkIRect srcRect,
GrColorType  surfaceColorType,
GrColorType  dstColorType,
sk_sp< GrGpuBuffer dstBuffer,
size_t  dstOffset 
)
inline

Definition at line 29 of file GrTransferFromRenderTask.h.

35 : GrRenderTask()
36 , fSrcProxy(std::move(srcProxy))
37 , fSrcRect(srcRect)
38 , fSurfaceColorType(surfaceColorType)
39 , fDstColorType(dstColorType)
40 , fDstBuffer(std::move(dstBuffer))
41 , fDstOffset(dstOffset) {}

Member Function Documentation

◆ gatherProxyIntervals()

void GrTransferFromRenderTask::gatherProxyIntervals ( GrResourceAllocator alloc) const
overrideprivatevirtual

Implements GrRenderTask.

Definition at line 14 of file GrTransferFromRenderTask.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 read fSrcProxy.
18 alloc->addInterval(fSrcProxy.get(), alloc->curOp(), alloc->curOp(),
21 alloc->incOps();
22}
void addInterval(GrSurfaceProxy *, unsigned int start, unsigned int end, ActualUse actualUse, AllowRecycling SkDEBUGCODE(, bool isDirectDstRead=false))
unsigned int curOp() const
T * get() const
Definition SkRefCnt.h:303

◆ onExecute()

bool GrTransferFromRenderTask::onExecute ( GrOpFlushState flushState)
overrideprivatevirtual

Implements GrRenderTask.

Definition at line 24 of file GrTransferFromRenderTask.cpp.

24 {
25 if (!fSrcProxy->isInstantiated()) {
26 return false;
27 }
28 return flushState->gpu()->transferPixelsFrom(fSrcProxy->peekSurface(),
29 fSrcRect,
30 fSurfaceColorType,
31 fDstColorType,
32 fDstBuffer,
33 fDstOffset);
34}
bool transferPixelsFrom(GrSurface *surface, SkIRect rect, GrColorType surfaceColorType, GrColorType bufferColorType, sk_sp< GrGpuBuffer > transferBuffer, size_t offset)
Definition GrGpu.cpp:592
GrSurface * peekSurface() const
bool isInstantiated() const

◆ onIsUsed()

bool GrTransferFromRenderTask::onIsUsed ( GrSurfaceProxy proxy) const
inlineoverrideprivatevirtual

Implements GrRenderTask.

Definition at line 44 of file GrTransferFromRenderTask.h.

44 {
45 SkASSERT(0 == this->numTargets());
46 return proxy == fSrcProxy.get();
47 }
#define SkASSERT(cond)
Definition SkAssert.h:116
int numTargets() const

◆ onMakeClosed()

ExpectedOutcome GrTransferFromRenderTask::onMakeClosed ( GrRecordingContext ,
SkIRect  
)
inlineoverrideprivatevirtual

Implements GrRenderTask.

Definition at line 50 of file GrTransferFromRenderTask.h.


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