Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Private Member Functions | Friends | List of all members
GrTextureRenderTargetProxy Class Reference

#include <GrTextureRenderTargetProxy.h>

Inheritance diagram for GrTextureRenderTargetProxy:
GrRenderTargetProxy GrTextureProxy GrSurfaceProxy GrSurfaceProxy SkNVRefCnt< GrSurfaceProxy > SkNVRefCnt< GrSurfaceProxy >

Private Member Functions

bool instantiate (GrResourceProvider *) override
 
sk_sp< GrSurfacecreateSurface (GrResourceProvider *) const override
 
size_t onUninstantiatedGpuMemorySize () const override
 
LazySurfaceDesc callbackDesc () const override
 

Friends

class GrSurfaceProxy
 
class GrProxyProvider
 

Additional Inherited Members

- Public Types inherited from GrSurfaceProxy
enum class  ResolveFlags { kNone = 0 , kMSAA = 1 << 0 , kMipMaps = 1 << 1 }
 
enum class  LazyInstantiationKeyMode { kUnsynced , kSynced }
 
enum class  UseAllocator { kNo = false , kYes = true }
 
enum class  RectsMustMatch : bool { kNo = false , kYes = true }
 
using LazyInstantiateCallback = std::function< LazyCallbackResult(GrResourceProvider *, const LazySurfaceDesc &)>
 
- Public Member Functions inherited from GrRenderTargetProxy
GrRenderTargetProxyasRenderTargetProxy () override
 
const GrRenderTargetProxyasRenderTargetProxy () const override
 
bool canUseStencil (const GrCaps &caps) const
 
void setNeedsStencil ()
 
int needsStencil () const
 
int numSamples () const
 
int maxWindowRectangles (const GrCaps &caps) const
 
bool glRTFBOIDIs0 () const
 
bool wrapsVkSecondaryCB () const
 
bool supportsVkInputAttachment () const
 
void markMSAADirty (SkIRect dirtyRect)
 
void markMSAAResolved ()
 
bool isMSAADirty () const
 
const SkIRectmsaaDirtyRect () const
 
bool refsWrappedObjects () const
 
sk_sp< GrArenasarenas ()
 
void clearArenas ()
 
- Public Member Functions inherited from GrSurfaceProxy
virtual ~GrSurfaceProxy ()
 
bool isLazy () const
 
bool isFullyLazy () const
 
SkISize dimensions () const
 
int width () const
 
int height () const
 
SkISize backingStoreDimensions () const
 
SkRect getBoundsRect () const
 
bool isFunctionallyExact () const
 
SkRect backingStoreBoundsRect () const
 
SkIRect backingStoreBoundsIRect () const
 
const GrBackendFormatbackendFormat () const
 
bool isFormatCompressed (const GrCaps *) const
 
UniqueID uniqueID () const
 
UniqueID underlyingUniqueID () const
 
void deinstantiate ()
 
bool canSkipResourceAllocator () const
 
bool isInstantiated () const
 
void isUsedAsTaskTarget ()
 
int getTaskTargetCount () const
 
GrSurfacepeekSurface () const
 
GrTexturepeekTexture () const
 
GrRenderTargetpeekRenderTarget () const
 
skgpu::Budgeted isBudgeted () const
 
bool readOnly () const
 
bool framebufferOnly () const
 
bool requiresManualMSAAResolve () const
 
size_t gpuMemorySize () const
 
std::string_view getLabel () const
 
GrSurfaceProxyPriv priv ()
 
const GrSurfaceProxyPriv priv () const
 
bool isDDLTarget () const
 
GrProtected isProtected () const
 
bool isPromiseProxy ()
 
- Public Member Functions inherited from SkNVRefCnt< GrSurfaceProxy >
 SkNVRefCnt ()
 
 ~SkNVRefCnt ()
 
bool unique () const
 
void ref () const
 
void unref () const
 
void deref () const
 
bool refCntGreaterThan (int32_t threadIsolatedTestCnt) const
 
- Public Member Functions inherited from GrTextureProxy
GrTextureProxyasTextureProxy () override
 
const GrTextureProxyasTextureProxy () const override
 
skgpu::Mipmapped mipmapped () const
 
bool mipmapsAreDirty () const
 
void markMipmapsDirty ()
 
void markMipmapsClean ()
 
skgpu::Mipmapped proxyMipmapped () const
 
GrTextureType textureType () const
 
bool hasRestrictedSampling () const
 
const skgpu::UniqueKeygetUniqueKey () const override
 
CacheAccess cacheAccess ()
 
const CacheAccess cacheAccess () const
 
