![]() |
Flutter Engine
The Flutter Engine
|
#include <GrSurfaceProxy.h>
Classes | |
struct | LazyCallbackResult |
struct | LazySurfaceDesc |
class | UniqueID |
Public Types | |
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 &)> |
Static Public Member Functions | |
static sk_sp< GrSurfaceProxy > | Copy (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< GrSurfaceProxy > | Copy (GrRecordingContext *, sk_sp< GrSurfaceProxy > src, GrSurfaceOrigin, skgpu::Mipmapped, SkBackingFit, skgpu::Budgeted, std::string_view label, sk_sp< GrRenderTask > *outTask=nullptr) |
Protected Member Functions | |
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 |
virtual sk_sp< GrSurface > | createSurface (GrResourceProvider *) const =0 |
void | assign (sk_sp< GrSurface > surface) |
sk_sp< GrSurface > | createSurfaceImpl (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 | |
sk_sp< GrSurface > | fTarget |
GrInternalSurfaceFlags | fSurfaceFlags |
Private Member Functions | |
SkDEBUGCODE (void validateSurface(const GrSurface *);) SkDEBUGCODE(virtual void onValidateSurface(const GrSurface *)=0 | |
SkDEBUGCODE (size_t getRawGpuMemorySize_debugOnly() const { return fGpuMemorySize;}) virtual size_t onUninstantiatedGpuMemorySize() const =0 | |
virtual LazySurfaceDesc | callbackDesc () const =0 |
Friends | |
class | GrSurfaceProxyPriv |
Definition at line 49 of file GrSurfaceProxy.h.
using GrSurfaceProxy::LazyInstantiateCallback = std::function<LazyCallbackResult(GrResourceProvider*, const LazySurfaceDesc&)> |
Definition at line 121 of file GrSurfaceProxy.h.
|
strong |
Some lazy proxy callbacks want to set their own (or no key) on the GrSurfaces they return. Others want the GrSurface's key to be kept in sync with the proxy's key. This enum controls the key relationship between proxies and their targets.
Enumerator | |
---|---|
kUnsynced | Don't key the GrSurface with the proxy's key. The lazy instantiation callback is free to return a GrSurface that already has a unique key unrelated to the proxy's key. |
kSynced | Keep the GrSurface's unique key in sync with the proxy's unique key. The GrSurface returned from the lazy instantiation callback must not have a unique key or have the same same unique key as the proxy. If the proxy is later assigned a key it is in turn assigned to the GrSurface. |
Definition at line 68 of file GrSurfaceProxy.h.
|
strong |
Enumerator | |
---|---|
kNo | |
kYes |
Definition at line 324 of file GrSurfaceProxy.h.
|
strong |
Indicates "resolutions" that need to be done on a surface before its pixels can be accessed. If both types of resolve are requested, the MSAA resolve will happen first.
Enumerator | |
---|---|
kNone | |
kMSAA | |
kMipMaps |
Definition at line 57 of file GrSurfaceProxy.h.
|
strong |
Enumerator | |
---|---|
kNo | This proxy will be instantiated outside the allocator (e.g. for proxies that are instantiated in on-flush callbacks). |
kYes | GrResourceAllocator should instantiate this proxy. |
Definition at line 124 of file GrSurfaceProxy.h.
|
virtual |
Definition at line 123 of file GrSurfaceProxy.cpp.
|
protected |
Definition at line 60 of file GrSurfaceProxy.cpp.
|
protected |
Definition at line 81 of file GrSurfaceProxy.cpp.
|
protected |
Definition at line 105 of file GrSurfaceProxy.cpp.
|
inlinevirtual |
Reimplemented in GrRenderTargetProxy.
Definition at line 250 of file GrSurfaceProxy.h.
|
inlinevirtual |
Reimplemented in GrRenderTargetProxy.
Definition at line 251 of file GrSurfaceProxy.h.
Definition at line 176 of file GrSurfaceProxy.cpp.
|
inlinevirtual |
Reimplemented in GrTextureProxy.
Definition at line 244 of file GrSurfaceProxy.h.
|
inlinevirtual |
Reimplemented in GrTextureProxy.
Definition at line 245 of file GrSurfaceProxy.h.
|
inline |
Definition at line 173 of file GrSurfaceProxy.h.
|
inline |
Definition at line 169 of file GrSurfaceProxy.h.
|
inline |
Helper that gets the dimensions the backing GrSurface will have as a bounding rectangle.
Definition at line 165 of file GrSurfaceProxy.h.
SkISize GrSurfaceProxy::backingStoreDimensions | ( | ) | const |
Definition at line 252 of file GrSurfaceProxy.cpp.
|
privatepure virtual |
bool GrSurfaceProxy::canSkipResourceAllocator | ( | ) | const |
Proxies that are already instantiated and whose backing surface cannot be recycled to instantiate other proxies do not need to be considered by GrResourceAllocator.
Definition at line 161 of file GrSurfaceProxy.cpp.
|
protected |
Definition at line 233 of file GrSurfaceProxy.cpp.
|
static |
Definition at line 359 of file GrSurfaceProxy.cpp.
|
static |
Definition at line 282 of file GrSurfaceProxy.cpp.
|
protectedpure virtual |
Implemented in GrRenderTargetProxy, GrTextureProxy, and GrMockSurfaceProxy.
|
protected |
Definition at line 126 of file GrSurfaceProxy.cpp.
void GrSurfaceProxy::deinstantiate | ( | ) |
Definition at line 228 of file GrSurfaceProxy.cpp.
|
inline |
Definition at line 145 of file GrSurfaceProxy.h.
|
inline |
Definition at line 292 of file GrSurfaceProxy.h.
|
inline |
Helper that gets the width and height of the proxy as a bounding rectangle.
Definition at line 157 of file GrSurfaceProxy.h.
|
inline |
Definition at line 322 of file GrSurfaceProxy.h.
|
inline |
How many render tasks has this proxy been the target of?
Definition at line 266 of file GrSurfaceProxy.h.
|
inlinevirtual |
Reimplemented in GrTextureProxy.
Definition at line 254 of file GrSurfaceProxy.h.
|
inline |
Retrieves the amount of GPU memory that will be or currently is used by this resource in bytes. It is approximate since we aren't aware of additional padding or copies made by the driver.
Definition at line 313 of file GrSurfaceProxy.h.
|
inline |
Definition at line 150 of file GrSurfaceProxy.h.
|
inlineprotected |
Definition at line 415 of file GrSurfaceProxy.h.
|
pure virtual |
Implemented in GrRenderTargetProxy, GrTextureProxy, and GrMockSurfaceProxy.
|
protected |
Definition at line 198 of file GrSurfaceProxy.cpp.
|
inline |
Does the resource count against the resource budget?
Definition at line 284 of file GrSurfaceProxy.h.
|
inline |
Definition at line 379 of file GrSurfaceProxy.h.
bool GrSurfaceProxy::isFormatCompressed | ( | const GrCaps * | caps | ) | const |
Definition at line 270 of file GrSurfaceProxy.cpp.
|
inline |
Definition at line 138 of file GrSurfaceProxy.h.
bool GrSurfaceProxy::isFunctionallyExact | ( | ) | const |
Definition at line 264 of file GrSurfaceProxy.cpp.
|
inline |
|
inline |
Definition at line 136 of file GrSurfaceProxy.h.
|
inline |
Definition at line 383 of file GrSurfaceProxy.h.
|
inline |
Definition at line 381 of file GrSurfaceProxy.h.
|
inline |
Called when this task becomes a target of a GrRenderTask.
Definition at line 263 of file GrSurfaceProxy.h.
|
inline |
Definition at line 277 of file GrSurfaceProxy.h.
|
inline |
Definition at line 269 of file GrSurfaceProxy.h.
|
inline |
Definition at line 273 of file GrSurfaceProxy.h.
|
inline |
Definition at line 62 of file GrSurfaceProxyPriv.h.
|
inline |
Definition at line 64 of file GrSurfaceProxyPriv.h.
|
inline |
The pixel values of this proxy's surface cannot be modified (e.g. doesn't support write pixels or MIP map level regen). Read-only proxies also bypass interval tracking and assignment in GrResourceAllocator.
Definition at line 291 of file GrSurfaceProxy.h.
|
inline |
This means surface is a multisampled render target, and internally holds a non-msaa texture for resolving into. The render target resolves itself by blitting into this internal texture. (asTexture() might or might not return the internal texture, but if it does, we always resolve the render target before accessing this texture's data.)
Definition at line 302 of file GrSurfaceProxy.h.
|
inlineprotected |
Definition at line 416 of file GrSurfaceProxy.h.
|
inlineprotected |
Definition at line 432 of file GrSurfaceProxy.h.
|
privatepure virtual |
|
privatepure virtual |
|
inline |
Definition at line 223 of file GrSurfaceProxy.h.
|
inline |
Definition at line 221 of file GrSurfaceProxy.h.
|
inline |
Definition at line 149 of file GrSurfaceProxy.h.
|
friend |
Definition at line 412 of file GrSurfaceProxy.h.
|
protected |
Definition at line 454 of file GrSurfaceProxy.h.
Definition at line 446 of file GrSurfaceProxy.h.