47static bool is_valid_non_lazy(
SkISize dimensions) {
55 : fSurface(
std::move(surf)), fKeyMode(
mode), fReleaseCallback(releaseCallback) {}
67 std::string_view label)
73 , fUseAllocator(useAllocator)
89 std::string_view label)
90 : fSurfaceFlags(surfaceFlags)
92 , fDimensions(dimensions)
95 , fUseAllocator(useAllocator)
97 , fIsProtected(isProtected)
109 , fSurfaceFlags(fTarget->
flags())
110 , fFormat(fTarget->backendFormat())
111 , fDimensions(fTarget->dimensions())
116 , fUseAllocator(useAllocator)
117 , fUniqueID(fTarget->uniqueID())
119 , fLabel(fTarget->getLabel()) {
173 return !peek->resourcePriv().getScratchKey().isValid();
191 if (!this->
isDDLTarget() && kInvalidGpuMemorySize != this->getRawGpuMemorySize_debugOnly()) {
205 if (uniqueKey && uniqueKey->
isValid()) {
219 if (uniqueKey && uniqueKey->
isValid()) {
239 sampleCount = rtp->numSamples();
249 renderable, sampleCount, mipmapped, fIsProtected,
key);
289 std::string_view label,
300 dstPoint = {srcRect.
fLeft, srcRect.
fTop};
310 auto format =
src->backendFormat().makeTexture2D();
326 if (dstContext && (copyTask = dstContext->copy(
src, srcRect, dstPoint))) {
328 *outTask = std::move(copyTask);
330 return dstContext->asSurfaceProxyRef();
333 if (
src->asTextureProxy()) {
348 if (dstContext && dstContext->blitTexture(std::move(view), srcRect, dstPoint)) {
350 *outTask = dstContext->refRenderTask();
352 return dstContext->asSurfaceProxyRef();
365 std::string_view label,
381#if defined(GR_TEST_UTILS)
382int32_t GrSurfaceProxy::testingOnly_getBackingRefCnt()
const {
384 return fTarget->testingOnly_getRefCnt();
397 tmp.
appendf(
"proxyID: %u - surfaceID: %u",
434 bool releaseCallback =
false;
436 auto result = fProxy->fLazyInstantiateCallback(resourceProvider, fProxy->
callbackDesc());
450 fProxy->fDimensions =
surface->dimensions();
457 texProxy->setTargetKeySync(syncKey);
461 if (!
surface->asTexture()->getUniqueKey().isValid()) {
475 if (releaseCallback) {
476 fProxy->fLazyInstantiateCallback =
nullptr;
485 surface->backendFormat().toStr().c_str(), fFormat.toStr().c_str());
487 this->onValidateSurface(
surface);
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
@ kUnknown_SkAlphaType
uninitialized
#define SkASSERTF(cond, fmt,...)
@ kYes
Do pre-clip the geometry before applying the (perspective) matrix.
@ kNo
Don't pre-clip the geometry before applying the (perspective) matrix.
static void dump(const float m[20], SkYUVColorSpace cs, bool rgb2yuv)
bool matches(GrContext_Base *candidate) const
bool isFormatCompressed(const GrBackendFormat &format) const
GrDirectContextPriv priv()
size_t gpuMemorySize() const
const GrDirectContext * getContext() const
const skgpu::UniqueKey & getUniqueKey() const
std::unique_ptr< skgpu::ganesh::SurfaceContext > makeSC(GrSurfaceProxyView readView, const GrColorInfo &)
std::unique_ptr< skgpu::ganesh::SurfaceFillContext > makeSFC(GrImageInfo, std::string_view label, SkBackingFit=SkBackingFit::kExact, int sampleCount=1, skgpu::Mipmapped=skgpu::Mipmapped::kNo, skgpu::Protected=skgpu::Protected::kNo, GrSurfaceOrigin=kTopLeft_GrSurfaceOrigin, skgpu::Budgeted=skgpu::Budgeted::kYes)
GrRecordingContextPriv priv()
std::enable_if< std::is_base_of< GrGpuResource, T >::value, sk_sp< T > >::type findByUniqueKey(const skgpu::UniqueKey &key)
sk_sp< GrTexture > createApproxTexture(SkISize dimensions, const GrBackendFormat &format, GrTextureType textureType, skgpu::Renderable renderable, int renderTargetSampleCnt, skgpu::Protected isProtected, std::string_view label)
void assignUniqueKeyToResource(const skgpu::UniqueKey &, GrGpuResource *)
sk_sp< GrTexture > createTexture(SkISize dimensions, const GrBackendFormat &format, GrTextureType textureType, skgpu::Renderable renderable, int renderTargetSampleCnt, skgpu::Mipmapped mipmapped, skgpu::Budgeted budgeted, skgpu::Protected isProtected, std::string_view label)
bool doLazyInstantiation(GrResourceProvider *)
void assign(sk_sp< GrSurface > surface)
SkISize backingStoreDimensions() const
virtual const skgpu::UniqueKey & getUniqueKey() const
GrProtected isProtected() const
virtual GrRenderTargetProxy * asRenderTargetProxy()
const GrBackendFormat & backendFormat() const
virtual ~GrSurfaceProxy()
bool instantiateImpl(GrResourceProvider *resourceProvider, int sampleCnt, GrRenderable, skgpu::Mipmapped, const skgpu::UniqueKey *)
bool isFormatCompressed(const GrCaps *) const
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)
virtual LazySurfaceDesc callbackDesc() const =0
SkISize dimensions() const
GrSurfaceProxy(const GrBackendFormat &, SkISize, SkBackingFit, skgpu::Budgeted, GrProtected, GrInternalSurfaceFlags, UseAllocator, std::string_view label)
void computeScratchKey(const GrCaps &, skgpu::ScratchKey *) const
std::function< LazyCallbackResult(GrResourceProvider *, const LazySurfaceDesc &)> LazyInstantiateCallback
virtual GrTextureProxy * asTextureProxy()
GrSurface * peekSurface() const
bool canSkipResourceAllocator() const
bool isInstantiated() const
bool isFunctionallyExact() const
void assign(sk_sp< GrSurface > surface)
sk_sp< GrSurface > createSurfaceImpl(GrResourceProvider *, int sampleCnt, GrRenderable, skgpu::Mipmapped) const
sk_sp< GrSurface > fTarget
GrInternalSurfaceFlags fSurfaceFlags
SkDEBUGCODE(void validateSurface(const GrSurface *);) SkDEBUGCODE(virtual void onValidateSurface(const GrSurface *)=0
UniqueID uniqueID() const
SkISize dimensions() const
virtual GrRenderTarget * asRenderTarget()
skgpu::Mipmapped mipmapped() const
static void ComputeScratchKey(const GrCaps &caps, const GrBackendFormat &format, SkISize dimensions, GrRenderable, int sampleCnt, skgpu::Mipmapped, GrProtected, skgpu::ScratchKey *key)
void void void appendf(const char format[],...) SK_PRINTF_LIKE(2
static constexpr Swizzle RGBA()
FlutterSemanticsFlag flags
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
uint32_t uint32_t * format
sk_sp< SkBlender > blender SkRect rect
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive mode
SkISize GetApproxSize(SkISize size)
LazyCallbackResult()=default
bool intersect(const SkIRect &r)
constexpr int32_t height() const
int32_t fTop
smaller y-axis bounds
static constexpr SkIRect MakeSize(const SkISize &size)
constexpr int32_t width() const
int32_t fLeft
smaller x-axis bounds