GrTextureProxyPriv texPriv ()
 
const GrTextureProxyPriv texPriv () const
 
 GrTextureProxy (const GrBackendFormat &, SkISize, skgpu::Mipmapped, GrMipmapStatus, SkBackingFit, skgpu::Budgeted, skgpu::Protected, GrInternalSurfaceFlags, UseAllocator, GrDDLProvider creatingProvider, std::string_view label)
 
 GrTextureProxy (LazyInstantiateCallback &&, const GrBackendFormat &, SkISize, skgpu::Mipmapped, GrMipmapStatus, SkBackingFit, skgpu::Budgeted, skgpu::Protected, GrInternalSurfaceFlags, UseAllocator, GrDDLProvider creatingProvider, std::string_view label)
 
 GrTextureProxy (sk_sp< GrSurface >, UseAllocator, GrDDLProvider creatingProvider)
 
 ~GrTextureProxy () override
 
void setTargetKeySync (bool sync)
 
- Static Public Member Functions inherited from GrSurfaceProxy
static sk_sp< GrSurfaceProxyCopy (GrRecordingContext *, sk_sp< GrSurfaceProxy > src, GrSurfaceOrigin, skgpu::Mipmapped, SkIRect srcRect, SkBackingFit, skgpu::Budgeted, std::string_view label, RectsMustMatch=RectsMustMatch::kNo, sk_sp< GrRenderTask > *outTask=nullptr)
 
static sk_sp< GrSurfaceProxyCopy (GrRecordingContext *, sk_sp< GrSurfaceProxy > src, GrSurfaceOrigin, skgpu::Mipmapped, SkBackingFit, skgpu::Budgeted, std::string_view label, sk_sp< GrRenderTask > *outTask=nullptr)
 
- Static Public Member Functions inherited from GrTextureProxy
static bool ProxiesAreCompatibleAsDynamicState (const GrSurfaceProxy *first, const GrSurfaceProxy *second)
 
- Protected Types inherited from GrRenderTargetProxy
enum class  WrapsVkSecondaryCB : bool { kNo = false , kYes = true }
 
- Protected Member Functions inherited from GrRenderTargetProxy
 GrRenderTargetProxy (const GrCaps &, const GrBackendFormat &, SkISize, int sampleCount, SkBackingFit, skgpu::Budgeted, skgpu::Protected, GrInternalSurfaceFlags, UseAllocator, std::string_view label)
 
 GrRenderTargetProxy (LazyInstantiateCallback &&, const GrBackendFormat &, SkISize, int sampleCount, SkBackingFit, skgpu::Budgeted, skgpu::Protected, GrInternalSurfaceFlags, UseAllocator, WrapsVkSecondaryCB, std::string_view label)
 
 GrRenderTargetProxy (sk_sp< GrSurface >, UseAllocator, WrapsVkSecondaryCB=WrapsVkSecondaryCB::kNo)
 
- Protected Member Functions inherited from GrSurfaceProxy
 GrSurfaceProxy (const GrBackendFormat &, SkISize, SkBackingFit, skgpu::Budgeted, GrProtected, GrInternalSurfaceFlags, UseAllocator, std::string_view label)
 
 GrSurfaceProxy (LazyInstantiateCallback &&, const GrBackendFormat &, SkISize, SkBackingFit, skgpu::Budgeted, GrProtected, GrInternalSurfaceFlags, UseAllocator, std::string_view label)
 
 GrSurfaceProxy (sk_sp< GrSurface >, SkBackingFit, UseAllocator)
 
bool ignoredByResourceAllocator () const
 
void setIgnoredByResourceAllocator ()
 
void computeScratchKey (const GrCaps &, skgpu::ScratchKey *) const
 
void assign (sk_sp< GrSurface > surface)
 
sk_sp< GrSurfacecreateSurfaceImpl (GrResourceProvider *, int sampleCnt, GrRenderable, skgpu::Mipmapped) const
 
void setLazyDimensions (SkISize dimensions)
 
bool instantiateImpl (GrResourceProvider *resourceProvider, int sampleCnt, GrRenderable, skgpu::Mipmapped, const skgpu::UniqueKey *)
 
- Protected Attributes inherited from GrSurfaceProxy
sk_sp< GrSurfacefTarget
 
GrInternalSurfaceFlags fSurfaceFlags
 

Detailed Description

Definition at line 44 of file GrTextureRenderTargetProxy.h.

Member Function Documentation

◆ callbackDesc()

GrSurfaceProxy::LazySurfaceDesc GrTextureRenderTargetProxy::callbackDesc ( ) const
overrideprivatevirtual

