diff options
author | Brian Osman <brianosman@google.com> | 2018-10-16 10:18:26 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-10-16 17:40:58 +0000 |
commit | 9c11135400e529e6bdd35a59417d38804e5bf5ae (patch) | |
tree | 6e30a588488d98e84aff7f055a90038e5b9226df /src/image | |
parent | 016d9b098c4c9d2434a89a9714f427a47c3493b3 (diff) | |
download | skqp-9c11135400e529e6bdd35a59417d38804e5bf5ae.tar.gz |
Reland "Preserve pixel config in makeColorSpace of GPU backed images"
Adding 8888 fallback for F16 pixel config to fix cc unit test failures.
Bug: skia:
Change-Id: I22d5442f4831e95a54fe3fff63afb49a5e639d8f
Reviewed-on: https://skia-review.googlesource.com/c/162542
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/image')
-rw-r--r-- | src/image/SkImage_GpuBase.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/image/SkImage_GpuBase.cpp b/src/image/SkImage_GpuBase.cpp index 66f91e3cee..27bb2d8f70 100644 --- a/src/image/SkImage_GpuBase.cpp +++ b/src/image/SkImage_GpuBase.cpp @@ -260,17 +260,18 @@ sk_sp<SkImage> SkImage_GpuBase::onMakeColorSpace(sk_sp<SkColorSpace> target) con return sk_ref_sp(const_cast<SkImage_GpuBase*>(this)); } + sk_sp<GrTextureProxy> proxy = this->asTextureProxyRef(); + sk_sp<GrRenderTargetContext> renderTargetContext( - fContext->contextPriv().makeDeferredRenderTargetContext( - SkBackingFit::kExact, this->width(), this->height(), - kRGBA_8888_GrPixelConfig, nullptr)); + fContext->contextPriv().makeDeferredRenderTargetContextWithFallback( + SkBackingFit::kExact, this->width(), this->height(), proxy->config(), nullptr)); if (!renderTargetContext) { return nullptr; } GrPaint paint; paint.setPorterDuffXPFactory(SkBlendMode::kSrc); - paint.addColorTextureProcessor(this->asTextureProxyRef(), SkMatrix::I()); + paint.addColorTextureProcessor(std::move(proxy), SkMatrix::I()); paint.addColorFragmentProcessor(std::move(xform)); const SkRect rect = SkRect::MakeIWH(this->width(), this->height()); |