Reland "Reland "Separate compressed and uncompressed texture functions""
This is a reland of c0519233cdd2545a938848336c7d470bfe27fa96
Original change's description:
> Reland "Separate compressed and uncompressed texture functions"
>
> This is a reland of 9acfb33ad8c6f5fc6097dff57c0de5e51ea590fd
>
> Original change's description:
> > Separate compressed and uncompressed texture functions
> >
> > Change-Id: Iccf31e1e4dbebde8aab4bb9b57cfb0341bb05912
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223802
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
>
> Change-Id: I9f212b7d34cf43216f7d2ec63b959b75fd6a71b3
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223992
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
Change-Id: I0654a49dadfb56ad276051c8632b91da05bf24cd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/224181
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/mock/GrMockGpu.cpp b/src/gpu/mock/GrMockGpu.cpp
index f0355e5..e8c1899 100644
--- a/src/gpu/mock/GrMockGpu.cpp
+++ b/src/gpu/mock/GrMockGpu.cpp
@@ -106,6 +106,25 @@
return sk_sp<GrTexture>(new GrMockTexture(this, budgeted, desc, mipMapsStatus, texInfo));
}
+sk_sp<GrTexture> GrMockGpu::onCreateCompressedTexture(int width, int height,
+ SkImage::CompressionType compressionType,
+ SkBudgeted budgeted, const void* data) {
+ if (fMockOptions.fFailTextureAllocations) {
+ return nullptr;
+ }
+ GrBackendFormat format = this->caps()->getBackendFormatFromCompressionType(compressionType);
+
+ GrMockTextureInfo texInfo;
+ texInfo.fConfig = *format.getMockFormat();
+ texInfo.fID = NextInternalTextureID();
+ GrSurfaceDesc desc;
+ desc.fConfig = texInfo.fConfig;
+ desc.fWidth = width;
+ desc.fHeight = height;
+ return sk_sp<GrTexture>(
+ new GrMockTexture(this, budgeted, desc, GrMipMapsStatus::kNotAllocated, texInfo));
+}
+
sk_sp<GrTexture> GrMockGpu::onWrapBackendTexture(const GrBackendTexture& tex,
GrWrapOwnership ownership,
GrWrapCacheable wrapType, GrIOType ioType) {