Revert "Remove GrBackendFormat's textureType use from isFormatTexturable call."
This reverts commit 832c817bc8a9567aa379181e71e7c602d2480de8.
Reason for revert: uninitialized value in GrBackendTexture
Original change's description:
> Remove GrBackendFormat's textureType use from isFormatTexturable call.
>
> The goal of this change was to remove the use of GrBackendFormat::textureType()
> from GrCaps::isFormatTexturable call. Instead we will always pass in a
> GrTextureType into this call.
>
> To do this a lot of plumbing of GrTextureType was added to various call
> sites. However, this CL halts the plubming up at the proxy level where we
> get it from the GrBackendFormat still. Future CLs will continue removing
> these call sites and others that use GrBackendFormat::textureType().
>
> Bug: skia:12342
> Change-Id: Ic0f02b9c7f7402405623b8aa31aa32a9a7c22297
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439277
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=egdaniel@google.com,bsalomon@google.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com
Change-Id: I354bbbf00be7a86c480009f3e7b36a8777a6bf3a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:12342
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439338
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/GrProxyProvider.cpp b/src/gpu/GrProxyProvider.cpp
index a05e84a..8eb66f2 100644
--- a/src/gpu/GrProxyProvider.cpp
+++ b/src/gpu/GrProxyProvider.cpp
@@ -142,21 +142,11 @@
sk_sp<GrTexture> tex;
if (SkBackingFit::kApprox == fit) {
- tex = resourceProvider->createApproxTexture(dimensions,
- format,
- format.textureType(),
- renderable,
- renderTargetSampleCnt,
- isProtected);
+ tex = resourceProvider->createApproxTexture(dimensions, format, renderable,
+ renderTargetSampleCnt, isProtected);
} else {
- tex = resourceProvider->createTexture(dimensions,
- format,
- format.textureType(),
- renderable,
- renderTargetSampleCnt,
- GrMipmapped::kNo,
- budgeted,
- isProtected);
+ tex = resourceProvider->createTexture(dimensions, format, renderable, renderTargetSampleCnt,
+ GrMipmapped::kNo, budgeted, isProtected);
}
if (!tex) {
return nullptr;
@@ -337,16 +327,8 @@
GrMipLevel mipLevel = {bitmap.getPixels(), bitmap.rowBytes(), nullptr};
auto colorType = SkColorTypeToGrColorType(bitmap.colorType());
return LazyCallbackResult(resourceProvider->createTexture(
- desc.fDimensions,
- desc.fFormat,
- desc.fFormat.textureType(),
- colorType,
- desc.fRenderable,
- desc.fSampleCnt,
- desc.fBudgeted,
- desc.fFit,
- desc.fProtected,
- mipLevel));
+ desc.fDimensions, desc.fFormat, colorType, desc.fRenderable,
+ desc.fSampleCnt, desc.fBudgeted, desc.fFit, desc.fProtected, mipLevel));
},
format, dims, GrMipmapped::kNo, GrMipmapStatus::kNotAllocated,
GrInternalSurfaceFlags::kNone, fit, budgeted, GrProtected::kNo, UseAllocator::kYes);
@@ -393,16 +375,8 @@
SkASSERT(generatedMipLevel.fPixmap.colorType() == bitmap.colorType());
}
return LazyCallbackResult(resourceProvider->createTexture(
- desc.fDimensions,
- desc.fFormat,
- desc.fFormat.textureType(),
- colorType,
- GrRenderable::kNo,
- 1,
- desc.fBudgeted,
- GrMipMapped::kYes,
- GrProtected::kNo,
- texels.get()));
+ desc.fDimensions, desc.fFormat, colorType, GrRenderable::kNo, 1,
+ desc.fBudgeted, GrMipMapped::kYes, GrProtected::kNo, texels.get()));
},
format, dims, GrMipmapped::kYes, GrMipmapStatus::kValid, GrInternalSurfaceFlags::kNone,
SkBackingFit::kExact, budgeted, GrProtected::kNo, UseAllocator::kYes);
@@ -446,12 +420,8 @@
}
}
- if (!caps->validateSurfaceParams(dimensions,
- format,
- renderable,
- renderTargetSampleCnt,
- mipMapped,
- GrTextureType::k2D)) {
+ if (!caps->validateSurfaceParams(dimensions, format, renderable, renderTargetSampleCnt,
+ mipMapped)) {
return nullptr;
}
GrMipmapStatus mipmapStatus = (GrMipmapped::kYes == mipMapped)
@@ -484,7 +454,7 @@
GrBackendFormat format = this->caps()->getBackendFormatFromCompressionType(compressionType);
- if (!this->caps()->isFormatTexturable(format, GrTextureType::k2D)) {
+ if (!this->caps()->isFormatTexturable(format)) {
return nullptr;
}