Convert 565 and 4444 bitmaps to 8888 for Mac Metal.
Fixes a large number of GMs. Bug: skia:8243 Change-Id: I8053ac218d894205d36a3a3cdc8b7a7ea2e27e71 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208320 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
This commit is contained in:
parent
8c4cafd297
commit
c809832930
@ -217,11 +217,7 @@ sk_sp<GrTextureProxy> GrProxyProvider::createTextureProxy(sk_sp<SkImage> srcImag
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
GrBackendFormat format = this->caps()->getBackendFormatFromColorType(info.colorType());
|
||||
if (!format.isValid()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
SkColorType ct = info.colorType();
|
||||
if (!this->caps()->isConfigTexturable(config)) {
|
||||
SkBitmap copy8888;
|
||||
if (!copy8888.tryAllocPixels(info.makeColorType(kRGBA_8888_SkColorType)) ||
|
||||
@ -231,6 +227,12 @@ sk_sp<GrTextureProxy> GrProxyProvider::createTextureProxy(sk_sp<SkImage> srcImag
|
||||
copy8888.setImmutable();
|
||||
srcImage = SkMakeImageFromRasterBitmap(copy8888, kNever_SkCopyPixelsMode);
|
||||
config = kRGBA_8888_GrPixelConfig;
|
||||
ct = kRGBA_8888_SkColorType;
|
||||
}
|
||||
|
||||
GrBackendFormat format = this->caps()->getBackendFormatFromColorType(ct);
|
||||
if (!format.isValid()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (SkToBool(descFlags & kRenderTarget_GrSurfaceFlag)) {
|
||||
|
Loading…
Reference in New Issue
Block a user