Make isFormatTexturable take a GrColorType.
Change-Id: I02db9025c49d9ee2d805dd6b48916bcc4136f9a8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225729
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/GrProxyProvider.cpp b/src/gpu/GrProxyProvider.cpp
index d71cf7a..24bcb0a 100644
--- a/src/gpu/GrProxyProvider.cpp
+++ b/src/gpu/GrProxyProvider.cpp
@@ -211,13 +211,14 @@
const SkImageInfo& info = srcImage->imageInfo();
SkColorType ct = info.colorType();
+ GrColorType grCT = SkColorTypeToGrColorType(ct);
GrBackendFormat format = this->caps()->getBackendFormatFromColorType(ct);
if (!format.isValid()) {
return nullptr;
}
- if (!this->caps()->isFormatTexturable(ct, format)) {
+ if (!this->caps()->isFormatTexturable(grCT, format)) {
SkBitmap copy8888;
if (!copy8888.tryAllocPixels(info.makeColorType(kRGBA_8888_SkColorType)) ||
!srcImage->readPixels(copy8888.pixmap(), 0, 0)) {
@@ -331,13 +332,14 @@
}
SkColorType colorType = bitmap.info().colorType();
+ GrColorType grColorType = SkColorTypeToGrColorType(colorType);
GrBackendFormat format = this->caps()->getBackendFormatFromColorType(colorType);
if (!format.isValid()) {
return nullptr;
}
GrSurfaceDesc desc = GrImageInfoToSurfaceDesc(bitmap.info());
- if (!this->caps()->isFormatTexturable(colorType, format)) {
+ if (!this->caps()->isFormatTexturable(grColorType, format)) {
SkBitmap copy8888;
if (!copy8888.tryAllocPixels(bitmap.info().makeColorType(kRGBA_8888_SkColorType)) ||
!bitmap.readPixels(copy8888.pixmap())) {