Index: src/gpu/GrTextureParamsAdjuster.cpp |
diff --git a/src/gpu/GrTextureParamsAdjuster.cpp b/src/gpu/GrTextureParamsAdjuster.cpp |
index 68a6f9907041abe8fc62ad54dc2b91bb9371aeb2..3ca90f5adb0a6e433743f9f2d9b406adb0021487 100644 |
--- a/src/gpu/GrTextureParamsAdjuster.cpp |
+++ b/src/gpu/GrTextureParamsAdjuster.cpp |
@@ -33,35 +33,13 @@ static GrTexture* copy_on_gpu(GrTexture* inputTexture, const SkIRect* subset, |
SkASSERT(!subset || !subset->isEmpty()); |
GrContext* context = inputTexture->getContext(); |
SkASSERT(context); |
- const GrCaps* caps = context->caps(); |
GrPixelConfig config = GrMakePixelConfigUncompressed(inputTexture->config()); |
- // If the config isn't renderable try converting to either A8 or an 32 bit config. Otherwise, |
- // fail. |
- if (!caps->isConfigRenderable(config, false)) { |
- if (GrPixelConfigIsAlphaOnly(config)) { |
- if (caps->isConfigRenderable(kAlpha_8_GrPixelConfig, false)) { |
- config = kAlpha_8_GrPixelConfig; |
- } else if (caps->isConfigRenderable(kSkia8888_GrPixelConfig, false)) { |
- config = kSkia8888_GrPixelConfig; |
- } else { |
- return nullptr; |
- } |
- } else if (kRGB_GrColorComponentFlags == |
- (kRGB_GrColorComponentFlags & GrPixelConfigComponentMask(config))) { |
- if (caps->isConfigRenderable(kSkia8888_GrPixelConfig, false)) { |
- config = kSkia8888_GrPixelConfig; |
- } else { |
- return nullptr; |
- } |
- } else { |
- return nullptr; |
- } |
- } |
- |
- sk_sp<GrDrawContext> copyDC = context->makeDrawContext(SkBackingFit::kExact, copyParams.fWidth, |
- copyParams.fHeight, config, nullptr); |
+ sk_sp<GrDrawContext> copyDC = context->makeDrawContextWithFallback(SkBackingFit::kExact, |
+ copyParams.fWidth, |
+ copyParams.fHeight, |
+ config, nullptr); |
if (!copyDC) { |
return nullptr; |
} |