Flutter Engine
The Flutter Engine
Classes | Public Member Functions | List of all members
skgpu::ganesh::AtlasRenderTask Class Referencefinal

#include <AtlasRenderTask.h>

Inheritance diagram for skgpu::ganesh::AtlasRenderTask:
skgpu::ganesh::OpsTask GrRenderTask SkRefCnt SkRefCntBase

Public Member Functions

 AtlasRenderTask (GrRecordingContext *, sk_sp< GrArenas >, std::unique_ptr< GrDynamicAtlas >)
 
const GrTextureProxyatlasProxy () const
 
GrSurfaceProxyView readView (const GrCaps &caps) const
 
bool addPath (const SkMatrix &, const SkPath &, SkIPoint pathDevTopLeft, int widthInAtlas, int heightInAtlas, bool transposedInAtlas, SkIPoint16 *locationInAtlas)
 
bool instantiate (GrOnFlushResourceProvider *onFlushRP, sk_sp< GrTexture > backingTexture=nullptr)
 
- Public Member Functions inherited from skgpu::ganesh::OpsTask
 OpsTask (GrDrawingManager *, GrSurfaceProxyView, GrAuditTrail *, sk_sp< GrArenas >)
 
 ~OpsTask () override
 
OpsTaskasOpsTask () override
 
bool isEmpty () const
 
bool usesMSAASurface () const
 
GrXferBarrierFlags renderPassXferBarriers () const
 
void endFlush (GrDrawingManager *) override
 
void onPrePrepare (GrRecordingContext *) override
 
void onPrepare (GrOpFlushState *flushState) override
 
bool onExecute (GrOpFlushState *flushState) override
 
void addSampledTexture (GrSurfaceProxy *proxy)
 
void addOp (GrDrawingManager *, GrOp::Owner, GrTextureResolveManager, const GrCaps &)
 
void addDrawOp (GrDrawingManager *, GrOp::Owner, bool usesMSAA, const GrProcessorSet::Analysis &, GrAppliedClip &&, const GrDstProxyView &, GrTextureResolveManager, const GrCaps &)
 
void discard ()
 
bool resetForFullscreenClear (CanDiscardPreviousOps)
 
void setColorLoadOp (GrLoadOp op, std::array< float, 4 > color={0, 0, 0, 0})
 
bool canMerge (const OpsTask *) const
 
int mergeFrom (SkSpan< const sk_sp< GrRenderTask > > tasks)
 
- 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
 
virtual void gatherProxyIntervals (GrResourceAllocator *) const =0
 
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
 

Additional Inherited Members

- Public Types inherited from skgpu::ganesh::OpsTask
enum class  CanDiscardPreviousOps : bool { kYes = true , kNo = false }
 
- Protected Types inherited from skgpu::ganesh::OpsTask
enum class  StencilContent { kDontCare , kUserBitsCleared , kPreserved }
 
- 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 skgpu::ganesh::OpsTask
void setInitialStencilContent (StencilContent initialContent)
 
void recordOp (GrOp::Owner, bool usesMSAA, GrProcessorSet::Analysis, GrAppliedClip *, const GrDstProxyView *, const GrCaps &)
 
ExpectedOutcome onMakeClosed (GrRecordingContext *, SkIRect *targetUpdateBounds) override
 