Implements GrSurfaceProxy.

Definition at line 203 of file GrTextureRenderTargetProxy.cpp.

203 {
204 SkISize dims;
205 SkBackingFit fit;
206 if (this->isFullyLazy()) {
208 dims = {-1, -1};
209 } else {
211 dims = this->dimensions();
212 }
213 return {
214 dims,
215 fit,
216 GrRenderable::kYes,
217 this->mipmapped(),
218 this->numSamples(),
219 this->backendFormat(),
220 this->textureType(),
221 this->isProtected(),
222 this->isBudgeted(),
223 this->getLabel(),
224 };
225}
SkBackingFit
GrProtected isProtected() const
const GrBackendFormat & backendFormat() const
std::string_view getLabel() const
bool isFullyLazy() const
skgpu::Budgeted isBudgeted() const
SkISize dimensions() const
bool isFunctionallyExact() const
GrTextureType textureType() const
skgpu::Mipmapped mipmapped() const

◆ createSurface()

sk_sp< GrSurface > GrTextureRenderTargetProxy::createSurface ( GrResourceProvider resourceProvider) const
overrideprivatevirtual

Reimplemented from GrRenderTargetProxy.

Definition at line 190 of file GrTextureRenderTargetProxy.cpp.

191 {
192 sk_sp<GrSurface> surface = this->createSurfaceImpl(resourceProvider, this->numSamples(),
193 GrRenderable::kYes, this->mipmapped());
194 if (!surface) {
195 return nullptr;
196 }
197 SkASSERT(surface->asRenderTarget());
198 SkASSERT(surface->asTexture());
199
200 return surface;
201}
#define SkASSERT(cond)
Definition SkAssert.h:116
sk_sp< GrSurface > createSurfaceImpl(GrResourceProvider *, int sampleCnt, GrRenderable, skgpu::Mipmapped) const
VkSurfaceKHR surface
Definition main.cc:49

◆ instantiate()

bool GrTextureRenderTargetProxy::instantiate ( GrResourceProvider resourceProvider)
overrideprivatevirtual

Reimplemented from GrRenderTargetProxy.

Definition at line 169 of file GrTextureRenderTargetProxy.cpp.

169 {
170 if (this->isLazy()) {
171 return false;
172 }
173
174 const skgpu::UniqueKey& key = this->getUniqueKey();
175
176 if (!this->instantiateImpl(resourceProvider, this->numSamples(), GrRenderable::kYes,
177 this->mipmapped(), key.isValid() ? &key : nullptr)) {
178 return false;
179 }
180 if (key.isValid()) {
181 SkASSERT(key == this->getUniqueKey());
182 }
183
184 SkASSERT(this->peekRenderTarget());
185 SkASSERT(this->peekTexture());
186
187 return true;
188}
bool instantiateImpl(GrResourceProvider *resourceProvider, int sampleCnt, GrRenderable, skgpu::Mipmapped, const skgpu::UniqueKey *)
bool isLazy() const
GrTexture * peekTexture() const
GrRenderTarget * peekRenderTarget() const
const skgpu::UniqueKey & getUniqueKey() const override
bool isValid() const
Definition ResourceKey.h:55

◆ onUninstantiatedGpuMemorySize()

size_t GrTextureRenderTargetProxy::onUninstantiatedGpuMemorySize ( ) const
overrideprivate

Definition at line 156 of file GrTextureRenderTargetProxy.cpp.

156 {
157 int colorSamplesPerPixel = this->numSamples();
158 if (colorSamplesPerPixel > 1) {
159 // Add one to account for the resolve buffer.
160 ++colorSamplesPerPixel;
161 }
162
163 // TODO: do we have enough information to improve this worst case estimate?
164 return GrSurface::ComputeSize(this->backendFormat(), this->dimensions(),
165 colorSamplesPerPixel, this->proxyMipmapped(),
166 !this->priv().isExact());
167}
GrSurfaceProxyPriv priv()
static size_t ComputeSize(const GrBackendFormat &, SkISize dimensions, int colorSamplesPerPixel, skgpu::Mipmapped, bool binSize=false)
Definition GrSurface.cpp:21
skgpu::Mipmapped proxyMipmapped() const

Friends And Related Symbol Documentation

◆ GrProxyProvider

friend class GrProxyProvider
friend

Definition at line 48 of file GrTextureRenderTargetProxy.h.

◆ GrSurfaceProxy

friend class GrSurfaceProxy
friend

Definition at line 47 of file GrTextureRenderTargetProxy.h.


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