Plumb label through createTextureCommon.
In this CL, the labels will be plumbed through createTextureCommon, into onCreateTexture, and then passed to the various Gr*Textures constructors. Bug: chromium:1164111 Plumb label from GrGpu's createTexture function. In this CL, GrResourceProvider's functions, like createTexture etc, get label string passed to it which are called from GrGpu which then passes the label to setLabel method of GrGpuResource by making use of intermediate GrGpuResourcePriv class. Bug: chromium:1164111 Change-Id: I068a4b4bf3db8efa099bf742efce592f73a3008a Reviewed-on: https://skia-review.googlesource.com/c/skia/+/536879 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
This commit is contained in:
parent
9a393dd52b
commit
1fb7b3d701
@ -103,7 +103,8 @@ sk_sp<GrTexture> GrGpu::createTextureCommon(SkISize dimensions,
|
||||
SkBudgeted budgeted,
|
||||
GrProtected isProtected,
|
||||
int mipLevelCount,
|
||||
uint32_t levelClearMask) {
|
||||
uint32_t levelClearMask,
|
||||
std::string_view label) {
|
||||
if (this->caps()->isFormatCompressed(format)) {
|
||||
// Call GrGpu::createCompressedTexture.
|
||||
return nullptr;
|
||||
@ -133,7 +134,8 @@ sk_sp<GrTexture> GrGpu::createTextureCommon(SkISize dimensions,
|
||||
budgeted,
|
||||
isProtected,
|
||||
mipLevelCount,
|
||||
levelClearMask);
|
||||
levelClearMask,
|
||||
label);
|
||||
if (tex) {
|
||||
SkASSERT(tex->backendFormat() == format);
|
||||
SkASSERT(GrRenderable::kNo == renderable || tex->asRenderTarget());
|
||||
@ -173,17 +175,12 @@ sk_sp<GrTexture> GrGpu::createTexture(SkISize dimensions,
|
||||
budgeted,
|
||||
isProtected,
|
||||
mipLevelCount,
|
||||
levelClearMask);
|
||||
levelClearMask,
|
||||
label);
|
||||
if (tex && mipmapped == GrMipmapped::kYes && levelClearMask) {
|
||||
tex->markMipmapsClean();
|
||||
}
|
||||
|
||||
// TODO: plumb label through createTextureCommon to be finally passed to various Gr*Texture
|
||||
// constructors.
|
||||
if (tex) {
|
||||
tex->setLabel(label);
|
||||
}
|
||||
|
||||
return tex;
|
||||
}
|
||||
|
||||
@ -229,7 +226,8 @@ sk_sp<GrTexture> GrGpu::createTexture(SkISize dimensions,
|
||||
budgeted,
|
||||
isProtected,
|
||||
texelLevelCount,
|
||||
levelClearMask);
|
||||
levelClearMask,
|
||||
label);
|
||||
if (tex) {
|
||||
bool markMipLevelsClean = false;
|
||||
// Currently if level 0 does not have pixels then no other level may, as enforced by
|
||||
@ -253,9 +251,6 @@ sk_sp<GrTexture> GrGpu::createTexture(SkISize dimensions,
|
||||
if (markMipLevelsClean) {
|
||||
tex->markMipmapsClean();
|
||||
}
|
||||
// TODO: plumb label through createTextureCommon to be finally passed to various Gr*Texture
|
||||
// constructors.
|
||||
tex->setLabel(label);
|
||||
}
|
||||
return tex;
|
||||
}
|
||||
|
@ -702,7 +702,8 @@ private:
|
||||
SkBudgeted,
|
||||
GrProtected,
|
||||
int mipLevelCoont,
|
||||
uint32_t levelClearMask) = 0;
|
||||
uint32_t levelClearMask,
|
||||
std::string_view label) = 0;
|
||||
virtual sk_sp<GrTexture> onCreateCompressedTexture(SkISize dimensions,
|
||||
const GrBackendFormat&,
|
||||
SkBudgeted,
|
||||
@ -806,7 +807,8 @@ private:
|
||||
SkBudgeted,
|
||||
GrProtected,
|
||||
int mipLevelCnt,
|
||||
uint32_t levelClearMask);
|
||||
uint32_t levelClearMask,
|
||||
std::string_view label);
|
||||
|
||||
void resetContext() {
|
||||
this->onResetContext(fResetBits);
|
||||
|
@ -259,7 +259,8 @@ sk_sp<GrD3DTexture> GrD3DGpu::createD3DTexture(SkISize dimensions,
|
||||
SkBudgeted budgeted,
|
||||
GrProtected isProtected,
|
||||
int mipLevelCount,
|
||||
GrMipmapStatus mipmapStatus) {
|
||||
GrMipmapStatus mipmapStatus,
|
||||
std::string_view label) {
|
||||
D3D12_RESOURCE_FLAGS usageFlags = D3D12_RESOURCE_FLAG_NONE;
|
||||
if (renderable == GrRenderable::kYes) {
|
||||
usageFlags |= D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET;
|
||||
@ -287,10 +288,10 @@ sk_sp<GrD3DTexture> GrD3DGpu::createD3DTexture(SkISize dimensions,
|
||||
if (renderable == GrRenderable::kYes) {
|
||||
return GrD3DTextureRenderTarget::MakeNewTextureRenderTarget(
|
||||
this, budgeted, dimensions, renderTargetSampleCnt, resourceDesc, isProtected,
|
||||
mipmapStatus);
|
||||
mipmapStatus, label);
|
||||
} else {
|
||||
return GrD3DTexture::MakeNewTexture(this, budgeted, dimensions, resourceDesc, isProtected,
|
||||
mipmapStatus);
|
||||
mipmapStatus, label);
|
||||
}
|
||||
}
|
||||
|
||||
@ -301,7 +302,8 @@ sk_sp<GrTexture> GrD3DGpu::onCreateTexture(SkISize dimensions,
|
||||
SkBudgeted budgeted,
|
||||
GrProtected isProtected,
|
||||
int mipLevelCount,
|
||||
uint32_t levelClearMask) {
|
||||
uint32_t levelClearMask,
|
||||
std::string_view label) {
|
||||
DXGI_FORMAT dxgiFormat;
|
||||
SkAssertResult(format.asDxgiFormat(&dxgiFormat));
|
||||
SkASSERT(!GrDxgiFormatIsCompressed(dxgiFormat));
|
||||
@ -311,7 +313,7 @@ sk_sp<GrTexture> GrD3DGpu::onCreateTexture(SkISize dimensions,
|
||||
|
||||
sk_sp<GrD3DTexture> tex = this->createD3DTexture(dimensions, dxgiFormat, renderable,
|
||||
renderTargetSampleCnt, budgeted, isProtected,
|
||||
mipLevelCount, mipmapStatus);
|
||||
mipLevelCount, mipmapStatus, label);
|
||||
if (!tex) {
|
||||
return nullptr;
|
||||
}
|
||||
@ -363,9 +365,15 @@ 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);
|
||||
sk_sp<GrD3DTexture> d3dTex = this->createD3DTexture(dimensions,
|
||||
dxgiFormat,
|
||||
GrRenderable::kNo,
|
||||
1,
|
||||
budgeted,
|
||||
isProtected,
|
||||
mipLevelCount,
|
||||
mipmapStatus,
|
||||
/*label=*/{});
|
||||
if (!d3dTex) {
|
||||
return nullptr;
|
||||
}
|
||||
@ -1089,8 +1097,13 @@ bool GrD3DGpu::onRegenerateMipMapLevels(GrTexture * tex) {
|
||||
}
|
||||
// TODO: make this a scratch texture
|
||||
GrProtected grProtected = tex->isProtected() ? GrProtected::kYes : GrProtected::kNo;
|
||||
uavTexture = GrD3DTexture::MakeNewTexture(this, SkBudgeted::kNo, tex->dimensions(),
|
||||
uavDesc, grProtected, GrMipmapStatus::kDirty);
|
||||
uavTexture = GrD3DTexture::MakeNewTexture(this,
|
||||
SkBudgeted::kNo,
|
||||
tex->dimensions(),
|
||||
uavDesc,
|
||||
grProtected,
|
||||
GrMipmapStatus::kDirty,
|
||||
/*label=*/{});
|
||||
if (!uavTexture) {
|
||||
return false;
|
||||
}
|
||||
|
@ -138,7 +138,8 @@ private:
|
||||
SkBudgeted,
|
||||
GrProtected,
|
||||
int mipLevelCount,
|
||||
uint32_t levelClearMask) override;
|
||||
uint32_t levelClearMask,
|
||||
std::string_view label) override;
|
||||
|
||||
sk_sp<GrTexture> onCreateCompressedTexture(SkISize dimensions,
|
||||
const GrBackendFormat&,
|
||||
@ -264,7 +265,8 @@ private:
|
||||
SkBudgeted,
|
||||
GrProtected,
|
||||
int mipLevelCount,
|
||||
GrMipmapStatus);
|
||||
GrMipmapStatus,
|
||||
std::string_view label);
|
||||
|
||||
bool uploadToTexture(GrD3DTexture* tex,
|
||||
SkIRect rect,
|
||||
|
@ -69,7 +69,8 @@ sk_sp<GrD3DTexture> GrD3DTexture::MakeNewTexture(GrD3DGpu* gpu, SkBudgeted budge
|
||||
SkISize dimensions,
|
||||
const D3D12_RESOURCE_DESC& desc,
|
||||
GrProtected isProtected,
|
||||
GrMipmapStatus mipmapStatus) {
|
||||
GrMipmapStatus mipmapStatus,
|
||||
std::string_view label) {
|
||||
GrD3DTextureResourceInfo info;
|
||||
if (!GrD3DTextureResource::InitTextureResourceInfo(gpu, desc,
|
||||
D3D12_RESOURCE_STATE_COPY_DEST,
|
||||
@ -86,7 +87,7 @@ sk_sp<GrD3DTexture> GrD3DTexture::MakeNewTexture(GrD3DGpu* gpu, SkBudgeted budge
|
||||
GrD3DTexture* tex = new GrD3DTexture(gpu, budgeted, dimensions, info, std::move(state),
|
||||
shaderResourceView,
|
||||
mipmapStatus,
|
||||
/*label=*/{});
|
||||
label);
|
||||
|
||||
return sk_sp<GrD3DTexture>(tex);
|
||||
}
|
||||
|
@ -21,7 +21,8 @@ public:
|
||||
SkISize dimensions,
|
||||
const D3D12_RESOURCE_DESC&,
|
||||
GrProtected,
|
||||
GrMipmapStatus);
|
||||
GrMipmapStatus,
|
||||
std::string_view label);
|
||||
|
||||
static sk_sp<GrD3DTexture> MakeWrappedTexture(GrD3DGpu*,
|
||||
SkISize dimensions,
|
||||
|
@ -109,7 +109,8 @@ sk_sp<GrD3DTextureRenderTarget> GrD3DTextureRenderTarget::MakeNewTextureRenderTa
|
||||
int sampleCnt,
|
||||
const D3D12_RESOURCE_DESC& resourceDesc,
|
||||
GrProtected isProtected,
|
||||
GrMipmapStatus mipmapStatus) {
|
||||
GrMipmapStatus mipmapStatus,
|
||||
std::string_view label) {
|
||||
|
||||
GrD3DTextureResourceInfo info;
|
||||
D3D12_RESOURCE_STATES initialState = sampleCnt > 1 ? D3D12_RESOURCE_STATE_RESOLVE_DEST
|
||||
@ -157,7 +158,7 @@ sk_sp<GrD3DTextureRenderTarget> GrD3DTextureRenderTarget::MakeNewTextureRenderTa
|
||||
msaaRenderTargetView,
|
||||
renderTargetView,
|
||||
mipmapStatus,
|
||||
/*label=*/{});
|
||||
label);
|
||||
return sk_sp<GrD3DTextureRenderTarget>(trt);
|
||||
} else {
|
||||
GrD3DTextureRenderTarget* trt = new GrD3DTextureRenderTarget(gpu,
|
||||
@ -168,7 +169,7 @@ sk_sp<GrD3DTextureRenderTarget> GrD3DTextureRenderTarget::MakeNewTextureRenderTa
|
||||
shaderResourceView,
|
||||
renderTargetView,
|
||||
mipmapStatus,
|
||||
/*label=*/{});
|
||||
label);
|
||||
return sk_sp<GrD3DTextureRenderTarget>(trt);
|
||||
}
|
||||
}
|
||||
|
@ -30,7 +30,8 @@ public:
|
||||
int sampleCnt,
|
||||
const D3D12_RESOURCE_DESC&,
|
||||
GrProtected isProtected,
|
||||
GrMipmapStatus);
|
||||
GrMipmapStatus,
|
||||
std::string_view label);
|
||||
|
||||
static sk_sp<GrD3DTextureRenderTarget> MakeWrappedTextureRenderTarget(
|
||||
GrD3DGpu*, SkISize dimensions, int sampleCnt, GrWrapCacheable,
|
||||
|
@ -235,7 +235,8 @@ sk_sp<GrTexture> GrDawnGpu::onCreateTexture(SkISize dimensions,
|
||||
SkBudgeted budgeted,
|
||||
GrProtected,
|
||||
int mipLevelCount,
|
||||
uint32_t levelClearMask) {
|
||||
uint32_t levelClearMask,
|
||||
std::string_view label) {
|
||||
if (levelClearMask) {
|
||||
return nullptr;
|
||||
}
|
||||
@ -249,7 +250,7 @@ sk_sp<GrTexture> GrDawnGpu::onCreateTexture(SkISize dimensions,
|
||||
mipLevelCount > 1 ? GrMipmapStatus::kDirty : GrMipmapStatus::kNotAllocated;
|
||||
|
||||
return GrDawnTexture::Make(this, dimensions, format, renderable, renderTargetSampleCnt,
|
||||
budgeted, mipLevelCount, mipmapStatus);
|
||||
budgeted, mipLevelCount, mipmapStatus, label);
|
||||
}
|
||||
|
||||
sk_sp<GrTexture> GrDawnGpu::onCreateCompressedTexture(SkISize dimensions, const GrBackendFormat&,
|
||||
|
@ -118,7 +118,8 @@ private:
|
||||
SkBudgeted,
|
||||
GrProtected,
|
||||
int mipLevelCount,
|
||||
uint32_t levelClearMask) override;
|
||||
uint32_t levelClearMask,
|
||||
std::string_view label) override;
|
||||
|
||||
sk_sp<GrTexture> onCreateCompressedTexture(SkISize dimensions,
|
||||
const GrBackendFormat&,
|
||||
|
@ -20,11 +20,15 @@ GrDawnTexture::GrDawnTexture(GrDawnGpu* gpu,
|
||||
, GrTexture(gpu, dimensions, GrProtected::kNo, GrTextureType::k2D, mipmapStatus, label)
|
||||
, fInfo(info) {}
|
||||
|
||||
sk_sp<GrDawnTexture> GrDawnTexture::Make(GrDawnGpu* gpu, SkISize dimensions,
|
||||
sk_sp<GrDawnTexture> GrDawnTexture::Make(GrDawnGpu* gpu,
|
||||
SkISize dimensions,
|
||||
wgpu::TextureFormat format,
|
||||
GrRenderable renderable, int sampleCnt,
|
||||
SkBudgeted budgeted, int mipLevels,
|
||||
GrMipmapStatus status) {
|
||||
GrRenderable renderable,
|
||||
int sampleCnt,
|
||||
SkBudgeted budgeted,
|
||||
int mipLevels,
|
||||
GrMipmapStatus status,
|
||||
std::string_view label) {
|
||||
bool renderTarget = renderable == GrRenderable::kYes;
|
||||
wgpu::TextureDescriptor textureDesc;
|
||||
|
||||
@ -55,10 +59,10 @@ sk_sp<GrDawnTexture> GrDawnTexture::Make(GrDawnGpu* gpu, SkISize dimensions,
|
||||
sk_sp<GrDawnTexture> result;
|
||||
if (renderTarget) {
|
||||
result = sk_sp<GrDawnTextureRenderTarget>(new GrDawnTextureRenderTarget(
|
||||
gpu, dimensions, sampleCnt, info, status, /*label=*/{}));
|
||||
gpu, dimensions, sampleCnt, info, status, label));
|
||||
} else {
|
||||
result = sk_sp<GrDawnTexture>(
|
||||
new GrDawnTexture(gpu, dimensions, info, status, /*label=*/{}));
|
||||
new GrDawnTexture(gpu, dimensions, info, status, label));
|
||||
}
|
||||
result->registerWithCache(budgeted);
|
||||
return result;
|
||||
|
@ -15,9 +15,15 @@ class GrDawnGpu;
|
||||
|
||||
class GrDawnTexture : public GrTexture {
|
||||
public:
|
||||
static sk_sp<GrDawnTexture> Make(GrDawnGpu*, SkISize dimensions,
|
||||
wgpu::TextureFormat format, GrRenderable, int sampleCnt,
|
||||
SkBudgeted, int mipLevels, GrMipmapStatus);
|
||||
static sk_sp<GrDawnTexture> Make(GrDawnGpu*,
|
||||
SkISize dimensions,
|
||||
wgpu::TextureFormat format,
|
||||
GrRenderable,
|
||||
int sampleCnt,
|
||||
SkBudgeted,
|
||||
int mipLevels,
|
||||
GrMipmapStatus,
|
||||
std::string_view label);
|
||||
|
||||
static sk_sp<GrDawnTexture> MakeWrapped(GrDawnGpu*, SkISize dimensions, GrRenderable,
|
||||
int sampleCnt, GrWrapCacheable, GrIOType,
|
||||
|
@ -1387,7 +1387,8 @@ sk_sp<GrTexture> GrGLGpu::onCreateTexture(SkISize dimensions,
|
||||
SkBudgeted budgeted,
|
||||
GrProtected isProtected,
|
||||
int mipLevelCount,
|
||||
uint32_t levelClearMask) {
|
||||
uint32_t levelClearMask,
|
||||
std::string_view label) {
|
||||
// We don't support protected textures in GL.
|
||||
if (isProtected == GrProtected::kYes) {
|
||||
return nullptr;
|
||||
@ -1442,10 +1443,10 @@ sk_sp<GrTexture> GrGLGpu::onCreateTexture(SkISize dimensions,
|
||||
texDesc,
|
||||
rtIDDesc,
|
||||
mipmapStatus,
|
||||
/*label=*/"");
|
||||
label);
|
||||
tex->baseLevelWasBoundToFBO();
|
||||
} else {
|
||||
tex = sk_make_sp<GrGLTexture>(this, budgeted, texDesc, mipmapStatus, /*label=*/"");
|
||||
tex = sk_make_sp<GrGLTexture>(this, budgeted, texDesc, mipmapStatus, label);
|
||||
}
|
||||
// The non-sampler params are still at their default values.
|
||||
tex->parameters()->set(&initialState, GrGLTextureParameters::NonsamplerState(),
|
||||
|
@ -250,7 +250,8 @@ private:
|
||||
SkBudgeted,
|
||||
GrProtected,
|
||||
int mipLevelCount,
|
||||
uint32_t levelClearMask) override;
|
||||
uint32_t levelClearMask,
|
||||
std::string_view label) override;
|
||||
sk_sp<GrTexture> onCreateCompressedTexture(SkISize dimensions,
|
||||
const GrBackendFormat&,
|
||||
SkBudgeted,
|
||||
|
@ -98,7 +98,8 @@ sk_sp<GrTexture> GrMockGpu::onCreateTexture(SkISize dimensions,
|
||||
SkBudgeted budgeted,
|
||||
GrProtected isProtected,
|
||||
int mipLevelCount,
|
||||
uint32_t levelClearMask) {
|
||||
uint32_t levelClearMask,
|
||||
std::string_view label) {
|
||||
if (fMockOptions.fFailTextureAllocations) {
|
||||
return nullptr;
|
||||
}
|
||||
@ -119,10 +120,10 @@ sk_sp<GrTexture> GrMockGpu::onCreateTexture(SkISize dimensions,
|
||||
mipmapStatus,
|
||||
texInfo,
|
||||
rtInfo,
|
||||
/*label=*/{}));
|
||||
label));
|
||||
}
|
||||
return sk_sp<GrTexture>(new GrMockTexture(
|
||||
this, budgeted, dimensions, isProtected, mipmapStatus, texInfo, /*label=*/{}));
|
||||
this, budgeted, dimensions, isProtected, mipmapStatus, texInfo, label));
|
||||
}
|
||||
|
||||
// TODO: why no 'isProtected' ?!
|
||||
|
@ -62,7 +62,8 @@ private:
|
||||
SkBudgeted,
|
||||
GrProtected,
|
||||
int mipLevelCount,
|
||||
uint32_t levelClearMask) override;
|
||||
uint32_t levelClearMask,
|
||||
std::string_view label) override;
|
||||
|
||||
sk_sp<GrTexture> onCreateCompressedTexture(SkISize dimensions,
|
||||
const GrBackendFormat&,
|
||||
|
@ -162,7 +162,8 @@ private:
|
||||
SkBudgeted,
|
||||
GrProtected,
|
||||
int mipLevelCount,
|
||||
uint32_t levelClearMask) override;
|
||||
uint32_t levelClearMask,
|
||||
std::string_view label) override;
|
||||
sk_sp<GrTexture> onCreateCompressedTexture(SkISize dimensions,
|
||||
const GrBackendFormat&,
|
||||
SkBudgeted,
|
||||
|
@ -549,7 +549,8 @@ sk_sp<GrTexture> GrMtlGpu::onCreateTexture(SkISize dimensions,
|
||||
SkBudgeted budgeted,
|
||||
GrProtected isProtected,
|
||||
int mipLevelCount,
|
||||
uint32_t levelClearMask) {
|
||||
uint32_t levelClearMask,
|
||||
std::string_view label) {
|
||||
// We don't support protected textures in Metal.
|
||||
if (isProtected == GrProtected::kYes) {
|
||||
return nullptr;
|
||||
@ -566,10 +567,10 @@ sk_sp<GrTexture> GrMtlGpu::onCreateTexture(SkISize dimensions,
|
||||
if (renderable == GrRenderable::kYes) {
|
||||
tex = GrMtlTextureRenderTarget::MakeNewTextureRenderTarget(
|
||||
this, budgeted, dimensions, renderTargetSampleCnt, mtlPixelFormat, mipLevelCount,
|
||||
mipmapStatus);
|
||||
mipmapStatus, label);
|
||||
} else {
|
||||
tex = GrMtlTexture::MakeNewTexture(this, budgeted, dimensions, mtlPixelFormat,
|
||||
mipLevelCount, mipmapStatus);
|
||||
mipLevelCount, mipmapStatus, label);
|
||||
}
|
||||
|
||||
if (!tex) {
|
||||
@ -614,7 +615,7 @@ sk_sp<GrTexture> GrMtlGpu::onCreateCompressedTexture(SkISize dimensions,
|
||||
: GrMipmapStatus::kNotAllocated;
|
||||
|
||||
auto tex = GrMtlTexture::MakeNewTexture(this, budgeted, dimensions, mtlPixelFormat,
|
||||
numMipLevels, mipmapStatus);
|
||||
numMipLevels, mipmapStatus, /*label=*/{});
|
||||
if (!tex) {
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -21,7 +21,8 @@ public:
|
||||
SkISize dimensions,
|
||||
MTLPixelFormat format,
|
||||
uint32_t mipLevels,
|
||||
GrMipmapStatus);
|
||||
GrMipmapStatus,
|
||||
std::string_view label);
|
||||
|
||||
static sk_sp<GrMtlTexture> MakeWrappedTexture(GrMtlGpu*,
|
||||
SkISize,
|
||||
|
@ -82,7 +82,8 @@ sk_sp<GrMtlTexture> GrMtlTexture::MakeNewTexture(GrMtlGpu* gpu,
|
||||
SkISize dimensions,
|
||||
MTLPixelFormat format,
|
||||
uint32_t mipLevels,
|
||||
GrMipmapStatus mipmapStatus) {
|
||||
GrMipmapStatus mipmapStatus,
|
||||
std::string_view label) {
|
||||
sk_sp<GrMtlAttachment> texture = GrMtlAttachment::MakeTexture(
|
||||
gpu, dimensions, format, mipLevels, GrRenderable::kNo, /*numSamples=*/1, budgeted);
|
||||
|
||||
@ -90,7 +91,7 @@ sk_sp<GrMtlTexture> GrMtlTexture::MakeNewTexture(GrMtlGpu* gpu,
|
||||
return nullptr;
|
||||
}
|
||||
return sk_sp<GrMtlTexture>(new GrMtlTexture(gpu, budgeted, dimensions, std::move(texture),
|
||||
mipmapStatus, /*label=*/{}));
|
||||
mipmapStatus, label));
|
||||
}
|
||||
|
||||
sk_sp<GrMtlTexture> GrMtlTexture::MakeWrappedTexture(GrMtlGpu* gpu,
|
||||
|
@ -19,7 +19,8 @@ public:
|
||||
int sampleCnt,
|
||||
MTLPixelFormat,
|
||||
uint32_t mipLevels,
|
||||
GrMipmapStatus);
|
||||
GrMipmapStatus,
|
||||
std::string_view label);
|
||||
|
||||
static sk_sp<GrMtlTextureRenderTarget> MakeWrappedTextureRenderTarget(GrMtlGpu*,
|
||||
SkISize,
|
||||
|
@ -74,7 +74,8 @@ sk_sp<GrMtlTextureRenderTarget> GrMtlTextureRenderTarget::MakeNewTextureRenderTa
|
||||
int sampleCnt,
|
||||
MTLPixelFormat format,
|
||||
uint32_t mipLevels,
|
||||
GrMipmapStatus mipmapStatus) {
|
||||
GrMipmapStatus mipmapStatus,
|
||||
std::string_view label) {
|
||||
sk_sp<GrMtlAttachment> textureAttachment =
|
||||
GrMtlAttachment::MakeTexture(gpu, dimensions, format, mipLevels, GrRenderable::kYes,
|
||||
/*numSamples=*/1, budgeted);
|
||||
@ -97,7 +98,7 @@ sk_sp<GrMtlTextureRenderTarget> GrMtlTextureRenderTarget::MakeNewTextureRenderTa
|
||||
|
||||
return sk_sp<GrMtlTextureRenderTarget>(new GrMtlTextureRenderTarget(
|
||||
gpu, budgeted, dimensions, std::move(textureAttachment), std::move(colorAttachment),
|
||||
std::move(resolveAttachment), mipmapStatus, /*label=*/{}));
|
||||
std::move(resolveAttachment), mipmapStatus, label));
|
||||
}
|
||||
|
||||
sk_sp<GrMtlTextureRenderTarget> GrMtlTextureRenderTarget::MakeWrappedTextureRenderTarget(
|
||||
|
@ -1042,7 +1042,8 @@ sk_sp<GrTexture> GrVkGpu::onCreateTexture(SkISize dimensions,
|
||||
SkBudgeted budgeted,
|
||||
GrProtected isProtected,
|
||||
int mipLevelCount,
|
||||
uint32_t levelClearMask) {
|
||||
uint32_t levelClearMask,
|
||||
std::string_view label) {
|
||||
VkFormat pixelFormat;
|
||||
SkAssertResult(format.asVkFormat(&pixelFormat));
|
||||
SkASSERT(!GrVkFormatIsCompressed(pixelFormat));
|
||||
@ -1055,10 +1056,10 @@ sk_sp<GrTexture> GrVkGpu::onCreateTexture(SkISize dimensions,
|
||||
if (renderable == GrRenderable::kYes) {
|
||||
tex = GrVkTextureRenderTarget::MakeNewTextureRenderTarget(
|
||||
this, budgeted, dimensions, pixelFormat, mipLevelCount, renderTargetSampleCnt,
|
||||
mipmapStatus, isProtected);
|
||||
mipmapStatus, isProtected, label);
|
||||
} else {
|
||||
tex = GrVkTexture::MakeNewTexture(this, budgeted, dimensions, pixelFormat,
|
||||
mipLevelCount, isProtected, mipmapStatus);
|
||||
mipLevelCount, isProtected, mipmapStatus, label);
|
||||
}
|
||||
|
||||
if (!tex) {
|
||||
@ -1117,8 +1118,14 @@ sk_sp<GrTexture> GrVkGpu::onCreateCompressedTexture(SkISize dimensions,
|
||||
GrMipmapStatus mipmapStatus = (mipmapped == GrMipmapped::kYes) ? GrMipmapStatus::kValid
|
||||
: GrMipmapStatus::kNotAllocated;
|
||||
|
||||
auto tex = GrVkTexture::MakeNewTexture(this, budgeted, dimensions, pixelFormat,
|
||||
numMipLevels, isProtected, mipmapStatus);
|
||||
auto tex = GrVkTexture::MakeNewTexture(this,
|
||||
budgeted,
|
||||
dimensions,
|
||||
pixelFormat,
|
||||
numMipLevels,
|
||||
isProtected,
|
||||
mipmapStatus,
|
||||
/*label=*/{});
|
||||
if (!tex) {
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -244,7 +244,8 @@ private:
|
||||
SkBudgeted,
|
||||
GrProtected,
|
||||
int mipLevelCount,
|
||||
uint32_t levelClearMask) override;
|
||||
uint32_t levelClearMask,
|
||||
std::string_view label) override;
|
||||
sk_sp<GrTexture> onCreateCompressedTexture(SkISize dimensions,
|
||||
const GrBackendFormat&,
|
||||
SkBudgeted,
|
||||
|
@ -106,7 +106,8 @@ sk_sp<GrVkTexture> GrVkTexture::MakeNewTexture(GrVkGpu* gpu, SkBudgeted budgeted
|
||||
SkISize dimensions,
|
||||
VkFormat format, uint32_t mipLevels,
|
||||
GrProtected isProtected,
|
||||
GrMipmapStatus mipmapStatus) {
|
||||
GrMipmapStatus mipmapStatus,
|
||||
std::string_view label) {
|
||||
sk_sp<GrVkImage> texture = GrVkImage::MakeTexture(
|
||||
gpu, dimensions, format, mipLevels, GrRenderable::kNo, /*numSamples=*/1, budgeted,
|
||||
isProtected);
|
||||
@ -115,7 +116,7 @@ sk_sp<GrVkTexture> GrVkTexture::MakeNewTexture(GrVkGpu* gpu, SkBudgeted budgeted
|
||||
return nullptr;
|
||||
}
|
||||
return sk_sp<GrVkTexture>(new GrVkTexture(
|
||||
gpu, budgeted, dimensions, std::move(texture), mipmapStatus, /*label=*/{}));
|
||||
gpu, budgeted, dimensions, std::move(texture), mipmapStatus, label));
|
||||
}
|
||||
|
||||
sk_sp<GrVkTexture> GrVkTexture::MakeWrappedTexture(
|
||||
|
@ -27,7 +27,8 @@ public:
|
||||
VkFormat format,
|
||||
uint32_t mipLevels,
|
||||
GrProtected,
|
||||
GrMipmapStatus);
|
||||
GrMipmapStatus,
|
||||
std::string_view label);
|
||||
|
||||
static sk_sp<GrVkTexture> MakeWrappedTexture(GrVkGpu*,
|
||||
SkISize dimensions,
|
||||
|
@ -87,7 +87,8 @@ sk_sp<GrVkTextureRenderTarget> GrVkTextureRenderTarget::MakeNewTextureRenderTarg
|
||||
uint32_t mipLevels,
|
||||
int sampleCnt,
|
||||
GrMipmapStatus mipmapStatus,
|
||||
GrProtected isProtected) {
|
||||
GrProtected isProtected,
|
||||
std::string_view label) {
|
||||
sk_sp<GrVkImage> texture = GrVkImage::MakeTexture(gpu,
|
||||
dimensions,
|
||||
format,
|
||||
@ -115,7 +116,7 @@ sk_sp<GrVkTextureRenderTarget> GrVkTextureRenderTarget::MakeNewTextureRenderTarg
|
||||
std::move(colorAttachment),
|
||||
std::move(resolveAttachment),
|
||||
mipmapStatus,
|
||||
/*label=*/{}));
|
||||
label));
|
||||
}
|
||||
|
||||
sk_sp<GrVkTextureRenderTarget> GrVkTextureRenderTarget::MakeWrappedTextureRenderTarget(
|
||||
|
@ -34,7 +34,8 @@ public:
|
||||
uint32_t mipLevels,
|
||||
int sampleCnt,
|
||||
GrMipmapStatus mipmapStatus,
|
||||
GrProtected isProtected);
|
||||
GrProtected isProtected,
|
||||
std::string_view label);
|
||||
|
||||
static sk_sp<GrVkTextureRenderTarget> MakeWrappedTextureRenderTarget(
|
||||
GrVkGpu*,
|
||||
|
Loading…
Reference in New Issue
Block a user