- Protected Member Functions inherited from GrRenderTask
 SkDEBUGCODE (bool deferredProxiesAreInstantiated() const ;) void addTarget(GrDrawingManager *
 
void addTarget (GrDrawingManager *dm, const GrSurfaceProxyView &view)
 
virtual ExpectedOutcome onMakeClosed (GrRecordingContext *, SkIRect *targetUpdateBounds)=0
 
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 *, truefDeferredProxies
 

Detailed Description

Definition at line 28 of file AtlasRenderTask.h.

Constructor & Destructor Documentation

◆ AtlasRenderTask()

skgpu::ganesh::AtlasRenderTask::AtlasRenderTask ( GrRecordingContext rContext,
sk_sp< GrArenas arenas,
std::unique_ptr< GrDynamicAtlas dynamicAtlas 
)

Definition at line 24 of file AtlasRenderTask.cpp.

27 : OpsTask(rContext->priv().drawingManager(),
28 dynamicAtlas->writeView(*rContext->priv().caps()),
29 rContext->priv().auditTrail(),
30 std::move(arenas))
31 , fDynamicAtlas(std::move(dynamicAtlas)) {
32}
const GrCaps * caps() const
GrDrawingManager * drawingManager()
GrRecordingContextPriv priv()
OpsTask(GrDrawingManager *, GrSurfaceProxyView, GrAuditTrail *, sk_sp< GrArenas >)
Definition: OpsTask.cpp:392

Member Function Documentation

◆ addPath()

bool skgpu::ganesh::AtlasRenderTask::addPath ( const SkMatrix viewMatrix,
const SkPath path,
SkIPoint  pathDevTopLeft,
int  widthInAtlas,
int  heightInAtlas,
bool  transposedInAtlas,
SkIPoint16 locationInAtlas 
)

Definition at line 34 of file AtlasRenderTask.cpp.

36 {
37 SkASSERT(!this->isClosed());
38 SkASSERT(this->isEmpty());
39 SkASSERT(!fDynamicAtlas->isInstantiated()); // Paths can't be added after instantiate().
40
41 if (!fDynamicAtlas->addRect(widthInAtlas, heightInAtlas, locationInAtlas)) {
42 return false;
43 }
44
45 SkMatrix pathToAtlasMatrix = viewMatrix;
46 if (transposedInAtlas) {
47 std::swap(pathToAtlasMatrix[0], pathToAtlasMatrix[3]);
48 std::swap(pathToAtlasMatrix[1], pathToAtlasMatrix[4]);
49 float tx=pathToAtlasMatrix.getTranslateX(), ty=pathToAtlasMatrix.getTranslateY();
50 pathToAtlasMatrix.setTranslateX(ty - pathDevTopLeft.y() + locationInAtlas->x());
51 pathToAtlasMatrix.setTranslateY(tx - pathDevTopLeft.x() + locationInAtlas->y());
52 } else {
53 pathToAtlasMatrix.postTranslate(locationInAtlas->x() - pathDevTopLeft.x(),
54 locationInAtlas->y() - pathDevTopLeft.y());
55 }
56
58 fWindingPathList.add(&fPathDrawAllocator, pathToAtlasMatrix, path);
59 } else {
60 fEvenOddPathList.add(&fPathDrawAllocator, pathToAtlasMatrix, path);
61 }
62 return true;
63}
GrFillRule GrFillRuleForSkPath(const SkPath &path)
Definition: GrTypesPriv.h:195
#define SkASSERT(cond)
Definition: SkAssert.h:116
void swap(sk_sp< T > &a, sk_sp< T > &b)
Definition: SkRefCnt.h:341
bool isClosed() const
Definition: GrRenderTask.h:56
SkMatrix & postTranslate(SkScalar dx, SkScalar dy)
Definition: SkMatrix.cpp:281
SkMatrix & setTranslateY(SkScalar v)
Definition: SkMatrix.h:530
SkScalar getTranslateY() const
Definition: SkMatrix.h:452
SkMatrix & setTranslateX(SkScalar v)
Definition: SkMatrix.h:524
SkScalar getTranslateX() const
Definition: SkMatrix.h:445
bool isEmpty() const
Definition: OpsTask.h:50
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition: switches.h:57
int16_t y() const
Definition: SkIPoint16.h:43
int16_t x() const
Definition: SkIPoint16.h:37
constexpr int32_t y() const
Definition: SkPoint_impl.h:52
constexpr int32_t x() const
Definition: SkPoint_impl.h:46

◆ atlasProxy()

const GrTextureProxy * skgpu::ganesh::AtlasRenderTask::atlasProxy ( ) const
inline

Definition at line 34 of file AtlasRenderTask.h.

34{ return fDynamicAtlas->textureProxy(); }

◆ instantiate()

bool skgpu::ganesh::AtlasRenderTask::instantiate ( GrOnFlushResourceProvider onFlushRP,
sk_sp< GrTexture backingTexture = nullptr 
)
inline

Definition at line 45 of file AtlasRenderTask.h.

46 {
47 SkASSERT(this->isClosed());
48 return fDynamicAtlas->instantiate(onFlushRP, std::move(backingTexture));
49 }

◆ readView()

GrSurfaceProxyView skgpu::ganesh::AtlasRenderTask::readView ( const GrCaps caps) const
inline

Definition at line 35 of file AtlasRenderTask.h.

35{ return fDynamicAtlas->readView(caps); }

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