Add rowBytes to createTestingOnlyBackendTexture
This is pulled out of:
https://skia-review.googlesource.com/c/skia/+/151983 (Test YUV images in DDL)
The YUV images seem to like to have row padding.
Change-Id: I517d2b63678beeafef88f86148fca15862176780
Reviewed-on: https://skia-review.googlesource.com/156367
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp
index 2f6205c..d956e08 100644
--- a/tests/SurfaceTest.cpp
+++ b/tests/SurfaceTest.cpp
@@ -685,7 +685,7 @@
sk_memset32(pixels.get(), color, kWidth * kHeight);
*outTexture = gpu->createTestingOnlyBackendTexture(
- pixels.get(), kWidth, kHeight, kRGBA_8888_GrPixelConfig, true, GrMipMapped::kNo);
+ pixels.get(), kWidth, kHeight, GrColorType::kRGBA_8888, true, GrMipMapped::kNo);
if (!outTexture->isValid() || !gpu->isTestingOnlyBackendTexture(*outTexture)) {
return nullptr;
@@ -712,7 +712,7 @@
sk_memset32(pixels.get(), color, kWidth * kHeight);
*outTexture = gpu->createTestingOnlyBackendTexture(
- pixels.get(), kWidth, kHeight, kRGBA_8888_GrPixelConfig, true, GrMipMapped::kNo);
+ pixels.get(), kWidth, kHeight, GrColorType::kRGBA_8888, true, GrMipMapped::kNo, 0);
if (!outTexture->isValid() || !gpu->isTestingOnlyBackendTexture(*outTexture)) {
return nullptr;
@@ -994,11 +994,9 @@
GrGpu* gpu = context->contextPriv().getGpu();
static const int kSize = 10;
- GrPixelConfig config = SkImageInfo2GrPixelConfig(info);
- SkASSERT(kUnknown_GrPixelConfig != config);
GrBackendTexture backendTex = gpu->createTestingOnlyBackendTexture(
- nullptr, kSize, kSize, config, true, GrMipMapped::kNo);
+ nullptr, kSize, kSize, info.colorType(), true, GrMipMapped::kNo);
if (!backendTex.isValid() ||
!gpu->isTestingOnlyBackendTexture(backendTex)) {