Label intermediate Gradient texture.
Label temprory offscreen textures for draws. In this CL, we will
label texture for gradient from GrGradientShader which will help
labeling parts of SkImages too.
Bug: chromium:1164111
Change-Id: Iea49598f7632bb2edfaef21a0956771af5833cc1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550736
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
diff --git a/gm/fp_sample_chaining.cpp b/gm/fp_sample_chaining.cpp
index f21da69f..cbfe26f 100644
--- a/gm/fp_sample_chaining.cpp
+++ b/gm/fp_sample_chaining.cpp
@@ -193,7 +193,8 @@
#if 0
auto fp = std::unique_ptr<GrFragmentProcessor>(new TestPatternEffect());
#else
- auto view = std::get<0>(GrMakeCachedBitmapProxyView(rContext, bmp, GrMipmapped::kNo));
+ auto view = std::get<0>(GrMakeCachedBitmapProxyView(
+ rContext, bmp, /*label=*/"FpSampleChaining", GrMipmapped::kNo));
auto fp = GrTextureEffect::Make(std::move(view), bmp.alphaType());
#endif
for (EffectType effectType : effects) {
diff --git a/gm/fpcoordinateoverride.cpp b/gm/fpcoordinateoverride.cpp
index c31ea70..b2fd678 100644
--- a/gm/fpcoordinateoverride.cpp
+++ b/gm/fpcoordinateoverride.cpp
@@ -83,7 +83,8 @@
SkBitmap bmp;
GetResourceAsBitmap("images/mandrill_512_q075.jpg", &bmp);
- auto view = std::get<0>(GrMakeCachedBitmapProxyView(rContext, bmp, GrMipmapped::kNo));
+ auto view = std::get<0>(GrMakeCachedBitmapProxyView(
+ rContext, bmp, /*label=*/"FpCoordinateOverride", GrMipmapped::kNo));
if (!view) {
return;
}
diff --git a/gm/image_pict.cpp b/gm/image_pict.cpp
index 603d34b..34f006f 100644
--- a/gm/image_pict.cpp
+++ b/gm/image_pict.cpp
@@ -197,9 +197,13 @@
auto budgeted = policy == GrImageTexGenPolicy::kNew_Uncached_Unbudgeted ? SkBudgeted::kNo
: SkBudgeted::kYes;
return GrSurfaceProxyView::Copy(
- fRContext.get(), fView, mipmapped,
+ fRContext.get(),
+ fView,
+ mipmapped,
SkIRect::MakeXYWH(origin.x(), origin.y(), info.width(), info.height()),
- SkBackingFit::kExact, budgeted);
+ SkBackingFit::kExact,
+ budgeted,
+ /*label=*/"SurfaceProxyView_GenerateTexture");
}
private:
diff --git a/gm/swizzle.cpp b/gm/swizzle.cpp
index da9b838..1ddfa6a 100644
--- a/gm/swizzle.cpp
+++ b/gm/swizzle.cpp
@@ -27,7 +27,8 @@
SkBitmap bmp;
GetResourceAsBitmap("images/mandrill_512_q075.jpg", &bmp);
- auto view = std::get<0>(GrMakeCachedBitmapProxyView(rContext, bmp, GrMipmapped::kNo));
+ auto view = std::get<0>(
+ GrMakeCachedBitmapProxyView(rContext, bmp, /*label=*/"Gm_Swizzle", GrMipmapped::kNo));
if (!view) {
return;
}
diff --git a/gm/texelsubset.cpp b/gm/texelsubset.cpp
index cdad2e9..2c8d937 100644
--- a/gm/texelsubset.cpp
+++ b/gm/texelsubset.cpp
@@ -96,7 +96,8 @@
if (mipmapped == GrMipmapped::kYes && !rContext->priv().caps()->mipmapSupport()) {
return DrawResult::kSkip;
}
- auto view = std::get<0>(GrMakeCachedBitmapProxyView(rContext, fBitmap, mipmapped));
+ auto view = std::get<0>(GrMakeCachedBitmapProxyView(
+ rContext, fBitmap, /*label=*/"DrawResult_Draw_BitMap", mipmapped));
if (!view) {
*errorMsg = "Failed to create proxy.";
return DrawResult::kFail;
@@ -129,7 +130,8 @@
SkBitmap subsetBmp;
fBitmap.extractSubset(&subsetBmp, texelSubset);
subsetBmp.setImmutable();
- auto subsetView = std::get<0>(GrMakeCachedBitmapProxyView(rContext, subsetBmp, mipmapped));
+ auto subsetView = std::get<0>(GrMakeCachedBitmapProxyView(
+ rContext, subsetBmp, /*label=*/"DrawResult_Draw_SubsetBitMap", mipmapped));
SkRect localRect = SkRect::Make(fBitmap.bounds()).makeOutset(kDrawPad, kDrawPad);
diff --git a/gm/yuvtorgbsubset.cpp b/gm/yuvtorgbsubset.cpp
index 8f199bb..b6e000b 100644
--- a/gm/yuvtorgbsubset.cpp
+++ b/gm/yuvtorgbsubset.cpp
@@ -95,7 +95,9 @@
SkBitmap bitmap;
bitmap.installPixels(fPixmaps.plane(i));
bitmap.setImmutable();
- views[i] = std::get<0>(GrMakeCachedBitmapProxyView(context, bitmap, GrMipmapped::kNo));
+ views[i] = std::get<0>(
+ GrMakeCachedBitmapProxyView(context, bitmap, /*label=*/"DrawResult_GpuSetup",
+ GrMipmapped::kNo));
if (!views[i]) {
*errorMsg = "Failed to create proxy";
return context->abandoned() ? DrawResult::kSkip : DrawResult::kFail;
diff --git a/src/core/SkSpecialImage.cpp b/src/core/SkSpecialImage.cpp
index 5e6ba7a..5d5dbe8 100644
--- a/src/core/SkSpecialImage.cpp
+++ b/src/core/SkSpecialImage.cpp
@@ -240,7 +240,8 @@
#if SK_SUPPORT_GPU
GrSurfaceProxyView onView(GrRecordingContext* context) const override {
if (context) {
- return std::get<0>(GrMakeCachedBitmapProxyView(context, fBitmap, GrMipmapped::kNo));
+ return std::get<0>(GrMakeCachedBitmapProxyView(
+ context, fBitmap, /*label=*/"SpecialImageRaster_OnView", GrMipmapped::kNo));
}
return {};
@@ -454,8 +455,13 @@
fColorSpace);
}
- auto subsetView = GrSurfaceProxyView::Copy(fContext, fView, GrMipmapped::kNo, *subset,
- SkBackingFit::kExact, SkBudgeted::kYes);
+ auto subsetView = GrSurfaceProxyView::Copy(fContext,
+ fView,
+ GrMipmapped::kNo,
+ *subset,
+ SkBackingFit::kExact,
+ SkBudgeted::kYes,
+ /*label=*/"SkSpecialImage_AsImage");
if (!subsetView) {
return nullptr;
}
diff --git a/src/effects/SkTableColorFilter.cpp b/src/effects/SkTableColorFilter.cpp
index a513003..ae6df4b 100644
--- a/src/effects/SkTableColorFilter.cpp
+++ b/src/effects/SkTableColorFilter.cpp
@@ -182,7 +182,9 @@
SkASSERT(kPremul_SkAlphaType == bitmap.alphaType());
SkASSERT(bitmap.isImmutable());
- auto view = std::get<0>(GrMakeCachedBitmapProxyView(context, bitmap, GrMipmapped::kNo));
+ auto view = std::get<0>(
+ GrMakeCachedBitmapProxyView(context, bitmap, /*label=*/"MakeColorTableEffect",
+ GrMipmapped::kNo));
if (!view) {
return nullptr;
}
diff --git a/src/gpu/ganesh/GrAHardwareBufferImageGenerator.cpp b/src/gpu/ganesh/GrAHardwareBufferImageGenerator.cpp
index dc7ddb5..99ec255 100644
--- a/src/gpu/ganesh/GrAHardwareBufferImageGenerator.cpp
+++ b/src/gpu/ganesh/GrAHardwareBufferImageGenerator.cpp
@@ -207,8 +207,13 @@
? SkBudgeted::kNo
: SkBudgeted::kYes;
- return GrSurfaceProxyView::Copy(context, std::move(texProxyView), mipmapped, subset,
- SkBackingFit::kExact, budgeted);
+ return GrSurfaceProxyView::Copy(context,
+ std::move(texProxyView),
+ mipmapped,
+ subset,
+ SkBackingFit::kExact,
+ budgeted,
+ /*label=*/"AHardwareBufferImageGenerator_GenerateTexture");
}
bool GrAHardwareBufferImageGenerator::onIsValid(GrRecordingContext* context) const {
diff --git a/src/gpu/ganesh/GrBackendTextureImageGenerator.cpp b/src/gpu/ganesh/GrBackendTextureImageGenerator.cpp
index e2c5298..7f36811 100644
--- a/src/gpu/ganesh/GrBackendTextureImageGenerator.cpp
+++ b/src/gpu/ganesh/GrBackendTextureImageGenerator.cpp
@@ -230,7 +230,8 @@
mipmapped,
subset,
SkBackingFit::kExact,
- budgeted);
+ budgeted,
+ /*label=*/"BackendTextureImageGenerator_GenerateTexture");
return {std::move(copy), fSurfaceOrigin, readSwizzle};
}
}
diff --git a/src/gpu/ganesh/GrSurfaceProxy.cpp b/src/gpu/ganesh/GrSurfaceProxy.cpp
index 5e675f5..ab49e1a 100644
--- a/src/gpu/ganesh/GrSurfaceProxy.cpp
+++ b/src/gpu/ganesh/GrSurfaceProxy.cpp
@@ -269,6 +269,7 @@
SkIRect srcRect,
SkBackingFit fit,
SkBudgeted budgeted,
+ std::string_view label,
RectsMustMatch rectsMustMatch,
sk_sp<GrRenderTask>* outTask) {
SkASSERT(!src->isFullyLazy());
@@ -342,6 +343,7 @@
GrMipmapped mipmapped,
SkBackingFit fit,
SkBudgeted budgeted,
+ std::string_view label,
sk_sp<GrRenderTask>* outTask) {
SkASSERT(!src->isFullyLazy());
auto rect = SkIRect::MakeSize(src->dimensions());
@@ -352,6 +354,7 @@
rect,
fit,
budgeted,
+ label,
RectsMustMatch::kNo,
outTask);
}
diff --git a/src/gpu/ganesh/GrSurfaceProxy.h b/src/gpu/ganesh/GrSurfaceProxy.h
index dca406b..4ac5b46 100644
--- a/src/gpu/ganesh/GrSurfaceProxy.h
+++ b/src/gpu/ganesh/GrSurfaceProxy.h
@@ -325,6 +325,7 @@
SkIRect srcRect,
SkBackingFit,
SkBudgeted,
+ std::string_view label,
RectsMustMatch = RectsMustMatch::kNo,
sk_sp<GrRenderTask>* outTask = nullptr);
@@ -335,6 +336,7 @@
GrMipmapped,
SkBackingFit,
SkBudgeted,
+ std::string_view label,
sk_sp<GrRenderTask>* outTask = nullptr);
#if GR_TEST_UTILS
diff --git a/src/gpu/ganesh/GrSurfaceProxyView.h b/src/gpu/ganesh/GrSurfaceProxyView.h
index 2d76153..933e650 100644
--- a/src/gpu/ganesh/GrSurfaceProxyView.h
+++ b/src/gpu/ganesh/GrSurfaceProxyView.h
@@ -102,14 +102,16 @@
GrMipmapped mipmapped,
SkIRect srcRect,
SkBackingFit fit,
- SkBudgeted budgeted) {
+ SkBudgeted budgeted,
+ std::string_view label) {
auto copy = GrSurfaceProxy::Copy(context,
src.refProxy(),
src.origin(),
mipmapped,
srcRect,
fit,
- budgeted);
+ budgeted,
+ label);
return {std::move(copy), src.origin(), src.swizzle()};
}
@@ -117,13 +119,15 @@
GrSurfaceProxyView src,
GrMipmapped mipmapped,
SkBackingFit fit,
- SkBudgeted budgeted) {
+ SkBudgeted budgeted,
+ std::string_view label) {
auto copy = GrSurfaceProxy::Copy(rContext,
src.refProxy(),
src.origin(),
mipmapped,
fit,
- budgeted);
+ budgeted,
+ label);
return {std::move(copy), src.origin(), src.swizzle()};
}
diff --git a/src/gpu/ganesh/SkGr.cpp b/src/gpu/ganesh/SkGr.cpp
index 302ead5..43c6ebf 100644
--- a/src/gpu/ganesh/SkGr.cpp
+++ b/src/gpu/ganesh/SkGr.cpp
@@ -98,6 +98,7 @@
sk_sp<GrSurfaceProxy> GrCopyBaseMipMapToTextureProxy(GrRecordingContext* ctx,
sk_sp<GrSurfaceProxy> baseProxy,
GrSurfaceOrigin origin,
+ std::string_view label,
SkBudgeted budgeted) {
SkASSERT(baseProxy);
@@ -110,7 +111,7 @@
return nullptr;
}
auto copy = GrSurfaceProxy::Copy(ctx, std::move(baseProxy), origin, GrMipmapped::kYes,
- SkBackingFit::kExact, budgeted);
+ SkBackingFit::kExact, budgeted, label);
if (!copy) {
return nullptr;
}
@@ -124,7 +125,10 @@
auto origin = src.origin();
auto swizzle = src.swizzle();
auto proxy = src.refProxy();
- return {GrCopyBaseMipMapToTextureProxy(context, proxy, origin, budgeted), origin, swizzle};
+ return {GrCopyBaseMipMapToTextureProxy(
+ context, proxy, origin, /*label=*/"CopyBaseMipMapToView", budgeted),
+ origin,
+ swizzle};
}
static GrMipmapped adjust_mipmapped(GrMipmapped mipmapped,
@@ -169,6 +173,7 @@
std::tuple<GrSurfaceProxyView, GrColorType>
GrMakeCachedBitmapProxyView(GrRecordingContext* rContext,
const SkBitmap& bitmap,
+ std::string_view label,
GrMipmapped mipmapped) {
if (!bitmap.peekPixels(nullptr)) {
return {};
@@ -214,7 +219,8 @@
// We need a mipped proxy, but we found a proxy earlier that wasn't mipped. Thus we generate
// a new mipped surface and copy the original proxy into the base layer. We will then let
// the gpu generate the rest of the mips.
- auto mippedProxy = GrCopyBaseMipMapToTextureProxy(rContext, proxy, kTopLeft_GrSurfaceOrigin);
+ auto mippedProxy = GrCopyBaseMipMapToTextureProxy(
+ rContext, proxy, kTopLeft_GrSurfaceOrigin, /*label=*/"MakeCachedBitmapProxyView");
if (!mippedProxy) {
// We failed to make a mipped proxy with the base copied into it. This could have
// been from failure to make the proxy or failure to do the copy. Thus we will fall
@@ -386,7 +392,8 @@
// Pixel 4 Adreno640 500 110ms 221ms (2.01x) 214ms (1.95x)
// Galaxy S20 FE Mali-G77 MP11 600 165ms 360ms (2.18x) 260ms (1.58x)
static const SkBitmap gLUT = make_dither_lut();
- auto [tex, ct] = GrMakeCachedBitmapProxyView(rContext, gLUT, GrMipmapped::kNo);
+ auto [tex, ct] = GrMakeCachedBitmapProxyView(
+ rContext, gLUT, /*label=*/"MakeDitherEffect", GrMipmapped::kNo);
if (!tex) {
return inputFP;
}
diff --git a/src/gpu/ganesh/SkGr.h b/src/gpu/ganesh/SkGr.h
index 1ac6320..2946402 100644
--- a/src/gpu/ganesh/SkGr.h
+++ b/src/gpu/ganesh/SkGr.h
@@ -149,6 +149,7 @@
sk_sp<GrSurfaceProxy> GrCopyBaseMipMapToTextureProxy(GrRecordingContext*,
sk_sp<GrSurfaceProxy> baseProxy,
GrSurfaceOrigin origin,
+ std::string_view label,
SkBudgeted = SkBudgeted::kYes);
/**
* Same as GrCopyBaseMipMapToTextureProxy but takes the src as a view and returns a view with same
@@ -169,6 +170,7 @@
std::tuple<GrSurfaceProxyView, GrColorType>
GrMakeCachedBitmapProxyView(GrRecordingContext*,
const SkBitmap&,
+ std::string_view label,
GrMipmapped = GrMipmapped::kNo);
/**
diff --git a/src/gpu/ganesh/SurfaceContext.cpp b/src/gpu/ganesh/SurfaceContext.cpp
index 94e5acd..1096b62 100644
--- a/src/gpu/ganesh/SurfaceContext.cpp
+++ b/src/gpu/ganesh/SurfaceContext.cpp
@@ -190,7 +190,8 @@
this->origin(),
kMipMapped,
kFit,
- kBudgeted);
+ kBudgeted,
+ /*label=*/"SurfaceContext_ReadPixelsWithCopyWholeSrc");
} else {
auto srcRect = SkIRect::MakePtSize(pt, dst.dimensions());
copy = GrSurfaceProxy::Copy(fContext,
@@ -200,6 +201,7 @@
srcRect,
kFit,
kBudgeted,
+ /*label=*/"SurfaceContext_ReadPixels",
restrictions.fRectsMustMatch);
pt = {0, 0};
}
@@ -850,7 +852,8 @@
GrMipmapped::kNo,
srcRect,
SkBackingFit::kApprox,
- SkBudgeted::kYes);
+ SkBudgeted::kYes,
+ /*label=*/"SurfaceContext_AsyncRescaleAndReadPixelsYUV420");
if (!srcView) {
// If we can't get a texture copy of the contents then give up.
callback(callbackContext, nullptr);
@@ -1108,7 +1111,9 @@
// TODO: If copying supported specifying a renderable copy then we could return the copy
// when there are no other conversions.
texView = GrSurfaceProxyView::Copy(fContext, std::move(texView), GrMipmapped::kNo, srcRect,
- SkBackingFit::kApprox, SkBudgeted::kNo);
+ SkBackingFit::kApprox,
+ SkBudgeted::kNo,
+ /*label=*/"SurfaceContext_RescaleInto");
if (!texView) {
return false;
}
diff --git a/src/gpu/ganesh/gradients/GrGradientShader.cpp b/src/gpu/ganesh/gradients/GrGradientShader.cpp
index 6801242..8b7a16e 100644
--- a/src/gpu/ganesh/gradients/GrGradientShader.cpp
+++ b/src/gpu/ganesh/gradients/GrGradientShader.cpp
@@ -54,7 +54,8 @@
SkASSERT(1 == bitmap.height() && SkIsPow2(bitmap.width()));
SkASSERT(bitmap.isImmutable());
- auto view = std::get<0>(GrMakeCachedBitmapProxyView(args.fContext, bitmap, GrMipmapped::kNo));
+ auto view = std::get<0>(GrMakeCachedBitmapProxyView(
+ args.fContext, bitmap, /*label=*/"MakeTexturedColorizer", GrMipmapped::kNo));
if (!view) {
SkDebugf("Gradient won't draw. Could not create texture.");
return nullptr;
diff --git a/src/gpu/ganesh/v1/Device.cpp b/src/gpu/ganesh/v1/Device.cpp
index 4ddf88e..9869608 100644
--- a/src/gpu/ganesh/v1/Device.cpp
+++ b/src/gpu/ganesh/v1/Device.cpp
@@ -688,7 +688,8 @@
// TODO: this makes a tight copy of 'bitmap' but it doesn't have to be (given SkSpecialImage's
// semantics). Since this is cached we would have to bake the fit into the cache key though.
- auto view = std::get<0>(GrMakeCachedBitmapProxyView(fContext.get(), bitmap));
+ auto view = std::get<0>(
+ GrMakeCachedBitmapProxyView(fContext.get(), bitmap, /*label=*/"Device_MakeSpecial"));
if (!view) {
return nullptr;
}
@@ -756,7 +757,8 @@
GrMipmapped::kNo, // Don't auto generate mips
subset,
SkBackingFit::kApprox,
- SkBudgeted::kYes); // Always budgeted
+ SkBudgeted::kYes,
+ /*label=*/"Device_SnapSpecial"); // Always budgeted
if (!view) {
return nullptr;
}
diff --git a/src/gpu/ganesh/v1/SurfaceDrawContext.cpp b/src/gpu/ganesh/v1/SurfaceDrawContext.cpp
index 86af88d..3ea884d 100644
--- a/src/gpu/ganesh/v1/SurfaceDrawContext.cpp
+++ b/src/gpu/ganesh/v1/SurfaceDrawContext.cpp
@@ -2090,6 +2090,7 @@
copyRect,
fit,
SkBudgeted::kYes,
+ /*label=*/{},
restrictions.fRectsMustMatch);
SkASSERT(copy);
diff --git a/src/image/SkImage_Base.h b/src/image/SkImage_Base.h
index 07a284464..c92dad9 100644
--- a/src/image/SkImage_Base.h
+++ b/src/image/SkImage_Base.h
@@ -189,7 +189,8 @@
static GrSurfaceProxyView CopyView(GrRecordingContext*,
GrSurfaceProxyView src,
GrMipmapped,
- GrImageTexGenPolicy);
+ GrImageTexGenPolicy,
+ std::string_view label);
static std::unique_ptr<GrFragmentProcessor> MakeFragmentProcessorFromView(GrRecordingContext*,
GrSurfaceProxyView,
@@ -256,7 +257,8 @@
inline GrSurfaceProxyView SkImage_Base::CopyView(GrRecordingContext* context,
GrSurfaceProxyView src,
GrMipmapped mipmapped,
- GrImageTexGenPolicy policy) {
+ GrImageTexGenPolicy policy,
+ std::string_view label) {
SkBudgeted budgeted = policy == GrImageTexGenPolicy::kNew_Uncached_Budgeted
? SkBudgeted::kYes
: SkBudgeted::kNo;
@@ -264,7 +266,8 @@
std::move(src),
mipmapped,
SkBackingFit::kExact,
- budgeted);
+ budgeted,
+ /*label=*/label);
}
#endif
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp
index 5de41b1..ef43f3f 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -198,6 +198,7 @@
mm,
SkBackingFit::kExact,
SkBudgeted::kYes,
+ /*label=*/"ImageGpu_MakeWithVolatileSrc",
©Task);
if (!copy) {
return nullptr;
@@ -846,7 +847,11 @@
return {};
}
if (policy != GrImageTexGenPolicy::kDraw) {
- return {CopyView(recordingContext, this->makeView(recordingContext), mipmapped, policy),
+ return {CopyView(recordingContext,
+ this->makeView(recordingContext),
+ mipmapped,
+ policy,
+ /*label=*/"SkImageGpu_AsView"),
SkColorTypeToGrColorType(this->colorType())};
}
GrSurfaceProxyView view = this->makeView(recordingContext);
diff --git a/src/image/SkImage_GpuBase.cpp b/src/image/SkImage_GpuBase.cpp
index 8e892ea..6fba183 100644
--- a/src/image/SkImage_GpuBase.cpp
+++ b/src/image/SkImage_GpuBase.cpp
@@ -145,7 +145,8 @@
GrMipmapped::kNo,
subset,
SkBackingFit::kExact,
- isBudgeted);
+ isBudgeted,
+ /*label=*/"ImageGpuBase_MakeSubset");
if (!copyView) {
return nullptr;
diff --git a/src/image/SkImage_Raster.cpp b/src/image/SkImage_Raster.cpp
index 015519e..5feb288 100644
--- a/src/image/SkImage_Raster.cpp
+++ b/src/image/SkImage_Raster.cpp
@@ -236,9 +236,11 @@
} else {
SkASSERT(fPinnedCount == 0);
SkASSERT(fPinnedUniqueID == 0);
- std::tie(fPinnedView, fPinnedColorType) = GrMakeCachedBitmapProxyView(rContext,
- fBitmap,
- GrMipmapped::kNo);
+ std::tie(fPinnedView, fPinnedColorType) =
+ GrMakeCachedBitmapProxyView(rContext,
+ fBitmap,
+ /*label=*/"SkImageRaster_PinAsTexture",
+ GrMipmapped::kNo);
if (!fPinnedView) {
fPinnedColorType = GrColorType::kUnknown;
return false;
@@ -450,7 +452,12 @@
// if mipmapping is desired (skbug.com/10411)
mipmapped = GrMipmapped::kNo;
if (policy != GrImageTexGenPolicy::kDraw) {
- return {CopyView(rContext, fPinnedView, mipmapped, policy), fPinnedColorType};
+ return {CopyView(rContext,
+ fPinnedView,
+ mipmapped,
+ policy,
+ /*label=*/"TextureForImageRasterWithPolicyNotEqualKDraw"),
+ fPinnedColorType};
}
return {fPinnedView, fPinnedColorType};
}
@@ -462,7 +469,10 @@
if (this->hasMipmaps()) {
mipmapped = GrMipmapped::kYes;
}
- return GrMakeCachedBitmapProxyView(rContext, fBitmap, mipmapped);
+ return GrMakeCachedBitmapProxyView(rContext,
+ fBitmap,
+ /*label=*/"TextureForImageRasterWithPolicyEqualKDraw",
+ mipmapped);
}
auto budgeted = (policy == GrImageTexGenPolicy::kNew_Uncached_Unbudgeted)
? SkBudgeted::kNo
diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp
index 19714bd..1ba0e01 100644
--- a/src/image/SkSurface_Gpu.cpp
+++ b/src/image/SkSurface_Gpu.cpp
@@ -132,8 +132,13 @@
}
auto rect = subset ? *subset : SkIRect::MakeSize(srcView.dimensions());
GrMipmapped mipmapped = srcView.mipmapped();
- srcView = GrSurfaceProxyView::Copy(rContext, std::move(srcView), mipmapped, rect,
- SkBackingFit::kExact, budgeted);
+ srcView = GrSurfaceProxyView::Copy(rContext,
+ std::move(srcView),
+ mipmapped,
+ rect,
+ SkBackingFit::kExact,
+ budgeted,
+ /*label=*/"SurfaceGpu_NewImageSnapshot");
}
const SkImageInfo info = fDevice->imageInfo();
diff --git a/src/shaders/SkPerlinNoiseShader.cpp b/src/shaders/SkPerlinNoiseShader.cpp
index 2a629fd..679354d 100644
--- a/src/shaders/SkPerlinNoiseShader.cpp
+++ b/src/shaders/SkPerlinNoiseShader.cpp
@@ -955,8 +955,12 @@
const SkBitmap& permutationsBitmap = paintingData->getPermutationsBitmap();
const SkBitmap& noiseBitmap = paintingData->getNoiseBitmap();
- auto permutationsView = std::get<0>(GrMakeCachedBitmapProxyView(context, permutationsBitmap));
- auto noiseView = std::get<0>(GrMakeCachedBitmapProxyView(context, noiseBitmap));
+ auto permutationsView = std::get<0>(GrMakeCachedBitmapProxyView(
+ context,
+ permutationsBitmap,
+ /*label=*/"PerlinNoiseShader_FragmentProcessor_PermutationsView"));
+ auto noiseView = std::get<0>(GrMakeCachedBitmapProxyView(
+ context, noiseBitmap, /*label=*/"PerlinNoiseShader_FragmentProcessor_NoiseView"));
if (permutationsView && noiseView) {
return GrPerlinNoise2Effect::Make(fType,
diff --git a/tests/MtlCopySurfaceTest.mm b/tests/MtlCopySurfaceTest.mm
index 9236664..20bf5fb 100644
--- a/tests/MtlCopySurfaceTest.mm
+++ b/tests/MtlCopySurfaceTest.mm
@@ -50,7 +50,8 @@
kTopLeft_GrSurfaceOrigin,
GrMipmapped::kNo,
SkBackingFit::kExact,
- SkBudgeted::kYes);
+ SkBudgeted::kYes,
+ /*label=*/{});
// TODO: GrSurfaceProxy::Copy doesn't check to see if the framebufferOnly bit is set yet.
// Update this when it does -- it should fail.
diff --git a/tests/TestUtils.cpp b/tests/TestUtils.cpp
index 88fb250..6912dbc 100644
--- a/tests/TestUtils.cpp
+++ b/tests/TestUtils.cpp
@@ -89,8 +89,13 @@
GrColorType colorType,
uint32_t expectedPixelValues[],
const char* testName) {
- auto copy = GrSurfaceProxy::Copy(dContext, std::move(proxy), origin, GrMipmapped::kNo,
- SkBackingFit::kExact, SkBudgeted::kYes);
+ auto copy = GrSurfaceProxy::Copy(dContext,
+ std::move(proxy),
+ origin,
+ GrMipmapped::kNo,
+ SkBackingFit::kExact,
+ SkBudgeted::kYes,
+ /*label=*/"CopyFromSurface_Test");
SkASSERT(copy && copy->asTextureProxy());
auto swizzle = dContext->priv().caps()->getReadSwizzle(copy->backendFormat(), colorType);
GrSurfaceProxyView view(std::move(copy), origin, swizzle);