Create updateResourceLabel method.
In this CL, the GrSurfaceProxy's and GrDrawOpAtlas's label strings are plumbed so that it can be stored in the label string of GrGpuResource. updateResourceLabel method, which is called from setLabel method, will add labels to Skia OpenGL backend using ANGLE's labeling API. Bug: chromium:1164111 Change-Id: I370715d186357e920d260d624d77586cdddd11e8 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/541230 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
This commit is contained in:
parent
70e432e727
commit
605f92c7d7
@ -86,7 +86,8 @@ bool BaseDevice::replaceBackingProxy(SkSurface::ContentChangeMode mode) {
|
|||||||
oldView.mipmapped(),
|
oldView.mipmapped(),
|
||||||
SkBackingFit::kExact,
|
SkBackingFit::kExact,
|
||||||
oldRTP->isBudgeted(),
|
oldRTP->isBudgeted(),
|
||||||
GrProtected::kNo);
|
GrProtected::kNo,
|
||||||
|
/*label=*/{});
|
||||||
if (!proxy) {
|
if (!proxy) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -477,10 +477,17 @@ bool GrDrawOpAtlas::createPages(
|
|||||||
if (GrColorTypeIsAlphaOnly(grColorType)) {
|
if (GrColorTypeIsAlphaOnly(grColorType)) {
|
||||||
swizzle = skgpu::Swizzle::Concat(swizzle, skgpu::Swizzle("aaaa"));
|
swizzle = skgpu::Swizzle::Concat(swizzle, skgpu::Swizzle("aaaa"));
|
||||||
}
|
}
|
||||||
sk_sp<GrSurfaceProxy> proxy = proxyProvider->createProxy(
|
sk_sp<GrSurfaceProxy> proxy = proxyProvider->createProxy(fFormat,
|
||||||
fFormat, dims, GrRenderable::kNo, 1, GrMipmapped::kNo, SkBackingFit::kExact,
|
dims,
|
||||||
SkBudgeted::kYes, GrProtected::kNo, GrInternalSurfaceFlags::kNone,
|
GrRenderable::kNo,
|
||||||
GrSurfaceProxy::UseAllocator::kNo);
|
1,
|
||||||
|
GrMipmapped::kNo,
|
||||||
|
SkBackingFit::kExact,
|
||||||
|
SkBudgeted::kYes,
|
||||||
|
GrProtected::kNo,
|
||||||
|
fLabel,
|
||||||
|
GrInternalSurfaceFlags::kNone,
|
||||||
|
GrSurfaceProxy::UseAllocator::kNo);
|
||||||
if (!proxy) {
|
if (!proxy) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -48,6 +48,8 @@ void GrGpu::initCapsAndCompiler(sk_sp<const GrCaps> caps) {
|
|||||||
|
|
||||||
void GrGpu::disconnect(DisconnectType type) {}
|
void GrGpu::disconnect(DisconnectType type) {}
|
||||||
|
|
||||||
|
void GrGpu::updateResourceLabel(GrGpuResource* gpu) {}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static bool validate_texel_levels(SkISize dimensions, GrColorType texelColorType,
|
static bool validate_texel_levels(SkISize dimensions, GrColorType texelColorType,
|
||||||
|
@ -88,6 +88,8 @@ public:
|
|||||||
// into an unrecoverable, lost state.
|
// into an unrecoverable, lost state.
|
||||||
virtual bool isDeviceLost() const { return false; }
|
virtual bool isDeviceLost() const { return false; }
|
||||||
|
|
||||||
|
virtual void updateResourceLabel(GrGpuResource*);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The GrGpu object normally assumes that no outsider is setting state
|
* The GrGpu object normally assumes that no outsider is setting state
|
||||||
* within the underlying 3D API's context/device/whatever. This call informs
|
* within the underlying 3D API's context/device/whatever. This call informs
|
||||||
|
@ -67,6 +67,11 @@ void GrGpuResource::abandon() {
|
|||||||
fGpuMemorySize = 0;
|
fGpuMemorySize = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GrGpuResource::setLabel(std::string_view label) {
|
||||||
|
fLabel = label;
|
||||||
|
this->getGpu()->updateResourceLabel(this);
|
||||||
|
}
|
||||||
|
|
||||||
void GrGpuResource::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const {
|
void GrGpuResource::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const {
|
||||||
if (this->fRefsWrappedObjects && !traceMemoryDump->shouldDumpWrappedObjects()) {
|
if (this->fRefsWrappedObjects && !traceMemoryDump->shouldDumpWrappedObjects()) {
|
||||||
return;
|
return;
|
||||||
|
@ -174,9 +174,9 @@ public:
|
|||||||
associated unique key. */
|
associated unique key. */
|
||||||
const skgpu::UniqueKey& getUniqueKey() const { return fUniqueKey; }
|
const skgpu::UniqueKey& getUniqueKey() const { return fUniqueKey; }
|
||||||
|
|
||||||
std::string_view getLabel() const { return fLabel; }
|
std::string getLabel() const { return fLabel; }
|
||||||
|
|
||||||
void setLabel(std::string_view label) { fLabel = label; }
|
void setLabel(std::string_view label);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal-only helper class used for manipulations of the resource by the cache.
|
* Internal-only helper class used for manipulations of the resource by the cache.
|
||||||
|
@ -443,6 +443,7 @@ sk_sp<GrTextureProxy> GrProxyProvider::createProxy(const GrBackendFormat& format
|
|||||||
SkBackingFit fit,
|
SkBackingFit fit,
|
||||||
SkBudgeted budgeted,
|
SkBudgeted budgeted,
|
||||||
GrProtected isProtected,
|
GrProtected isProtected,
|
||||||
|
std::string_view label,
|
||||||
GrInternalSurfaceFlags surfaceFlags,
|
GrInternalSurfaceFlags surfaceFlags,
|
||||||
GrSurfaceProxy::UseAllocator useAllocator) {
|
GrSurfaceProxy::UseAllocator useAllocator) {
|
||||||
ASSERT_SINGLE_OWNER
|
ASSERT_SINGLE_OWNER
|
||||||
@ -494,7 +495,7 @@ sk_sp<GrTextureProxy> GrProxyProvider::createProxy(const GrBackendFormat& format
|
|||||||
surfaceFlags | extraFlags,
|
surfaceFlags | extraFlags,
|
||||||
useAllocator,
|
useAllocator,
|
||||||
this->isDDLProvider(),
|
this->isDDLProvider(),
|
||||||
{}));
|
label));
|
||||||
}
|
}
|
||||||
|
|
||||||
return sk_sp<GrTextureProxy>(new GrTextureProxy(format,
|
return sk_sp<GrTextureProxy>(new GrTextureProxy(format,
|
||||||
@ -507,7 +508,7 @@ sk_sp<GrTextureProxy> GrProxyProvider::createProxy(const GrBackendFormat& format
|
|||||||
surfaceFlags,
|
surfaceFlags,
|
||||||
useAllocator,
|
useAllocator,
|
||||||
this->isDDLProvider(),
|
this->isDDLProvider(),
|
||||||
{}));
|
label));
|
||||||
}
|
}
|
||||||
|
|
||||||
sk_sp<GrTextureProxy> GrProxyProvider::createCompressedTextureProxy(
|
sk_sp<GrTextureProxy> GrProxyProvider::createCompressedTextureProxy(
|
||||||
|
@ -91,6 +91,7 @@ public:
|
|||||||
SkBackingFit,
|
SkBackingFit,
|
||||||
SkBudgeted,
|
SkBudgeted,
|
||||||
GrProtected,
|
GrProtected,
|
||||||
|
std::string_view label,
|
||||||
GrInternalSurfaceFlags = GrInternalSurfaceFlags::kNone,
|
GrInternalSurfaceFlags = GrInternalSurfaceFlags::kNone,
|
||||||
UseAllocator useAllocator = UseAllocator::kYes);
|
UseAllocator useAllocator = UseAllocator::kYes);
|
||||||
|
|
||||||
|
@ -135,7 +135,8 @@ std::unique_ptr<skgpu::SurfaceContext> GrRecordingContextPriv::makeSC(const GrIm
|
|||||||
mipmapped,
|
mipmapped,
|
||||||
fit,
|
fit,
|
||||||
budgeted,
|
budgeted,
|
||||||
isProtected);
|
isProtected,
|
||||||
|
/*label=*/{});
|
||||||
if (!proxy) {
|
if (!proxy) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@ -181,7 +182,8 @@ std::unique_ptr<skgpu::SurfaceFillContext> GrRecordingContextPriv::makeSFC(GrIma
|
|||||||
mipmapped,
|
mipmapped,
|
||||||
fit,
|
fit,
|
||||||
budgeted,
|
budgeted,
|
||||||
isProtected);
|
isProtected,
|
||||||
|
/*label=*/{});
|
||||||
if (!proxy) {
|
if (!proxy) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@ -243,7 +245,8 @@ std::unique_ptr<skgpu::SurfaceFillContext> GrRecordingContextPriv::makeSFC(
|
|||||||
mipmapped,
|
mipmapped,
|
||||||
fit,
|
fit,
|
||||||
budgeted,
|
budgeted,
|
||||||
isProtected);
|
isProtected,
|
||||||
|
/*label=*/{});
|
||||||
if (!proxy) {
|
if (!proxy) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
@ -111,7 +111,7 @@ sk_sp<GrTexture> GrResourceProvider::createTexture(SkISize dimensions,
|
|||||||
tempColorType,
|
tempColorType,
|
||||||
tmpTexels.get(),
|
tmpTexels.get(),
|
||||||
numMipLevels,
|
numMipLevels,
|
||||||
/*label=*/{});
|
/*label=*/label);
|
||||||
}
|
}
|
||||||
|
|
||||||
sk_sp<GrTexture> GrResourceProvider::getExactScratch(SkISize dimensions,
|
sk_sp<GrTexture> GrResourceProvider::getExactScratch(SkISize dimensions,
|
||||||
@ -168,7 +168,7 @@ sk_sp<GrTexture> GrResourceProvider::createTexture(SkISize dimensions,
|
|||||||
renderable,
|
renderable,
|
||||||
renderTargetSampleCnt,
|
renderTargetSampleCnt,
|
||||||
isProtected,
|
isProtected,
|
||||||
/*label=*/{});
|
/*label=*/label);
|
||||||
if (!tex) {
|
if (!tex) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@ -184,7 +184,7 @@ sk_sp<GrTexture> GrResourceProvider::createTexture(SkISize dimensions,
|
|||||||
GrMipmapped::kNo,
|
GrMipmapped::kNo,
|
||||||
isProtected,
|
isProtected,
|
||||||
&mipLevel,
|
&mipLevel,
|
||||||
/*label=*/{});
|
/*label=*/label);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -323,7 +323,7 @@ sk_sp<GrTexture> GrResourceProvider::createApproxTexture(SkISize dimensions,
|
|||||||
GrMipmapped::kNo,
|
GrMipmapped::kNo,
|
||||||
SkBudgeted::kYes,
|
SkBudgeted::kYes,
|
||||||
isProtected,
|
isProtected,
|
||||||
/*label=*/{});
|
/*label=*/label);
|
||||||
}
|
}
|
||||||
|
|
||||||
sk_sp<GrTexture> GrResourceProvider::findAndRefScratchTexture(const skgpu::ScratchKey& key,
|
sk_sp<GrTexture> GrResourceProvider::findAndRefScratchTexture(const skgpu::ScratchKey& key,
|
||||||
|
@ -124,7 +124,7 @@ sk_sp<GrSurface> GrSurfaceProxy::createSurfaceImpl(GrResourceProvider* resourceP
|
|||||||
renderable,
|
renderable,
|
||||||
sampleCnt,
|
sampleCnt,
|
||||||
fIsProtected,
|
fIsProtected,
|
||||||
/*label=*/{});
|
/*label=*/fLabel);
|
||||||
} else {
|
} else {
|
||||||
surface = resourceProvider->createTexture(fDimensions,
|
surface = resourceProvider->createTexture(fDimensions,
|
||||||
fFormat,
|
fFormat,
|
||||||
@ -134,7 +134,7 @@ sk_sp<GrSurface> GrSurfaceProxy::createSurfaceImpl(GrResourceProvider* resourceP
|
|||||||
mipmapped,
|
mipmapped,
|
||||||
fBudgeted,
|
fBudgeted,
|
||||||
fIsProtected,
|
fIsProtected,
|
||||||
/*label=*/{});
|
/*label=*/fLabel);
|
||||||
}
|
}
|
||||||
if (!surface) {
|
if (!surface) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
@ -425,7 +425,8 @@ bool SurfaceContext::internalWritePixels(GrDirectContext* dContext,
|
|||||||
GrMipmapped::kNo,
|
GrMipmapped::kNo,
|
||||||
SkBackingFit::kApprox,
|
SkBackingFit::kApprox,
|
||||||
SkBudgeted::kYes,
|
SkBudgeted::kYes,
|
||||||
GrProtected::kNo);
|
GrProtected::kNo,
|
||||||
|
/*label=*/{});
|
||||||
if (!tempProxy) {
|
if (!tempProxy) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -511,6 +511,13 @@ void GrGLGpu::disconnect(DisconnectType type) {
|
|||||||
fFinishCallbacks.callAll(/* doDelete */ DisconnectType::kCleanup == type);
|
fFinishCallbacks.callAll(/* doDelete */ DisconnectType::kCleanup == type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GrGLGpu::updateResourceLabel(GrGpuResource* gpu) {
|
||||||
|
const std::string label = "Skia_" + gpu->getLabel();
|
||||||
|
GrGLuint id = 0;
|
||||||
|
GL_CALL(GenTextures(1, &id));
|
||||||
|
GR_GL_CALL(this->glInterface(), ObjectLabel(GR_GL_TEXTURE, id, -1, label.c_str()));
|
||||||
|
}
|
||||||
|
|
||||||
GrThreadSafePipelineBuilder* GrGLGpu::pipelineBuilder() {
|
GrThreadSafePipelineBuilder* GrGLGpu::pipelineBuilder() {
|
||||||
return fProgramCache.get();
|
return fProgramCache.get();
|
||||||
}
|
}
|
||||||
|
@ -40,6 +40,8 @@ public:
|
|||||||
|
|
||||||
void disconnect(DisconnectType) override;
|
void disconnect(DisconnectType) override;
|
||||||
|
|
||||||
|
void updateResourceLabel(GrGpuResource*) override;
|
||||||
|
|
||||||
GrThreadSafePipelineBuilder* pipelineBuilder() override;
|
GrThreadSafePipelineBuilder* pipelineBuilder() override;
|
||||||
sk_sp<GrThreadSafePipelineBuilder> refPipelineBuilder() override;
|
sk_sp<GrThreadSafePipelineBuilder> refPipelineBuilder() override;
|
||||||
|
|
||||||
|
@ -477,7 +477,8 @@ GR_DRAW_OP_TEST_DEFINE(NonAALatticeOp) {
|
|||||||
GrMipmapped::kNo,
|
GrMipmapped::kNo,
|
||||||
SkBackingFit::kExact,
|
SkBackingFit::kExact,
|
||||||
SkBudgeted::kYes,
|
SkBudgeted::kYes,
|
||||||
GrProtected::kNo);
|
GrProtected::kNo,
|
||||||
|
/*label=*/{});
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (random->nextBool()) {
|
if (random->nextBool()) {
|
||||||
|
@ -94,7 +94,7 @@ GrSurfaceProxyView make_deferred_mask_texture_view(GrRecordingContext* rContext,
|
|||||||
|
|
||||||
auto proxy =
|
auto proxy =
|
||||||
proxyProvider->createProxy(format, dimensions, GrRenderable::kNo, 1, GrMipmapped::kNo,
|
proxyProvider->createProxy(format, dimensions, GrRenderable::kNo, 1, GrMipmapped::kNo,
|
||||||
fit, SkBudgeted::kYes, GrProtected::kNo);
|
fit, SkBudgeted::kYes, GrProtected::kNo, /*label=*/{});
|
||||||
return {std::move(proxy), kTopLeft_GrSurfaceOrigin, swizzle};
|
return {std::move(proxy), kTopLeft_GrSurfaceOrigin, swizzle};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1402,9 +1402,16 @@ GR_DRAW_OP_TEST_DEFINE(TextureOpImpl) {
|
|||||||
context->priv().caps()->getDefaultBackendFormat(GrColorType::kRGBA_8888,
|
context->priv().caps()->getDefaultBackendFormat(GrColorType::kRGBA_8888,
|
||||||
GrRenderable::kNo);
|
GrRenderable::kNo);
|
||||||
GrProxyProvider* proxyProvider = context->priv().proxyProvider();
|
GrProxyProvider* proxyProvider = context->priv().proxyProvider();
|
||||||
sk_sp<GrTextureProxy> proxy = proxyProvider->createProxy(
|
sk_sp<GrTextureProxy> proxy = proxyProvider->createProxy(format,
|
||||||
format, dims, GrRenderable::kNo, 1, mipmapped, fit, SkBudgeted::kNo, GrProtected::kNo,
|
dims,
|
||||||
GrInternalSurfaceFlags::kNone);
|
GrRenderable::kNo,
|
||||||
|
1,
|
||||||
|
mipmapped,
|
||||||
|
fit,
|
||||||
|
SkBudgeted::kNo,
|
||||||
|
GrProtected::kNo,
|
||||||
|
/*label=*/{},
|
||||||
|
GrInternalSurfaceFlags::kNone);
|
||||||
|
|
||||||
SkRect rect = GrTest::TestRect(random);
|
SkRect rect = GrTest::TestRect(random);
|
||||||
SkRect srcRect;
|
SkRect srcRect;
|
||||||
|
@ -328,7 +328,7 @@ GrSurfaceProxyView render_sw_mask(GrRecordingContext* context,
|
|||||||
GrColorType::kAlpha_8);
|
GrColorType::kAlpha_8);
|
||||||
auto proxy = proxyProvider->createProxy(format, bounds.size(), GrRenderable::kNo, 1,
|
auto proxy = proxyProvider->createProxy(format, bounds.size(), GrRenderable::kNo, 1,
|
||||||
GrMipmapped::kNo, SkBackingFit::kApprox,
|
GrMipmapped::kNo, SkBackingFit::kApprox,
|
||||||
SkBudgeted::kYes, GrProtected::kNo);
|
SkBudgeted::kYes, GrProtected::kNo, /*label=*/{});
|
||||||
|
|
||||||
// Since this will be rendered on another thread, make a copy of the elements in case
|
// 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
|
// the clip stack is modified on the main thread
|
||||||
|
@ -181,7 +181,8 @@ std::unique_ptr<SurfaceDrawContext> SurfaceDrawContext::Make(
|
|||||||
mipmapped,
|
mipmapped,
|
||||||
fit,
|
fit,
|
||||||
budgeted,
|
budgeted,
|
||||||
isProtected);
|
isProtected,
|
||||||
|
/*label=*/{});
|
||||||
if (!proxy) {
|
if (!proxy) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@ -226,7 +227,8 @@ std::unique_ptr<SurfaceDrawContext> SurfaceDrawContext::Make(
|
|||||||
mipmapped,
|
mipmapped,
|
||||||
fit,
|
fit,
|
||||||
budgeted,
|
budgeted,
|
||||||
isProtected);
|
isProtected,
|
||||||
|
/*label=*/{});
|
||||||
if (!proxy) {
|
if (!proxy) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ static sk_sp<GrSurfaceProxy> create_proxy(GrRecordingContext* rContext) {
|
|||||||
GrRenderable::kYes);
|
GrRenderable::kYes);
|
||||||
return rContext->priv().proxyProvider()->createProxy(
|
return rContext->priv().proxyProvider()->createProxy(
|
||||||
format, kDimensions, GrRenderable::kYes, 1, GrMipmapped::kNo, SkBackingFit::kExact,
|
format, kDimensions, GrRenderable::kYes, 1, GrMipmapped::kNo, SkBackingFit::kExact,
|
||||||
SkBudgeted::kNo, GrProtected::kNo, GrInternalSurfaceFlags::kNone);
|
SkBudgeted::kNo, GrProtected::kNo, /*label=*/{}, GrInternalSurfaceFlags::kNone);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef GrQuadAAFlags (*PerQuadAAFunc)(int i);
|
typedef GrQuadAAFlags (*PerQuadAAFunc)(int i);
|
||||||
|
@ -383,7 +383,8 @@ static std::unique_ptr<skgpu::v1::SurfaceDrawContext> draw_mipmap_into_new_rende
|
|||||||
GrMipmapped::kNo,
|
GrMipmapped::kNo,
|
||||||
SkBackingFit::kApprox,
|
SkBackingFit::kApprox,
|
||||||
SkBudgeted::kYes,
|
SkBudgeted::kYes,
|
||||||
GrProtected::kNo);
|
GrProtected::kNo,
|
||||||
|
/*label=*/{});
|
||||||
|
|
||||||
auto sdc = skgpu::v1::SurfaceDrawContext::Make(rContext,
|
auto sdc = skgpu::v1::SurfaceDrawContext::Make(rContext,
|
||||||
colorType,
|
colorType,
|
||||||
@ -439,7 +440,7 @@ DEF_GPUTEST(GrManyDependentsMipMappedTest, reporter, /* options */) {
|
|||||||
|
|
||||||
sk_sp<GrTextureProxy> mipmapProxy = proxyProvider->createProxy(
|
sk_sp<GrTextureProxy> mipmapProxy = proxyProvider->createProxy(
|
||||||
format, {4, 4}, GrRenderable::kYes, 1, GrMipmapped::kYes, SkBackingFit::kExact,
|
format, {4, 4}, GrRenderable::kYes, 1, GrMipmapped::kYes, SkBackingFit::kExact,
|
||||||
SkBudgeted::kYes, GrProtected::kNo);
|
SkBudgeted::kYes, GrProtected::kNo, /*label=*/{});
|
||||||
|
|
||||||
// Mark the mipmaps clean to ensure things still work properly when they won't be marked
|
// Mark the mipmaps clean to ensure things still work properly when they won't be marked
|
||||||
// dirty again until GrRenderTask::makeClosed().
|
// dirty again until GrRenderTask::makeClosed().
|
||||||
|
@ -167,7 +167,7 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(GrSurfaceRenderability, reporter, ctxInfo) {
|
|||||||
|
|
||||||
sk_sp<GrTextureProxy> proxy = proxyProvider->createProxy(
|
sk_sp<GrTextureProxy> proxy = proxyProvider->createProxy(
|
||||||
combo.fFormat, kDims, GrRenderable::kNo, 1, GrMipmapped::kYes,
|
combo.fFormat, kDims, GrRenderable::kNo, 1, GrMipmapped::kYes,
|
||||||
SkBackingFit::kExact, SkBudgeted::kNo, GrProtected::kNo);
|
SkBackingFit::kExact, SkBudgeted::kNo, GrProtected::kNo, /*label=*/{});
|
||||||
REPORTER_ASSERT(reporter, SkToBool(proxy.get()) == expectedMipMapability,
|
REPORTER_ASSERT(reporter, SkToBool(proxy.get()) == expectedMipMapability,
|
||||||
"ct:%s format:%s, tex:%d, expectedMipMapability:%d",
|
"ct:%s format:%s, tex:%d, expectedMipMapability:%d",
|
||||||
GrColorTypeToStr(combo.fColorType), combo.fFormat.toStr().c_str(),
|
GrColorTypeToStr(combo.fColorType), combo.fFormat.toStr().c_str(),
|
||||||
|
@ -183,7 +183,7 @@ DEF_GPUTEST(OpChainTest, reporter, /*ctxInfo*/) {
|
|||||||
static const GrSurfaceOrigin kOrigin = kTopLeft_GrSurfaceOrigin;
|
static const GrSurfaceOrigin kOrigin = kTopLeft_GrSurfaceOrigin;
|
||||||
auto proxy = dContext->priv().proxyProvider()->createProxy(
|
auto proxy = dContext->priv().proxyProvider()->createProxy(
|
||||||
format, kDims, GrRenderable::kYes, 1, GrMipmapped::kNo, SkBackingFit::kExact,
|
format, kDims, GrRenderable::kYes, 1, GrMipmapped::kNo, SkBackingFit::kExact,
|
||||||
SkBudgeted::kNo, GrProtected::kNo, GrInternalSurfaceFlags::kNone);
|
SkBudgeted::kNo, GrProtected::kNo, /*label=*/{}, GrInternalSurfaceFlags::kNone);
|
||||||
SkASSERT(proxy);
|
SkASSERT(proxy);
|
||||||
proxy->instantiate(dContext->priv().resourceProvider());
|
proxy->instantiate(dContext->priv().resourceProvider());
|
||||||
|
|
||||||
|
@ -163,7 +163,7 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(ProcessorRefTest, reporter, ctxInfo) {
|
|||||||
{
|
{
|
||||||
sk_sp<GrTextureProxy> proxy = proxyProvider->createProxy(
|
sk_sp<GrTextureProxy> proxy = proxyProvider->createProxy(
|
||||||
format, kDims, GrRenderable::kNo, 1, GrMipmapped::kNo, SkBackingFit::kExact,
|
format, kDims, GrRenderable::kNo, 1, GrMipmapped::kNo, SkBackingFit::kExact,
|
||||||
SkBudgeted::kYes, GrProtected::kNo);
|
SkBudgeted::kYes, GrProtected::kNo, /*label=*/{});
|
||||||
|
|
||||||
{
|
{
|
||||||
SkTArray<GrSurfaceProxyView> views;
|
SkTArray<GrSurfaceProxyView> views;
|
||||||
|
@ -254,7 +254,7 @@ bool GrDrawingManager::ProgramUnitTest(GrDirectContext* direct, int maxStages, i
|
|||||||
GrRenderable::kYes);
|
GrRenderable::kYes);
|
||||||
auto proxy = proxyProvider->createProxy(format, kDims, GrRenderable::kYes, 1,
|
auto proxy = proxyProvider->createProxy(format, kDims, GrRenderable::kYes, 1,
|
||||||
mipmapped, SkBackingFit::kExact, SkBudgeted::kNo,
|
mipmapped, SkBackingFit::kExact, SkBudgeted::kNo,
|
||||||
GrProtected::kNo, GrInternalSurfaceFlags::kNone);
|
GrProtected::kNo,/*label=*/{}, GrInternalSurfaceFlags::kNone);
|
||||||
skgpu::Swizzle swizzle = caps->getReadSwizzle(format, GrColorType::kRGBA_8888);
|
skgpu::Swizzle swizzle = caps->getReadSwizzle(format, GrColorType::kRGBA_8888);
|
||||||
views[0] = {{std::move(proxy), kBottomLeft_GrSurfaceOrigin, swizzle},
|
views[0] = {{std::move(proxy), kBottomLeft_GrSurfaceOrigin, swizzle},
|
||||||
GrColorType::kRGBA_8888, kPremul_SkAlphaType};
|
GrColorType::kRGBA_8888, kPremul_SkAlphaType};
|
||||||
@ -265,7 +265,7 @@ bool GrDrawingManager::ProgramUnitTest(GrDirectContext* direct, int maxStages, i
|
|||||||
GrRenderable::kNo);
|
GrRenderable::kNo);
|
||||||
auto proxy = proxyProvider->createProxy(format, kDims, GrRenderable::kNo, 1, mipmapped,
|
auto proxy = proxyProvider->createProxy(format, kDims, GrRenderable::kNo, 1, mipmapped,
|
||||||
SkBackingFit::kExact, SkBudgeted::kNo,
|
SkBackingFit::kExact, SkBudgeted::kNo,
|
||||||
GrProtected::kNo, GrInternalSurfaceFlags::kNone);
|
GrProtected::kNo, /*label=*/{}, GrInternalSurfaceFlags::kNone);
|
||||||
skgpu::Swizzle swizzle = caps->getReadSwizzle(format, GrColorType::kAlpha_8);
|
skgpu::Swizzle swizzle = caps->getReadSwizzle(format, GrColorType::kAlpha_8);
|
||||||
views[1] = {{std::move(proxy), kTopLeft_GrSurfaceOrigin, swizzle},
|
views[1] = {{std::move(proxy), kTopLeft_GrSurfaceOrigin, swizzle},
|
||||||
GrColorType::kAlpha_8, kPremul_SkAlphaType};
|
GrColorType::kAlpha_8, kPremul_SkAlphaType};
|
||||||
|
@ -134,7 +134,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(DefferredProxyConversionTest, reporter, ctxIn
|
|||||||
{
|
{
|
||||||
sk_sp<GrTextureProxy> proxy = proxyProvider->createProxy(
|
sk_sp<GrTextureProxy> proxy = proxyProvider->createProxy(
|
||||||
format, kDims, GrRenderable::kYes, 1, GrMipmapped::kNo, SkBackingFit::kApprox,
|
format, kDims, GrRenderable::kYes, 1, GrMipmapped::kNo, SkBackingFit::kApprox,
|
||||||
SkBudgeted::kYes, GrProtected::kNo);
|
SkBudgeted::kYes, GrProtected::kNo, /*label=*/{});
|
||||||
|
|
||||||
// Both RenderTarget and Texture
|
// Both RenderTarget and Texture
|
||||||
GrRenderTargetProxy* rtProxy = proxy->asRenderTargetProxy();
|
GrRenderTargetProxy* rtProxy = proxy->asRenderTargetProxy();
|
||||||
@ -148,7 +148,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(DefferredProxyConversionTest, reporter, ctxIn
|
|||||||
{
|
{
|
||||||
sk_sp<GrTextureProxy> proxy = proxyProvider->createProxy(
|
sk_sp<GrTextureProxy> proxy = proxyProvider->createProxy(
|
||||||
format, kDims, GrRenderable::kYes, 1, GrMipmapped::kNo, SkBackingFit::kApprox,
|
format, kDims, GrRenderable::kYes, 1, GrMipmapped::kNo, SkBackingFit::kApprox,
|
||||||
SkBudgeted::kYes, GrProtected::kNo);
|
SkBudgeted::kYes, GrProtected::kNo, /*label=*/{});
|
||||||
|
|
||||||
// Both RenderTarget and Texture - but via GrTextureProxy
|
// Both RenderTarget and Texture - but via GrTextureProxy
|
||||||
GrTextureProxy* tProxy = proxy->asTextureProxy();
|
GrTextureProxy* tProxy = proxy->asTextureProxy();
|
||||||
@ -162,7 +162,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(DefferredProxyConversionTest, reporter, ctxIn
|
|||||||
{
|
{
|
||||||
sk_sp<GrTextureProxy> proxy = proxyProvider->createProxy(
|
sk_sp<GrTextureProxy> proxy = proxyProvider->createProxy(
|
||||||
format, kDims, GrRenderable::kNo, 1, GrMipmapped::kNo, SkBackingFit::kApprox,
|
format, kDims, GrRenderable::kNo, 1, GrMipmapped::kNo, SkBackingFit::kApprox,
|
||||||
SkBudgeted::kYes, GrProtected::kNo);
|
SkBudgeted::kYes, GrProtected::kNo, /*label=*/{});
|
||||||
// Texture-only
|
// Texture-only
|
||||||
GrTextureProxy* tProxy = proxy->asTextureProxy();
|
GrTextureProxy* tProxy = proxy->asTextureProxy();
|
||||||
REPORTER_ASSERT(reporter, tProxy);
|
REPORTER_ASSERT(reporter, tProxy);
|
||||||
|
@ -30,7 +30,7 @@ static sk_sp<GrTextureProxy> make_deferred(GrRecordingContext* rContext) {
|
|||||||
GrRenderable::kYes);
|
GrRenderable::kYes);
|
||||||
return proxyProvider->createProxy(format, {kWidthHeight, kWidthHeight}, GrRenderable::kYes, 1,
|
return proxyProvider->createProxy(format, {kWidthHeight, kWidthHeight}, GrRenderable::kYes, 1,
|
||||||
GrMipmapped::kNo, SkBackingFit::kApprox, SkBudgeted::kYes,
|
GrMipmapped::kNo, SkBackingFit::kApprox, SkBudgeted::kYes,
|
||||||
GrProtected::kNo);
|
GrProtected::kNo, /*label=*/{});
|
||||||
}
|
}
|
||||||
|
|
||||||
static sk_sp<GrTextureProxy> make_wrapped(GrRecordingContext* rContext) {
|
static sk_sp<GrTextureProxy> make_wrapped(GrRecordingContext* rContext) {
|
||||||
|
@ -155,7 +155,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(DeferredProxyTest, reporter, ctxInfo) {
|
|||||||
|
|
||||||
sk_sp<GrTextureProxy> proxy = proxyProvider->createProxy(
|
sk_sp<GrTextureProxy> proxy = proxyProvider->createProxy(
|
||||||
format, dims, GrRenderable::kYes, numSamples, GrMipmapped::kNo,
|
format, dims, GrRenderable::kYes, numSamples, GrMipmapped::kNo,
|
||||||
fit, budgeted, GrProtected::kNo);
|
fit, budgeted, GrProtected::kNo, /*label=*/{});
|
||||||
REPORTER_ASSERT(reporter, SkToBool(tex) == SkToBool(proxy));
|
REPORTER_ASSERT(reporter, SkToBool(tex) == SkToBool(proxy));
|
||||||
if (proxy) {
|
if (proxy) {
|
||||||
REPORTER_ASSERT(reporter, proxy->asRenderTargetProxy());
|
REPORTER_ASSERT(reporter, proxy->asRenderTargetProxy());
|
||||||
@ -201,7 +201,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(DeferredProxyTest, reporter, ctxInfo) {
|
|||||||
|
|
||||||
sk_sp<GrTextureProxy> proxy(proxyProvider->createProxy(
|
sk_sp<GrTextureProxy> proxy(proxyProvider->createProxy(
|
||||||
format, dims, GrRenderable::kNo, numSamples, GrMipmapped::kNo,
|
format, dims, GrRenderable::kNo, numSamples, GrMipmapped::kNo,
|
||||||
fit, budgeted, GrProtected::kNo));
|
fit, budgeted, GrProtected::kNo, /*label=*/{}));
|
||||||
REPORTER_ASSERT(reporter, SkToBool(tex) == SkToBool(proxy));
|
REPORTER_ASSERT(reporter, SkToBool(tex) == SkToBool(proxy));
|
||||||
if (proxy) {
|
if (proxy) {
|
||||||
// This forces the proxy to compute and cache its
|
// This forces the proxy to compute and cache its
|
||||||
@ -357,7 +357,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ZeroSizedProxyTest, reporter, ctxInfo) {
|
|||||||
|
|
||||||
sk_sp<GrTextureProxy> proxy = provider->createProxy(
|
sk_sp<GrTextureProxy> proxy = provider->createProxy(
|
||||||
format, {width, height}, renderable, 1, GrMipmapped::kNo, fit,
|
format, {width, height}, renderable, 1, GrMipmapped::kNo, fit,
|
||||||
SkBudgeted::kNo, GrProtected::kNo);
|
SkBudgeted::kNo, GrProtected::kNo, /*label=*/{});
|
||||||
REPORTER_ASSERT(reporter, !proxy);
|
REPORTER_ASSERT(reporter, !proxy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ static sk_sp<GrSurfaceProxy> make_deferred(GrProxyProvider* proxyProvider, const
|
|||||||
const ProxyParams& p) {
|
const ProxyParams& p) {
|
||||||
const GrBackendFormat format = caps->getDefaultBackendFormat(p.fColorType, p.fRenderable);
|
const GrBackendFormat format = caps->getDefaultBackendFormat(p.fColorType, p.fRenderable);
|
||||||
return proxyProvider->createProxy(format, {p.fSize, p.fSize}, p.fRenderable, p.fSampleCnt,
|
return proxyProvider->createProxy(format, {p.fSize, p.fSize}, p.fRenderable, p.fSampleCnt,
|
||||||
GrMipmapped::kNo, p.fFit, p.fBudgeted, GrProtected::kNo);
|
GrMipmapped::kNo, p.fFit, p.fBudgeted, GrProtected::kNo, /*label=*/{});
|
||||||
}
|
}
|
||||||
|
|
||||||
static sk_sp<GrSurfaceProxy> make_backend(GrDirectContext* dContext, const ProxyParams& p) {
|
static sk_sp<GrSurfaceProxy> make_backend(GrDirectContext* dContext, const ProxyParams& p) {
|
||||||
|
@ -1705,7 +1705,7 @@ static sk_sp<GrTextureProxy> make_mipmap_proxy(GrRecordingContext* rContext,
|
|||||||
GrRenderable::kNo);
|
GrRenderable::kNo);
|
||||||
|
|
||||||
return proxyProvider->createProxy(format, dims, renderable, sampleCnt, GrMipmapped::kYes,
|
return proxyProvider->createProxy(format, dims, renderable, sampleCnt, GrMipmapped::kYes,
|
||||||
SkBackingFit::kExact, SkBudgeted::kYes, GrProtected::kNo);
|
SkBackingFit::kExact, SkBudgeted::kYes, GrProtected::kNo, /*label=*/{});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Exercise GrSurface::gpuMemorySize for different combos of MSAA, RT-only,
|
// Exercise GrSurface::gpuMemorySize for different combos of MSAA, RT-only,
|
||||||
|
@ -46,7 +46,7 @@ static sk_sp<GrSurfaceProxy> create_proxy(GrRecordingContext* rContext) {
|
|||||||
GrRenderable::kYes);
|
GrRenderable::kYes);
|
||||||
return rContext->priv().proxyProvider()->createProxy(
|
return rContext->priv().proxyProvider()->createProxy(
|
||||||
format, kDimensions, GrRenderable::kYes, 1, GrMipmapped::kNo, SkBackingFit::kExact,
|
format, kDimensions, GrRenderable::kYes, 1, GrMipmapped::kNo, SkBackingFit::kExact,
|
||||||
SkBudgeted::kNo, GrProtected::kNo, GrInternalSurfaceFlags::kNone);
|
SkBudgeted::kNo, GrProtected::kNo, /*label=*/{}, GrInternalSurfaceFlags::kNone);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GrOp::Owner create_op(GrDirectContext* dContext, SkRect rect,
|
static GrOp::Owner create_op(GrDirectContext* dContext, SkRect rect,
|
||||||
|
@ -47,7 +47,7 @@ static sk_sp<GrTextureProxy> deferred_tex(skiatest::Reporter* reporter,
|
|||||||
|
|
||||||
sk_sp<GrTextureProxy> proxy =
|
sk_sp<GrTextureProxy> proxy =
|
||||||
proxyProvider->createProxy(format, kSize, GrRenderable::kNo, 1, GrMipmapped::kNo, fit,
|
proxyProvider->createProxy(format, kSize, GrRenderable::kNo, 1, GrMipmapped::kNo, fit,
|
||||||
SkBudgeted::kYes, GrProtected::kNo);
|
SkBudgeted::kYes, GrProtected::kNo, /*label=*/{});
|
||||||
// Only budgeted & wrapped external proxies get to carry uniqueKeys
|
// Only budgeted & wrapped external proxies get to carry uniqueKeys
|
||||||
REPORTER_ASSERT(reporter, !proxy->getUniqueKey().isValid());
|
REPORTER_ASSERT(reporter, !proxy->getUniqueKey().isValid());
|
||||||
return proxy;
|
return proxy;
|
||||||
@ -63,7 +63,7 @@ static sk_sp<GrTextureProxy> deferred_texRT(skiatest::Reporter* reporter,
|
|||||||
|
|
||||||
sk_sp<GrTextureProxy> proxy =
|
sk_sp<GrTextureProxy> proxy =
|
||||||
proxyProvider->createProxy(format, kSize, GrRenderable::kYes, 1, GrMipmapped::kNo, fit,
|
proxyProvider->createProxy(format, kSize, GrRenderable::kYes, 1, GrMipmapped::kNo, fit,
|
||||||
SkBudgeted::kYes, GrProtected::kNo);
|
SkBudgeted::kYes, GrProtected::kNo, /*label=*/{});
|
||||||
// Only budgeted & wrapped external proxies get to carry uniqueKeys
|
// Only budgeted & wrapped external proxies get to carry uniqueKeys
|
||||||
REPORTER_ASSERT(reporter, !proxy->getUniqueKey().isValid());
|
REPORTER_ASSERT(reporter, !proxy->getUniqueKey().isValid());
|
||||||
return proxy;
|
return proxy;
|
||||||
|
@ -535,7 +535,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WritePixelsPendingIO, reporter, ctxInfo) {
|
|||||||
|
|
||||||
sk_sp<GrTextureProxy> temp = proxyProvider->createProxy(
|
sk_sp<GrTextureProxy> temp = proxyProvider->createProxy(
|
||||||
format, kDims, GrRenderable::kNo, 1, GrMipmapped::kNo, SkBackingFit::kApprox,
|
format, kDims, GrRenderable::kNo, 1, GrMipmapped::kNo, SkBackingFit::kApprox,
|
||||||
SkBudgeted::kYes, GrProtected::kNo);
|
SkBudgeted::kYes, GrProtected::kNo, /*label=*/{});
|
||||||
temp->instantiate(context->priv().resourceProvider());
|
temp->instantiate(context->priv().resourceProvider());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,7 +76,8 @@ GrSurfaceProxyView MakeTextureProxyViewFromData(GrDirectContext* dContext,
|
|||||||
GrMipmapped::kNo,
|
GrMipmapped::kNo,
|
||||||
SkBackingFit::kExact,
|
SkBackingFit::kExact,
|
||||||
SkBudgeted::kYes,
|
SkBudgeted::kYes,
|
||||||
GrProtected::kNo);
|
GrProtected::kNo,
|
||||||
|
/*label=*/{});
|
||||||
if (!proxy) {
|
if (!proxy) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user