[Part 1]: Update the label string.
In this CL: 1. Replace the empty label string with the label name for different Skia components. 2. If the label string is empty, avoid sending it. 3. Append "_Skia_" at the beginning of the label string. Bug: chromium:1164111 Change-Id: I8154f960591f0c001c6746f25e1939e0eb65d7fa Reviewed-on: https://skia-review.googlesource.com/c/skia/+/548516 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
This commit is contained in:
parent
0a0f0a3ec6
commit
8397375ef8
@ -45,7 +45,7 @@ static void populate_cache(GrGpu* gpu, int resourceCount, int keyData32Count) {
|
||||
for (int i = 0; i < resourceCount; ++i) {
|
||||
skgpu::UniqueKey key;
|
||||
BenchResource::ComputeKey(i, keyData32Count, &key);
|
||||
GrGpuResource* resource = new BenchResource(gpu, /*label=*/{});
|
||||
GrGpuResource* resource = new BenchResource(gpu, /*label=*/"BenchResource");
|
||||
resource->resourcePriv().setUniqueKey(key);
|
||||
resource->unref();
|
||||
}
|
||||
|
@ -79,15 +79,16 @@ bool BaseDevice::replaceBackingProxy(SkSurface::ContentChangeMode mode) {
|
||||
GrProxyProvider* proxyProvider = fContext->priv().proxyProvider();
|
||||
// This entry point is used by SkSurface_Gpu::onCopyOnWrite so it must create a
|
||||
// kExact-backed render target proxy
|
||||
sk_sp<GrTextureProxy> proxy = proxyProvider->createProxy(format,
|
||||
ii.dimensions(),
|
||||
GrRenderable::kYes,
|
||||
oldRTP->numSamples(),
|
||||
oldView.mipmapped(),
|
||||
SkBackingFit::kExact,
|
||||
oldRTP->isBudgeted(),
|
||||
GrProtected::kNo,
|
||||
/*label=*/{});
|
||||
sk_sp<GrTextureProxy> proxy =
|
||||
proxyProvider->createProxy(format,
|
||||
ii.dimensions(),
|
||||
GrRenderable::kYes,
|
||||
oldRTP->numSamples(),
|
||||
oldView.mipmapped(),
|
||||
SkBackingFit::kExact,
|
||||
oldRTP->isBudgeted(),
|
||||
GrProtected::kNo,
|
||||
/*label=*/"BaseDevice_ReplaceBackingProxy");
|
||||
if (!proxy) {
|
||||
return false;
|
||||
}
|
||||
|
@ -115,7 +115,8 @@ GrResourceAllocator::Register::Register(GrSurfaceProxy* originatingProxy,
|
||||
SkDEBUGCODE(fUniqueID = CreateUniqueID();)
|
||||
if (fScratchKey.isValid()) {
|
||||
if (can_proxy_use_scratch(*provider->caps(), originatingProxy)) {
|
||||
fExistingSurface = provider->findAndRefScratchTexture(fScratchKey, /*label=*/{});
|
||||
fExistingSurface = provider->findAndRefScratchTexture(
|
||||
fScratchKey, /*label=*/"ResourceAllocatorRegister");
|
||||
}
|
||||
} else {
|
||||
SkASSERT(this->uniqueKey().isValid());
|
||||
|
@ -744,7 +744,7 @@ sk_sp<GrAttachment> GrResourceProvider::makeMSAAAttachment(SkISize dimensions,
|
||||
sampleCnt,
|
||||
isProtected,
|
||||
memoryless,
|
||||
/*label=*/{});
|
||||
/*label=*/"MakeMSAAAttachment");
|
||||
if (scratch) {
|
||||
return scratch;
|
||||
}
|
||||
|
@ -418,15 +418,16 @@ bool SurfaceContext::internalWritePixels(GrDirectContext* dContext,
|
||||
// targets we will use top left and otherwise we will make the origins match.
|
||||
GrSurfaceOrigin tempOrigin =
|
||||
this->asFillContext() ? kTopLeft_GrSurfaceOrigin : this->origin();
|
||||
auto tempProxy = dContext->priv().proxyProvider()->createProxy(format,
|
||||
src[0].dimensions(),
|
||||
GrRenderable::kNo,
|
||||
1,
|
||||
GrMipmapped::kNo,
|
||||
SkBackingFit::kApprox,
|
||||
SkBudgeted::kYes,
|
||||
GrProtected::kNo,
|
||||
/*label=*/{});
|
||||
auto tempProxy = dContext->priv().proxyProvider()->createProxy(
|
||||
format,
|
||||
src[0].dimensions(),
|
||||
GrRenderable::kNo,
|
||||
1,
|
||||
GrMipmapped::kNo,
|
||||
SkBackingFit::kApprox,
|
||||
SkBudgeted::kYes,
|
||||
GrProtected::kNo,
|
||||
/*label=*/"SurfaceContext_InternalWritePixels");
|
||||
if (!tempProxy) {
|
||||
return false;
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ sk_sp<GrD3DAttachment> GrD3DAttachment::MakeStencil(GrD3DGpu* gpu,
|
||||
format, resourceDesc, info,
|
||||
std::move(state),
|
||||
view,
|
||||
/*label=*/{}));
|
||||
/*label=*/"D3DAttachment_MakeStencil"));
|
||||
}
|
||||
|
||||
void GrD3DAttachment::onRelease() {
|
||||
|
@ -76,7 +76,7 @@ sk_sp<GrD3DBuffer> GrD3DBuffer::Make(GrD3DGpu* gpu, size_t size, GrGpuBufferType
|
||||
return sk_sp<GrD3DBuffer>(new GrD3DBuffer(gpu, size, intendedType, accessPattern,
|
||||
std::move(resource), std::move(alloc),
|
||||
resourceState,
|
||||
/*label=*/{}));
|
||||
/*label=*/"MakeD3DBuffer"));
|
||||
}
|
||||
|
||||
GrD3DBuffer::GrD3DBuffer(GrD3DGpu* gpu, size_t size, GrGpuBufferType intendedType,
|
||||
|
@ -365,15 +365,16 @@ sk_sp<GrTexture> GrD3DGpu::onCreateCompressedTexture(SkISize dimensions,
|
||||
GrMipmapStatus mipmapStatus = mipLevelCount > 1 ? GrMipmapStatus::kValid
|
||||
: GrMipmapStatus::kNotAllocated;
|
||||
|
||||
sk_sp<GrD3DTexture> d3dTex = this->createD3DTexture(dimensions,
|
||||
dxgiFormat,
|
||||
GrRenderable::kNo,
|
||||
1,
|
||||
budgeted,
|
||||
isProtected,
|
||||
mipLevelCount,
|
||||
mipmapStatus,
|
||||
/*label=*/{});
|
||||
sk_sp<GrD3DTexture> d3dTex = this->createD3DTexture(
|
||||
dimensions,
|
||||
dxgiFormat,
|
||||
GrRenderable::kNo,
|
||||
1,
|
||||
budgeted,
|
||||
isProtected,
|
||||
mipLevelCount,
|
||||
mipmapStatus,
|
||||
/*label=*/"D3DGpu_CreateCompressedTexture");
|
||||
if (!d3dTex) {
|
||||
return nullptr;
|
||||
}
|
||||
@ -1103,7 +1104,7 @@ bool GrD3DGpu::onRegenerateMipMapLevels(GrTexture * tex) {
|
||||
uavDesc,
|
||||
grProtected,
|
||||
GrMipmapStatus::kDirty,
|
||||
/*label=*/{});
|
||||
/*label=*/"RegenerateMipMapLevels");
|
||||
if (!uavTexture) {
|
||||
return false;
|
||||
}
|
||||
|
@ -124,10 +124,11 @@ sk_sp<GrD3DRenderTarget> GrD3DRenderTarget::MakeWrappedRenderTarget(
|
||||
d3dRT = new GrD3DRenderTarget(gpu, dimensions, info, std::move(state), msInfo,
|
||||
std::move(msState), msaaRenderTargetView, renderTargetView,
|
||||
kWrapped,
|
||||
/*label=*/{});
|
||||
/*label=*/"MakeWrappedRenderTargetWithMSAASurface");
|
||||
} else {
|
||||
d3dRT = new GrD3DRenderTarget(
|
||||
gpu, dimensions, info, std::move(state), renderTargetView, kWrapped, /*label=*/{});
|
||||
gpu, dimensions, info, std::move(state), renderTargetView, kWrapped,
|
||||
/*label=*/"MakeWrappedRenderTarget");
|
||||
}
|
||||
|
||||
return sk_sp<GrD3DRenderTarget>(d3dRT);
|
||||
|
@ -112,7 +112,7 @@ sk_sp<GrD3DTexture> GrD3DTexture::MakeWrappedTexture(GrD3DGpu* gpu,
|
||||
return sk_sp<GrD3DTexture>(new GrD3DTexture(gpu, dimensions, info, std::move(state),
|
||||
shaderResourceView, mipmapStatus, cacheable,
|
||||
ioType,
|
||||
/*label=*/{}));
|
||||
/*label=*/"D3DWrappedTexture"));
|
||||
}
|
||||
|
||||
sk_sp<GrD3DTexture> GrD3DTexture::MakeAliasingTexture(GrD3DGpu* gpu,
|
||||
@ -136,7 +136,7 @@ sk_sp<GrD3DTexture> GrD3DTexture::MakeAliasingTexture(GrD3DGpu* gpu,
|
||||
GrD3DTexture* tex = new GrD3DTexture(gpu, SkBudgeted::kNo, originalTexture->dimensions(),
|
||||
info, std::move(state), shaderResourceView,
|
||||
originalTexture->mipmapStatus(),
|
||||
/*label=*/{});
|
||||
/*label=*/"AliasingTexture");
|
||||
return sk_sp<GrD3DTexture>(tex);
|
||||
}
|
||||
|
||||
|
@ -206,29 +206,31 @@ sk_sp<GrD3DTextureRenderTarget> GrD3DTextureRenderTarget::MakeWrappedTextureRend
|
||||
const GrD3DDescriptorHeap::CPUHandle msaaRenderTargetView =
|
||||
gpu->resourceProvider().createRenderTargetView(msInfo.fResource.get());
|
||||
|
||||
GrD3DTextureRenderTarget* trt = new GrD3DTextureRenderTarget(gpu,
|
||||
dimensions,
|
||||
info,
|
||||
std::move(state),
|
||||
shaderResourceView,
|
||||
msInfo,
|
||||
std::move(msState),
|
||||
msaaRenderTargetView,
|
||||
renderTargetView,
|
||||
mipmapStatus,
|
||||
cacheable,
|
||||
/*label=*/{});
|
||||
GrD3DTextureRenderTarget* trt = new GrD3DTextureRenderTarget(
|
||||
gpu,
|
||||
dimensions,
|
||||
info,
|
||||
std::move(state),
|
||||
shaderResourceView,
|
||||
msInfo,
|
||||
std::move(msState),
|
||||
msaaRenderTargetView,
|
||||
renderTargetView,
|
||||
mipmapStatus,
|
||||
cacheable,
|
||||
/*label=*/"MakeWrappedTextureRenderTargetWithMSAASurface");
|
||||
return sk_sp<GrD3DTextureRenderTarget>(trt);
|
||||
} else {
|
||||
return sk_sp<GrD3DTextureRenderTarget>(new GrD3DTextureRenderTarget(gpu,
|
||||
dimensions,
|
||||
info,
|
||||
std::move(state),
|
||||
shaderResourceView,
|
||||
renderTargetView,
|
||||
mipmapStatus,
|
||||
cacheable,
|
||||
/*label=*/{}));
|
||||
return sk_sp<GrD3DTextureRenderTarget>(
|
||||
new GrD3DTextureRenderTarget(gpu,
|
||||
dimensions,
|
||||
info,
|
||||
std::move(state),
|
||||
shaderResourceView,
|
||||
renderTargetView,
|
||||
mipmapStatus,
|
||||
cacheable,
|
||||
/*label=*/"MakeWrappedTextureRenderTarget"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ sk_sp<GrDawnAttachment> GrDawnAttachment::MakeStencil(GrDawnGpu* gpu,
|
||||
sampleCnt,
|
||||
texture,
|
||||
view,
|
||||
/*label=*/{}));
|
||||
/*label=*/"DawnAttachment_MakeStencil"));
|
||||
}
|
||||
|
||||
GrDawnAttachment::~GrDawnAttachment() {}
|
||||
|
@ -181,7 +181,8 @@ GrOpsRenderPass* GrDawnGpu::onGetOpsRenderPass(
|
||||
sk_sp<GrGpuBuffer> GrDawnGpu::onCreateBuffer(size_t size,
|
||||
GrGpuBufferType type,
|
||||
GrAccessPattern accessPattern) {
|
||||
return GrDawnBuffer::Make(this, size, type, accessPattern, /*label=*/{});
|
||||
return GrDawnBuffer::Make(this, size, type, accessPattern,
|
||||
/*label=*/"DawnGpu_GetOpsRenderPass");
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -25,7 +25,8 @@ sk_sp<GrDawnRenderTarget> GrDawnRenderTarget::MakeWrapped(GrDawnGpu* gpu,
|
||||
int sampleCnt,
|
||||
const GrDawnRenderTargetInfo& info) {
|
||||
sk_sp<GrDawnRenderTarget> rt(
|
||||
new GrDawnRenderTarget(gpu, dimensions, sampleCnt, info, /*label=*/{}));
|
||||
new GrDawnRenderTarget(gpu, dimensions, sampleCnt, info,
|
||||
/*label=*/"DawnRenderTarget_MakeWrapped"));
|
||||
rt->registerWithCacheWrapped(GrWrapCacheable::kNo);
|
||||
return rt;
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ sk_sp<GrGLAttachment> GrGLAttachment::MakeStencil(GrGLGpu* gpu,
|
||||
GrAttachment::UsageFlags::kStencilAttachment,
|
||||
sampleCnt,
|
||||
format,
|
||||
/*label=*/{}));
|
||||
/*label=*/"GLAttachmentMakeStencil"));
|
||||
}
|
||||
|
||||
sk_sp<GrGLAttachment> GrGLAttachment::MakeMSAA(GrGLGpu* gpu,
|
||||
@ -114,7 +114,7 @@ sk_sp<GrGLAttachment> GrGLAttachment::MakeMSAA(GrGLGpu* gpu,
|
||||
GrAttachment::UsageFlags::kColorAttachment,
|
||||
sampleCnt,
|
||||
format,
|
||||
/*label=*/{}));
|
||||
/*label=*/"GLAttachmentMakeMSAA"));
|
||||
}
|
||||
|
||||
|
||||
@ -148,9 +148,12 @@ void GrGLAttachment::setMemoryBacking(SkTraceMemoryDump* traceMemoryDump,
|
||||
|
||||
void GrGLAttachment::onSetLabel() {
|
||||
SkASSERT(fRenderbufferID);
|
||||
GrGLGpu* glGpu = static_cast<GrGLGpu*>(this->getGpu());
|
||||
if (glGpu->glCaps().debugSupport()) {
|
||||
GR_GL_CALL(glGpu->glInterface(),
|
||||
ObjectLabel(GR_GL_TEXTURE, fRenderbufferID, -1, this->getLabel().c_str()));
|
||||
if (!this->getLabel().empty()) {
|
||||
const std::string label = "_Skia_" + this->getLabel();
|
||||
GrGLGpu* glGpu = static_cast<GrGLGpu*>(this->getGpu());
|
||||
if (glGpu->glCaps().debugSupport()) {
|
||||
GR_GL_CALL(glGpu->glInterface(),
|
||||
ObjectLabel(GR_GL_TEXTURE, fRenderbufferID, -1, label.c_str()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -32,7 +32,8 @@ public:
|
||||
int sampleCnt,
|
||||
GrGLFormat format) {
|
||||
return sk_sp<GrGLAttachment>(new GrGLAttachment(
|
||||
gpu, renderbufferID, dimensions, supportedUsages, sampleCnt, format, /*label=*/{}));
|
||||
gpu, renderbufferID, dimensions, supportedUsages, sampleCnt, format,
|
||||
/*label=*/"MakeWrappedRenderBuffer"));
|
||||
}
|
||||
|
||||
GrBackendFormat backendFormat() const override;
|
||||
|
@ -44,7 +44,8 @@ sk_sp<GrGLBuffer> GrGLBuffer::Make(GrGLGpu* gpu,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
sk_sp<GrGLBuffer> buffer(new GrGLBuffer(gpu, size, intendedType, accessPattern, /*label=*/{}));
|
||||
sk_sp<GrGLBuffer> buffer(new GrGLBuffer(gpu, size, intendedType, accessPattern,
|
||||
/*label=*/"MakeGlBuffer"));
|
||||
if (0 == buffer->bufferID()) {
|
||||
return nullptr;
|
||||
}
|
||||
@ -321,10 +322,13 @@ bool GrGLBuffer::onUpdateData(const void* src, size_t srcSizeInBytes) {
|
||||
|
||||
void GrGLBuffer::onSetLabel() {
|
||||
SkASSERT(fBufferID);
|
||||
GrGLGpu* glGpu = static_cast<GrGLGpu*>(this->getGpu());
|
||||
if (glGpu->glCaps().debugSupport()) {
|
||||
GR_GL_CALL(glGpu->glInterface(),
|
||||
ObjectLabel(GR_GL_BUFFER, fBufferID, -1, this->getLabel().c_str()));
|
||||
if (!this->getLabel().empty()) {
|
||||
const std::string label = "_Skia_" + this->getLabel();
|
||||
GrGLGpu* glGpu = static_cast<GrGLGpu*>(this->getGpu());
|
||||
if (glGpu->glCaps().debugSupport()) {
|
||||
GR_GL_CALL(glGpu->glInterface(),
|
||||
ObjectLabel(GR_GL_BUFFER, fBufferID, -1, label.c_str()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1537,7 +1537,8 @@ sk_sp<GrTexture> GrGLGpu::onCreateCompressedTexture(SkISize dimensions,
|
||||
? GrMipmapStatus::kValid
|
||||
: GrMipmapStatus::kNotAllocated;
|
||||
|
||||
auto tex = sk_make_sp<GrGLTexture>(this, budgeted, desc, mipmapStatus, /*label=*/"");
|
||||
auto tex = sk_make_sp<GrGLTexture>(this, budgeted, desc, mipmapStatus,
|
||||
/*label=*/"GLGpuCreateCompressedTexture");
|
||||
// The non-sampler params are still at their default values.
|
||||
tex->parameters()->set(&initialState, GrGLTextureParameters::NonsamplerState(),
|
||||
fResetTimestampForTextureParameters);
|
||||
|
@ -105,7 +105,8 @@ sk_sp<GrGLRenderTarget> GrGLRenderTarget::MakeWrapped(GrGLGpu* gpu,
|
||||
sFmt);
|
||||
}
|
||||
return sk_sp<GrGLRenderTarget>(new GrGLRenderTarget(
|
||||
gpu, dimensions, format, sampleCount, idDesc, std::move(sb), /*label=*/{}));
|
||||
gpu, dimensions, format, sampleCount, idDesc, std::move(sb),
|
||||
/*label=*/"GLRenderTargetMakeWrapped"));
|
||||
}
|
||||
|
||||
GrBackendRenderTarget GrGLRenderTarget::getBackendRenderTarget() const {
|
||||
|
@ -148,7 +148,8 @@ sk_sp<GrGLTexture> GrGLTexture::MakeWrapped(GrGLGpu* gpu,
|
||||
GrWrapCacheable cacheable,
|
||||
GrIOType ioType) {
|
||||
return sk_sp<GrGLTexture>(new GrGLTexture(
|
||||
gpu, desc, mipmapStatus, std::move(parameters), cacheable, ioType, /*label=*/{}));
|
||||
gpu, desc, mipmapStatus, std::move(parameters), cacheable, ioType,
|
||||
/*label=*/"GLTextureMakeWrapped"));
|
||||
}
|
||||
|
||||
bool GrGLTexture::onStealBackendTexture(GrBackendTexture* backendTexture,
|
||||
@ -167,10 +168,12 @@ bool GrGLTexture::onStealBackendTexture(GrBackendTexture* backendTexture,
|
||||
void GrGLTexture::onSetLabel() {
|
||||
SkASSERT(fID);
|
||||
SkASSERT(fTextureIDOwnership == GrBackendObjectOwnership::kOwned);
|
||||
GrGLGpu* glGpu = static_cast<GrGLGpu*>(this->getGpu());
|
||||
if (glGpu->glCaps().debugSupport()) {
|
||||
GR_GL_CALL(glGpu->glInterface(),
|
||||
ObjectLabel(GR_GL_TEXTURE, fID, -1, this->getLabel().c_str()));
|
||||
if (!this->getLabel().empty()) {
|
||||
const std::string label = "_Skia_" + this->getLabel();
|
||||
GrGLGpu* glGpu = static_cast<GrGLGpu*>(this->getGpu());
|
||||
if (glGpu->glCaps().debugSupport()) {
|
||||
GR_GL_CALL(glGpu->glInterface(), ObjectLabel(GR_GL_TEXTURE, fID, -1, label.c_str()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -69,14 +69,15 @@ sk_sp<GrGLTextureRenderTarget> GrGLTextureRenderTarget::MakeWrapped(
|
||||
const GrGLRenderTarget::IDs& rtIDs,
|
||||
GrWrapCacheable cacheable,
|
||||
GrMipmapStatus mipmapStatus) {
|
||||
return sk_sp<GrGLTextureRenderTarget>(new GrGLTextureRenderTarget(gpu,
|
||||
sampleCount,
|
||||
texDesc,
|
||||
std::move(parameters),
|
||||
rtIDs,
|
||||
cacheable,
|
||||
mipmapStatus,
|
||||
/*label=*/{}));
|
||||
return sk_sp<GrGLTextureRenderTarget>(
|
||||
new GrGLTextureRenderTarget(gpu,
|
||||
sampleCount,
|
||||
texDesc,
|
||||
std::move(parameters),
|
||||
rtIDs,
|
||||
cacheable,
|
||||
mipmapStatus,
|
||||
/*label=*/"GLTextureRenderTargetMakeWrapped"));
|
||||
}
|
||||
|
||||
size_t GrGLTextureRenderTarget::onGpuMemorySize() const {
|
||||
|
@ -151,7 +151,8 @@ sk_sp<GrTexture> GrMockGpu::onCreateCompressedTexture(SkISize dimensions,
|
||||
NextInternalTextureID());
|
||||
|
||||
return sk_sp<GrTexture>(new GrMockTexture(
|
||||
this, budgeted, dimensions, isProtected, mipmapStatus, texInfo, /*label=*/{}));
|
||||
this, budgeted, dimensions, isProtected, mipmapStatus, texInfo,
|
||||
/*label=*/"MockGpu_CreateCompressedTexture"));
|
||||
}
|
||||
|
||||
sk_sp<GrTexture> GrMockGpu::onWrapBackendTexture(const GrBackendTexture& tex,
|
||||
@ -176,7 +177,7 @@ sk_sp<GrTexture> GrMockGpu::onWrapBackendTexture(const GrBackendTexture& tex,
|
||||
texInfo,
|
||||
wrapType,
|
||||
ioType,
|
||||
/*label=*/{}));
|
||||
/*label=*/"MockGpu_WrapBackendTexture"));
|
||||
}
|
||||
|
||||
sk_sp<GrTexture> GrMockGpu::onWrapCompressedBackendTexture(const GrBackendTexture& tex,
|
||||
@ -200,11 +201,16 @@ sk_sp<GrTexture> GrMockGpu::onWrapRenderableBackendTexture(const GrBackendTextur
|
||||
GrMockRenderTargetInfo rtInfo(texInfo.colorType(), NextInternalRenderTargetID());
|
||||
|
||||
auto isProtected = GrProtected(tex.isProtected());
|
||||
return sk_sp<GrTexture>(new GrMockTextureRenderTarget(this, tex.dimensions(), sampleCnt,
|
||||
isProtected, mipmapStatus, texInfo,
|
||||
rtInfo,
|
||||
cacheable,
|
||||
/*label=*/{}));
|
||||
return sk_sp<GrTexture>(
|
||||
new GrMockTextureRenderTarget(this,
|
||||
tex.dimensions(),
|
||||
sampleCnt,
|
||||
isProtected,
|
||||
mipmapStatus,
|
||||
texInfo,
|
||||
rtInfo,
|
||||
cacheable,
|
||||
/*label=*/"MockGpu_WrapRenderableBackendTexture"));
|
||||
}
|
||||
|
||||
sk_sp<GrRenderTarget> GrMockGpu::onWrapBackendRenderTarget(const GrBackendRenderTarget& rt) {
|
||||
@ -212,18 +218,22 @@ sk_sp<GrRenderTarget> GrMockGpu::onWrapBackendRenderTarget(const GrBackendRender
|
||||
SkAssertResult(rt.getMockRenderTargetInfo(&info));
|
||||
|
||||
auto isProtected = GrProtected(rt.isProtected());
|
||||
return sk_sp<GrRenderTarget>(new GrMockRenderTarget(this, GrMockRenderTarget::kWrapped,
|
||||
rt.dimensions(), rt.sampleCnt(),
|
||||
isProtected,
|
||||
info,
|
||||
/*label=*/{}));
|
||||
return sk_sp<GrRenderTarget>(
|
||||
new GrMockRenderTarget(this,
|
||||
GrMockRenderTarget::kWrapped,
|
||||
rt.dimensions(),
|
||||
rt.sampleCnt(),
|
||||
isProtected,
|
||||
info,
|
||||
/*label=*/"MockGpu_WrapBackendRenderTarget"));
|
||||
}
|
||||
|
||||
sk_sp<GrGpuBuffer> GrMockGpu::onCreateBuffer(size_t sizeInBytes,
|
||||
GrGpuBufferType type,
|
||||
GrAccessPattern accessPattern) {
|
||||
return sk_sp<GrGpuBuffer>(
|
||||
new GrMockBuffer(this, sizeInBytes, type, accessPattern, /*label=*/{}));
|
||||
new GrMockBuffer(this, sizeInBytes, type, accessPattern,
|
||||
/*label=*/"MockGpu_CreateBuffer"));
|
||||
}
|
||||
|
||||
sk_sp<GrAttachment> GrMockGpu::makeStencilAttachment(const GrBackendFormat& /*colorFormat*/,
|
||||
@ -233,7 +243,7 @@ sk_sp<GrAttachment> GrMockGpu::makeStencilAttachment(const GrBackendFormat& /*co
|
||||
dimensions,
|
||||
GrAttachment::UsageFlags::kStencilAttachment,
|
||||
numStencilSamples,
|
||||
/*label=*/{}));
|
||||
/*label=*/"MockGpu_MakeStencilAttachment"));
|
||||
}
|
||||
|
||||
GrBackendTexture GrMockGpu::onCreateBackendTexture(SkISize dimensions,
|
||||
|
@ -142,7 +142,8 @@ sk_sp<GrMtlAttachment> GrMtlAttachment::Make(GrMtlGpu* gpu,
|
||||
#endif
|
||||
|
||||
return sk_sp<GrMtlAttachment>(new GrMtlAttachment(gpu, dimensions, attachmentUsages,
|
||||
texture, budgeted, /*label=*/{}));
|
||||
texture, budgeted,
|
||||
/*label=*/"MakeMtlAttachment"));
|
||||
}
|
||||
|
||||
sk_sp<GrMtlAttachment> GrMtlAttachment::MakeWrapped(
|
||||
@ -153,7 +154,8 @@ sk_sp<GrMtlAttachment> GrMtlAttachment::MakeWrapped(
|
||||
GrWrapCacheable cacheable) {
|
||||
|
||||
return sk_sp<GrMtlAttachment>(new GrMtlAttachment(gpu, dimensions, attachmentUsages, texture,
|
||||
cacheable, /*label=*/{}));
|
||||
cacheable,
|
||||
/*label=*/"MtlAttachment_MakeWrapped"));
|
||||
}
|
||||
|
||||
GrMtlAttachment::~GrMtlAttachment() {
|
||||
|
@ -37,7 +37,8 @@ NSString* kBufferTypeNames[kGrGpuBufferTypeCount] = {
|
||||
|
||||
sk_sp<GrMtlBuffer> GrMtlBuffer::Make(GrMtlGpu* gpu, size_t size, GrGpuBufferType intendedType,
|
||||
GrAccessPattern accessPattern, const void* data) {
|
||||
sk_sp<GrMtlBuffer> buffer(new GrMtlBuffer(gpu, size, intendedType, accessPattern, /*label=*/{}));
|
||||
sk_sp<GrMtlBuffer> buffer(new GrMtlBuffer(gpu, size, intendedType, accessPattern,
|
||||
/*label=*/"MakeMtlBuffer"));
|
||||
if (data && !buffer->onUpdateData(data, size)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -616,7 +616,8 @@ sk_sp<GrTexture> GrMtlGpu::onCreateCompressedTexture(SkISize dimensions,
|
||||
: GrMipmapStatus::kNotAllocated;
|
||||
|
||||
auto tex = GrMtlTexture::MakeNewTexture(this, budgeted, dimensions, mtlPixelFormat,
|
||||
numMipLevels, mipmapStatus, /*label=*/{});
|
||||
numMipLevels, mipmapStatus,
|
||||
/*label=*/"MtlGpu_CreateCompressedTexture");
|
||||
if (!tex) {
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ sk_sp<GrMtlTexture> GrMtlTexture::MakeWrappedTexture(GrMtlGpu* gpu,
|
||||
: GrMipmapStatus::kNotAllocated;
|
||||
return sk_sp<GrMtlTexture>(
|
||||
new GrMtlTexture(gpu, kWrapped, dimensions, std::move(attachment), mipmapStatus,
|
||||
cacheable, ioType, /*label=*/{}));
|
||||
cacheable, ioType, /*label=*/"MtlTextureWrappedTexture"));
|
||||
}
|
||||
|
||||
GrMtlTexture::~GrMtlTexture() {
|
||||
|
@ -133,7 +133,8 @@ sk_sp<GrMtlTextureRenderTarget> GrMtlTextureRenderTarget::MakeWrappedTextureRend
|
||||
|
||||
return sk_sp<GrMtlTextureRenderTarget>(new GrMtlTextureRenderTarget(
|
||||
gpu, dimensions, std::move(textureAttachment), std::move(colorAttachment),
|
||||
std::move(resolveAttachment), mipmapStatus, cacheable, /*label=*/{}));
|
||||
std::move(resolveAttachment), mipmapStatus, cacheable,
|
||||
/*label=*/"MtlWrappedTextureRenderTarget"));
|
||||
}
|
||||
|
||||
size_t GrMtlTextureRenderTarget::onGpuMemorySize() const {
|
||||
|
@ -478,7 +478,7 @@ GR_DRAW_OP_TEST_DEFINE(NonAALatticeOp) {
|
||||
SkBackingFit::kExact,
|
||||
SkBudgeted::kYes,
|
||||
GrProtected::kNo,
|
||||
/*label=*/{});
|
||||
/*label=*/"LatticeOp");
|
||||
|
||||
do {
|
||||
if (random->nextBool()) {
|
||||
|
@ -94,7 +94,8 @@ GrSurfaceProxyView make_deferred_mask_texture_view(GrRecordingContext* rContext,
|
||||
|
||||
auto proxy =
|
||||
proxyProvider->createProxy(format, dimensions, GrRenderable::kNo, 1, GrMipmapped::kNo,
|
||||
fit, SkBudgeted::kYes, GrProtected::kNo, /*label=*/{});
|
||||
fit, SkBudgeted::kYes, GrProtected::kNo,
|
||||
/*label=*/"MakeDeferredMaskTextureView");
|
||||
return {std::move(proxy), kTopLeft_GrSurfaceOrigin, swizzle};
|
||||
}
|
||||
|
||||
|
@ -1410,7 +1410,7 @@ GR_DRAW_OP_TEST_DEFINE(TextureOpImpl) {
|
||||
fit,
|
||||
SkBudgeted::kNo,
|
||||
GrProtected::kNo,
|
||||
/*label=*/{},
|
||||
/*label=*/"TextureOp",
|
||||
GrInternalSurfaceFlags::kNone);
|
||||
|
||||
SkRect rect = GrTest::TestRect(random);
|
||||
|
@ -328,7 +328,8 @@ GrSurfaceProxyView render_sw_mask(GrRecordingContext* context,
|
||||
GrColorType::kAlpha_8);
|
||||
auto proxy = proxyProvider->createProxy(format, bounds.size(), GrRenderable::kNo, 1,
|
||||
GrMipmapped::kNo, SkBackingFit::kApprox,
|
||||
SkBudgeted::kYes, GrProtected::kNo, /*label=*/{});
|
||||
SkBudgeted::kYes, GrProtected::kNo,
|
||||
/*label=*/"ClipStack_RenderSwMask");
|
||||
|
||||
// Since this will be rendered on another thread, make a copy of the elements in case
|
||||
// the clip stack is modified on the main thread
|
||||
|
@ -150,7 +150,8 @@ sk_sp<GrVkBuffer> GrVkBuffer::Make(GrVkGpu* gpu,
|
||||
}
|
||||
|
||||
return sk_sp<GrVkBuffer>(new GrVkBuffer(
|
||||
gpu, size, bufferType, accessPattern, buffer, alloc, uniformDescSet, /*label=*/{}));
|
||||
gpu, size, bufferType, accessPattern, buffer, alloc, uniformDescSet,
|
||||
/*label=*/"MakeVkBuffer"));
|
||||
}
|
||||
|
||||
void GrVkBuffer::vkMap(size_t size) {
|
||||
|
@ -1121,7 +1121,7 @@ sk_sp<GrTexture> GrVkGpu::onCreateCompressedTexture(SkISize dimensions,
|
||||
numMipLevels,
|
||||
isProtected,
|
||||
mipmapStatus,
|
||||
/*label=*/{});
|
||||
/*label=*/"VkGpu_CreateCompressedTexture");
|
||||
if (!tex) {
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -170,7 +170,7 @@ sk_sp<GrVkImage> GrVkImage::Make(GrVkGpu* gpu,
|
||||
std::move(framebufferView),
|
||||
std::move(textureView),
|
||||
budgeted,
|
||||
/*label=*/{}));
|
||||
/*label=*/"MakeVkImage"));
|
||||
}
|
||||
|
||||
sk_sp<GrVkImage> GrVkImage::MakeWrapped(GrVkGpu* gpu,
|
||||
@ -203,7 +203,7 @@ sk_sp<GrVkImage> GrVkImage::MakeWrapped(GrVkGpu* gpu,
|
||||
backendOwnership,
|
||||
cacheable,
|
||||
forSecondaryCB,
|
||||
/*label=*/{}));
|
||||
/*label=*/"VkImageMakeWrapped"));
|
||||
}
|
||||
|
||||
GrVkImage::GrVkImage(GrVkGpu* gpu,
|
||||
|
@ -163,7 +163,7 @@ sk_sp<GrVkRenderTarget> GrVkRenderTarget::MakeWrappedRenderTarget(
|
||||
std::move(colorAttachment),
|
||||
nullptr,
|
||||
CreateType::kDirectlyWrapped,
|
||||
/*label=*/{});
|
||||
/*label=*/"Vk_MakeWrappedRenderTarget");
|
||||
return sk_sp<GrVkRenderTarget>(vkRT);
|
||||
}
|
||||
|
||||
@ -211,7 +211,8 @@ sk_sp<GrVkRenderTarget> GrVkRenderTarget::MakeSecondaryCBRenderTarget(
|
||||
std::move(scb)));
|
||||
|
||||
GrVkRenderTarget* vkRT =
|
||||
new GrVkRenderTarget(gpu, dimensions, std::move(framebuffer), /*label=*/{});
|
||||
new GrVkRenderTarget(gpu, dimensions, std::move(framebuffer),
|
||||
/*label=*/"Vk_MakeSecondaryCBRenderTarget");
|
||||
|
||||
return sk_sp<GrVkRenderTarget>(vkRT);
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ sk_sp<GrVkTexture> GrVkTexture::MakeWrappedTexture(
|
||||
cacheable,
|
||||
ioType,
|
||||
isExternal,
|
||||
/*label=*/{}));
|
||||
/*label=*/"Vk_MakeWrappedTexture"));
|
||||
}
|
||||
|
||||
GrVkTexture::~GrVkTexture() {
|
||||
|
@ -159,14 +159,15 @@ sk_sp<GrVkTextureRenderTarget> GrVkTextureRenderTarget::MakeWrappedTextureRender
|
||||
GrMipmapStatus mipmapStatus =
|
||||
info.fLevelCount > 1 ? GrMipmapStatus::kDirty : GrMipmapStatus::kNotAllocated;
|
||||
|
||||
return sk_sp<GrVkTextureRenderTarget>(new GrVkTextureRenderTarget(gpu,
|
||||
dimensions,
|
||||
std::move(texture),
|
||||
std::move(colorAttachment),
|
||||
std::move(resolveAttachment),
|
||||
mipmapStatus,
|
||||
cacheable,
|
||||
/*label=*/{}));
|
||||
return sk_sp<GrVkTextureRenderTarget>(
|
||||
new GrVkTextureRenderTarget(gpu,
|
||||
dimensions,
|
||||
std::move(texture),
|
||||
std::move(colorAttachment),
|
||||
std::move(resolveAttachment),
|
||||
mipmapStatus,
|
||||
cacheable,
|
||||
/*label=*/"Vk_MakeWrappedTextureRenderTarget"));
|
||||
}
|
||||
|
||||
size_t GrVkTextureRenderTarget::onGpuMemorySize() const {
|
||||
|
@ -31,7 +31,8 @@ static sk_sp<GrSurfaceProxy> create_proxy(GrRecordingContext* rContext) {
|
||||
GrRenderable::kYes);
|
||||
return rContext->priv().proxyProvider()->createProxy(
|
||||
format, kDimensions, GrRenderable::kYes, 1, GrMipmapped::kNo, SkBackingFit::kExact,
|
||||
SkBudgeted::kNo, GrProtected::kNo, /*label=*/{}, GrInternalSurfaceFlags::kNone);
|
||||
SkBudgeted::kNo, GrProtected::kNo, /*label=*/"CreateSurfaceProxy",
|
||||
GrInternalSurfaceFlags::kNone);
|
||||
}
|
||||
|
||||
typedef GrQuadAAFlags (*PerQuadAAFunc)(int i);
|
||||
|
@ -384,7 +384,7 @@ static std::unique_ptr<skgpu::v1::SurfaceDrawContext> draw_mipmap_into_new_rende
|
||||
SkBackingFit::kApprox,
|
||||
SkBudgeted::kYes,
|
||||
GrProtected::kNo,
|
||||
/*label=*/{});
|
||||
/*label=*/"DrawMipMapViewTest");
|
||||
|
||||
auto sdc = skgpu::v1::SurfaceDrawContext::Make(rContext,
|
||||
colorType,
|
||||
@ -440,7 +440,7 @@ DEF_GPUTEST(GrManyDependentsMipMappedTest, reporter, /* options */) {
|
||||
|
||||
sk_sp<GrTextureProxy> mipmapProxy = proxyProvider->createProxy(
|
||||
format, {4, 4}, GrRenderable::kYes, 1, GrMipmapped::kYes, SkBackingFit::kExact,
|
||||
SkBudgeted::kYes, GrProtected::kNo,/*label=*/{});
|
||||
SkBudgeted::kYes, GrProtected::kNo,/*label=*/"ManyDependentsMipMappedTest");
|
||||
|
||||
// Mark the mipmaps clean to ensure things still work properly when they won't be marked
|
||||
// dirty again until GrRenderTask::makeClosed().
|
||||
|
@ -17,7 +17,8 @@ static void make_proxies(int count, SkTArray<sk_sp<GrSurfaceProxy>>* proxies) {
|
||||
proxies->reset(count);
|
||||
for (int i = 0; i < count; i++) {
|
||||
auto name = SkStringPrintf("%c", 'A' + i);
|
||||
proxies->at(i) = sk_make_sp<GrMockSurfaceProxy>(std::move(name), /*label=*/"");
|
||||
proxies->at(i) = sk_make_sp<GrMockSurfaceProxy>(std::move(name),
|
||||
/*label=*/"RenderTaskClusterTest");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ DEF_GPUTEST_FOR_METAL_CONTEXT(MtlCopySurfaceTest, reporter, ctxInfo) {
|
||||
sk_sp<GrTexture> dst =
|
||||
gpu->createTexture({kWidth, kHeight}, backendFormat, GrTextureType::k2D,
|
||||
GrRenderable::kNo, 1, GrMipmapped::kNo, SkBudgeted::kNo,
|
||||
GrProtected::kNo, /*label=*/{});
|
||||
GrProtected::kNo, /*label=*/"MtlCopySurfaceTest");
|
||||
|
||||
bool result = gpu->copySurface(dst.get(), src, SkIRect::MakeXYWH(0, 0, kWidth, kHeight),
|
||||
SkIPoint::Make(0, 0));
|
||||
|
@ -183,7 +183,8 @@ DEF_GPUTEST(OpChainTest, reporter, /*ctxInfo*/) {
|
||||
static const GrSurfaceOrigin kOrigin = kTopLeft_GrSurfaceOrigin;
|
||||
auto proxy = dContext->priv().proxyProvider()->createProxy(
|
||||
format, kDims, GrRenderable::kYes, 1, GrMipmapped::kNo, SkBackingFit::kExact,
|
||||
SkBudgeted::kNo, GrProtected::kNo, /*label=*/{}, GrInternalSurfaceFlags::kNone);
|
||||
SkBudgeted::kNo, GrProtected::kNo, /*label=*/"OpChainTest",
|
||||
GrInternalSurfaceFlags::kNone);
|
||||
SkASSERT(proxy);
|
||||
proxy->instantiate(dContext->priv().resourceProvider());
|
||||
|
||||
|
@ -161,9 +161,16 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(ProcessorRefTest, reporter, ctxInfo) {
|
||||
dContext, GrColorType::kRGBA_8888, nullptr, SkBackingFit::kApprox, {1, 1},
|
||||
SkSurfaceProps());
|
||||
{
|
||||
sk_sp<GrTextureProxy> proxy = proxyProvider->createProxy(
|
||||
format, kDims, GrRenderable::kNo, 1, GrMipmapped::kNo, SkBackingFit::kExact,
|
||||
SkBudgeted::kYes, GrProtected::kNo, /*label=*/{});
|
||||
sk_sp<GrTextureProxy> proxy =
|
||||
proxyProvider->createProxy(format,
|
||||
kDims,
|
||||
GrRenderable::kNo,
|
||||
1,
|
||||
GrMipmapped::kNo,
|
||||
SkBackingFit::kExact,
|
||||
SkBudgeted::kYes,
|
||||
GrProtected::kNo,
|
||||
/*label=*/"ProcessorRefTest");
|
||||
|
||||
{
|
||||
SkTArray<GrSurfaceProxyView> views;
|
||||
|
@ -254,7 +254,8 @@ bool GrDrawingManager::ProgramUnitTest(GrDirectContext* direct, int maxStages, i
|
||||
GrRenderable::kYes);
|
||||
auto proxy = proxyProvider->createProxy(format, kDims, GrRenderable::kYes, 1,
|
||||
mipmapped, SkBackingFit::kExact, SkBudgeted::kNo,
|
||||
GrProtected::kNo, /*label=*/{}, GrInternalSurfaceFlags::kNone);
|
||||
GrProtected::kNo, /*label=*/{},
|
||||
GrInternalSurfaceFlags::kNone);
|
||||
skgpu::Swizzle swizzle = caps->getReadSwizzle(format, GrColorType::kRGBA_8888);
|
||||
views[0] = {{std::move(proxy), kBottomLeft_GrSurfaceOrigin, swizzle},
|
||||
GrColorType::kRGBA_8888, kPremul_SkAlphaType};
|
||||
@ -265,7 +266,8 @@ bool GrDrawingManager::ProgramUnitTest(GrDirectContext* direct, int maxStages, i
|
||||
GrRenderable::kNo);
|
||||
auto proxy = proxyProvider->createProxy(format, kDims, GrRenderable::kNo, 1, mipmapped,
|
||||
SkBackingFit::kExact, SkBudgeted::kNo,
|
||||
GrProtected::kNo, /*label=*/{}, GrInternalSurfaceFlags::kNone);
|
||||
GrProtected::kNo, /*label=*/{},
|
||||
GrInternalSurfaceFlags::kNone);
|
||||
skgpu::Swizzle swizzle = caps->getReadSwizzle(format, GrColorType::kAlpha_8);
|
||||
views[1] = {{std::move(proxy), kTopLeft_GrSurfaceOrigin, swizzle},
|
||||
GrColorType::kAlpha_8, kPremul_SkAlphaType};
|
||||
|
@ -303,15 +303,16 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(PromiseImageTextureFullCache, reporter, ctxIn
|
||||
for (int i = 0; i < 5; ++i) {
|
||||
auto format = dContext->priv().caps()->getDefaultBackendFormat(GrColorType::kRGBA_8888,
|
||||
GrRenderable::kNo);
|
||||
textures.emplace_back(dContext->priv().resourceProvider()->createTexture({100, 100},
|
||||
format,
|
||||
GrTextureType::k2D,
|
||||
GrRenderable::kNo,
|
||||
1,
|
||||
GrMipmapped::kNo,
|
||||
SkBudgeted::kYes,
|
||||
GrProtected::kNo,
|
||||
/*label=*/{}));
|
||||
textures.emplace_back(dContext->priv().resourceProvider()->createTexture(
|
||||
{100, 100},
|
||||
format,
|
||||
GrTextureType::k2D,
|
||||
GrRenderable::kNo,
|
||||
1,
|
||||
GrMipmapped::kNo,
|
||||
SkBudgeted::kYes,
|
||||
GrProtected::kNo,
|
||||
/*label=*/"PromiseImageTextureFullCacheTest"));
|
||||
REPORTER_ASSERT(reporter, textures[i]);
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ static sk_sp<GrTextureProxy> make_deferred(GrRecordingContext* rContext) {
|
||||
GrRenderable::kYes);
|
||||
return proxyProvider->createProxy(format, {kWidthHeight, kWidthHeight}, GrRenderable::kYes, 1,
|
||||
GrMipmapped::kNo, SkBackingFit::kApprox, SkBudgeted::kYes,
|
||||
GrProtected::kNo, /*label=*/{});
|
||||
GrProtected::kNo, /*label=*/"ProxyRefTest");
|
||||
}
|
||||
|
||||
static sk_sp<GrTextureProxy> make_wrapped(GrRecordingContext* rContext) {
|
||||
|
@ -64,7 +64,7 @@ static sk_sp<GrSurfaceProxy> make_deferred(GrProxyProvider* proxyProvider, const
|
||||
const GrBackendFormat format = caps->getDefaultBackendFormat(p.fColorType, p.fRenderable);
|
||||
return proxyProvider->createProxy(format, {p.fSize, p.fSize}, p.fRenderable, p.fSampleCnt,
|
||||
GrMipmapped::kNo, p.fFit, p.fBudgeted, GrProtected::kNo,
|
||||
/*label=*/{});
|
||||
/*label=*/"ResourceAllocatorTest_Deffered");
|
||||
}
|
||||
|
||||
static sk_sp<GrSurfaceProxy> make_backend(GrDirectContext* dContext, const ProxyParams& p) {
|
||||
@ -99,7 +99,7 @@ static sk_sp<GrSurfaceProxy> make_fully_lazy(GrProxyProvider* proxyProvider, con
|
||||
desc.fMipmapped,
|
||||
desc.fBudgeted,
|
||||
desc.fProtected,
|
||||
/*label=*/{});
|
||||
/*label=*/"ResourceAllocatorTest_FullLazy");
|
||||
return GrSurfaceProxy::LazyCallbackResult(std::move(tex));
|
||||
};
|
||||
return GrProxyProvider::MakeFullyLazyProxy(std::move(cb), format, p.fRenderable, p.fSampleCnt,
|
||||
@ -119,7 +119,7 @@ static sk_sp<GrSurfaceProxy> make_lazy(GrProxyProvider* proxyProvider, const GrC
|
||||
desc.fMipmapped,
|
||||
desc.fBudgeted,
|
||||
desc.fProtected,
|
||||
/*label=*/{});
|
||||
/*label=*/"ResourceAllocatorTest_Lazy");
|
||||
return GrSurfaceProxy::LazyCallbackResult(std::move(tex));
|
||||
};
|
||||
return proxyProvider->createLazyProxy(std::move(cb), format, {p.fSize, p.fSize},
|
||||
|
@ -86,7 +86,7 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(TextureBindingsResetTest, reporter, ctxInf
|
||||
GrMipmapped::kNo,
|
||||
SkBudgeted::kNo,
|
||||
GrProtected::kNo,
|
||||
/*label=*/{});
|
||||
/*label=*/"TextureBindingsResetTest");
|
||||
REPORTER_ASSERT(reporter, tex);
|
||||
dContext->resetGLTextureBindings();
|
||||
checkBindings();
|
||||
|
@ -46,7 +46,8 @@ static sk_sp<GrSurfaceProxy> create_proxy(GrRecordingContext* rContext) {
|
||||
GrRenderable::kYes);
|
||||
return rContext->priv().proxyProvider()->createProxy(
|
||||
format, kDimensions, GrRenderable::kYes, 1, GrMipmapped::kNo, SkBackingFit::kExact,
|
||||
SkBudgeted::kNo, GrProtected::kNo, /*label=*/{},GrInternalSurfaceFlags::kNone);
|
||||
SkBudgeted::kNo, GrProtected::kNo, /*label=*/"TextureOpTest",
|
||||
GrInternalSurfaceFlags::kNone);
|
||||
}
|
||||
|
||||
static GrOp::Owner create_op(GrDirectContext* dContext, SkRect rect,
|
||||
|
@ -98,7 +98,8 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SkTraceMemoryDump_ownedGLTexture, reporter
|
||||
desc.fSize = SkISize::Make(64, 64);
|
||||
|
||||
auto texture = sk_make_sp<GrGLTexture>(
|
||||
gpu, SkBudgeted::kNo, desc, GrMipmapStatus::kNotAllocated, /*label=*/"");
|
||||
gpu, SkBudgeted::kNo, desc, GrMipmapStatus::kNotAllocated,
|
||||
/*label=*/"SkTraceMemoryDump_ownedGLTexture");
|
||||
|
||||
ValidateMemoryDumps(reporter, dContext, 2, texture->gpuMemorySize(), true /* isOwned */);
|
||||
}
|
||||
@ -183,7 +184,8 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SkTraceMemoryDump_ownedGLTextureRenderTarg
|
||||
rtIDs.fTotalMemorySamplesPerPixel = 9;
|
||||
|
||||
auto texRT = sk_make_sp<GrGLTextureRenderTarget>(
|
||||
gpu, SkBudgeted::kYes, 8, texDesc, rtIDs, GrMipmapStatus::kNotAllocated, /*label=*/"");
|
||||
gpu, SkBudgeted::kYes, 8, texDesc, rtIDs, GrMipmapStatus::kNotAllocated,
|
||||
/*label=*/"SkTraceMemoryDump_ownedGLTextureRenderTarget");
|
||||
|
||||
ValidateMemoryDumps(reporter, dContext, 3, texRT->gpuMemorySize(), true /* isOwned */);
|
||||
}
|
||||
|
@ -535,7 +535,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WritePixelsPendingIO, reporter, ctxInfo) {
|
||||
|
||||
sk_sp<GrTextureProxy> temp = proxyProvider->createProxy(
|
||||
format, kDims, GrRenderable::kNo, 1, GrMipmapped::kNo, SkBackingFit::kApprox,
|
||||
SkBudgeted::kYes, GrProtected::kNo, /*label=*/{});
|
||||
SkBudgeted::kYes, GrProtected::kNo, /*label=*/"WritePixelsTest");
|
||||
temp->instantiate(context->priv().resourceProvider());
|
||||
}
|
||||
|
||||
|
@ -179,17 +179,18 @@ static bool setup_backend_objects(GrDirectContext* dContext,
|
||||
GrMipLevel level0 = {data.get(), offscreenDims.width()*sizeof(uint32_t), nullptr};
|
||||
|
||||
constexpr int kSampleCnt = 0;
|
||||
sk_sp<GrTexture> tmp = resourceProvider->createTexture(offscreenDims,
|
||||
renderableFormat,
|
||||
GrTextureType::k2D,
|
||||
GrColorType::kRGBA_8888,
|
||||
GrRenderable::kYes,
|
||||
kSampleCnt,
|
||||
SkBudgeted::kNo,
|
||||
GrMipmapped::kNo,
|
||||
GrProtected::kNo,
|
||||
&level0,
|
||||
/*label=*/{});
|
||||
sk_sp<GrTexture> tmp =
|
||||
resourceProvider->createTexture(offscreenDims,
|
||||
renderableFormat,
|
||||
GrTextureType::k2D,
|
||||
GrColorType::kRGBA_8888,
|
||||
GrRenderable::kYes,
|
||||
kSampleCnt,
|
||||
SkBudgeted::kNo,
|
||||
GrMipmapped::kNo,
|
||||
GrProtected::kNo,
|
||||
&level0,
|
||||
/*label=*/"Fiddle_SetupBackendObjects");
|
||||
if (!tmp || !tmp->asRenderTarget()) {
|
||||
fputs("GrTexture is invalid.\n", stderr);
|
||||
return false;
|
||||
|
@ -77,7 +77,7 @@ GrSurfaceProxyView MakeTextureProxyViewFromData(GrDirectContext* dContext,
|
||||
SkBackingFit::kExact,
|
||||
SkBudgeted::kYes,
|
||||
GrProtected::kNo,
|
||||
/*label=*/{});
|
||||
/*label=*/"TextureProxyViewFromData");
|
||||
if (!proxy) {
|
||||
return {};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user