aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrSurfaceContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/GrSurfaceContext.cpp')
-rw-r--r--src/gpu/GrSurfaceContext.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gpu/GrSurfaceContext.cpp b/src/gpu/GrSurfaceContext.cpp
index ab6c05a375..37d0b71fb0 100644
--- a/src/gpu/GrSurfaceContext.cpp
+++ b/src/gpu/GrSurfaceContext.cpp
@@ -49,7 +49,8 @@ bool GrSurfaceContext::readPixels(const SkImageInfo& dstInfo, void* dstBuffer,
GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrSurfaceContext::readPixels");
// TODO: this seems to duplicate code in SkImage_Gpu::onReadPixels
- if (kUnpremul_SkAlphaType == dstInfo.alphaType()) {
+ if (kUnpremul_SkAlphaType == dstInfo.alphaType() &&
+ !GrPixelConfigIsOpaque(this->asSurfaceProxy()->config())) {
flags |= GrContextPriv::kUnpremul_PixelOpsFlag;
}
auto colorType = SkColorTypeToGrColorType(dstInfo.colorType());