Flutter Engine
The Flutter Engine
Classes | Public Member Functions | List of all members
GrTextureResolveRenderTask Class Referencefinal

#include <GrTextureResolveRenderTask.h>

Inheritance diagram for GrTextureResolveRenderTask:
GrRenderTask SkRefCnt SkRefCntBase

Public Member Functions

 GrTextureResolveRenderTask ()
 
void addProxy (GrDrawingManager *, sk_sp< GrSurfaceProxy > proxy, GrSurfaceProxy::ResolveFlags, const GrCaps &)
 
- 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

- 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)
 
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 25 of file GrTextureResolveRenderTask.h.

Constructor & Destructor Documentation

◆ GrTextureResolveRenderTask()

GrTextureResolveRenderTask::GrTextureResolveRenderTask ( )
inline

Definition at line 27 of file GrTextureResolveRenderTask.h.

27: GrRenderTask() {}

Member Function Documentation

◆ addProxy()

void GrTextureResolveRenderTask::addProxy ( GrDrawingManager drawingMgr,
sk_sp< GrSurfaceProxy proxy,
GrSurfaceProxy::ResolveFlags  flags,
const GrCaps caps 
)

Definition at line 28 of file GrTextureResolveRenderTask.cpp.

31 {
33 GrSurfaceProxy* proxy = proxyRef.get();
34 Resolve* resolve;
35 bool newProxy = false;
36
37 // We might just need to update the flags for an existing dependency.
38 if (auto found = std::find(fTargets.begin(), fTargets.end(), proxyRef);
39 found != fTargets.end()) {
40 size_t index = found - fTargets.begin();
41 resolve = &fResolves[index];
42 newFlags = ~resolve->fFlags & flags;
43 resolve->fFlags |= flags;
44 } else {
45 // Ensure the last render task that operated on the proxy is closed. That's where msaa and
46 // mipmaps should have been marked dirty.
47 SkASSERT(!drawingMgr->getLastRenderTask(proxy)
48 || drawingMgr->getLastRenderTask(proxy)->isClosed());
50 resolve = &fResolves.emplace_back(flags);
51 newProxy = true;
52 }
53
55 GrRenderTargetProxy* renderTargetProxy = proxy->asRenderTargetProxy();
56 SkASSERT(renderTargetProxy);
57 SkASSERT(renderTargetProxy->isMSAADirty());
58 resolve->fMSAAResolveRect = renderTargetProxy->msaaDirtyRect();
59 renderTargetProxy->markMSAAResolved();
60 }
61
63 GrTextureProxy* textureProxy = proxy->asTextureProxy();
64 SkASSERT(skgpu::Mipmapped::kYes == textureProxy->mipmapped());
65 SkASSERT(textureProxy->mipmapsAreDirty());
66 textureProxy->markMipmapsClean();
67 }
68
69 // We must do this after updating the proxy state because of assertions that the proxy isn't
70 // dirty.
71 if (newProxy) {
72 // Add the proxy as a dependency: We will read the existing contents of this texture while
73 // generating mipmap levels and/or resolving MSAA.
74 this->addDependency(
75 drawingMgr, proxy, skgpu::Mipmapped::kNo, GrTextureResolveManager(nullptr), caps);
76 this->addTarget(drawingMgr, GrSurfaceProxyView(std::move(proxyRef)));
77 }
78}
#define SkASSERT(cond)
Definition: SkAssert.h:116
int find(T *array, int N, T item)
GrRenderTask * getLastRenderTask(const GrSurfaceProxy *) const
const SkIRect & msaaDirtyRect() const
bool isClosed() const
Definition: GrRenderTask.h:56
void addDependency(GrDrawingManager *, GrSurfaceProxy *dependedOn, skgpu::Mipmapped, GrTextureResolveManager, const GrCaps &caps)
skia_private::STArray< 1, sk_sp< GrSurfaceProxy > > fTargets
Definition: GrRenderTask.h:182
void addTarget(GrDrawingManager *dm, const GrSurfaceProxyView &view)
Definition: GrRenderTask.h:166
virtual GrRenderTargetProxy * asRenderTargetProxy()
virtual GrTextureProxy * asTextureProxy()
void markMipmapsClean()
skgpu::Mipmapped mipmapped() const
bool mipmapsAreDirty() const
T * get() const
Definition: SkRefCnt.h:303
T & emplace_back(Args &&... args)
Definition: SkTArray.h:248
FlutterSemanticsFlag flags
static FunctionPtr Resolve(Thread *thread, Zone *zone, const GrowableArray< const Instance * > &caller_arguments, const Class &receiver_class, const String &name, const Array &descriptor)

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