From fb0c8fc3d5413a3ec357680d85084a17bb9ef64f Mon Sep 17 00:00:00 2001 From: Derek Sollenberger Date: Wed, 26 Jul 2017 13:53:27 -0400 Subject: Enable colorspace conversion while perserving legacy blending. When requesting an SkImage from a android::Bitmap we will also return a colorFilter that will perform the sRGB conversion at draw time. Bug: 62347704 Test: CtsUiRenderingTestCases, CtsGraphicsTestCases, CtsViewTestCases Change-Id: Icc4694e2c42605e29fcc834c252bc21263bac658 --- libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp') diff --git a/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp b/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp index bf774460f04e..5f8ee180bd09 100644 --- a/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp +++ b/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp @@ -305,12 +305,6 @@ sk_sp SkiaOpenGLPipeline::allocateHardwareBitmap(renderthread::RenderThr return nullptr; } - auto colorSpace = info.colorSpace(); - bool convertToSRGB = false; - if (colorSpace && (!colorSpace->isSRGB())) { - isSupported = false; - convertToSRGB = true; - } SkBitmap bitmap; if (isSupported) { @@ -319,7 +313,7 @@ sk_sp SkiaOpenGLPipeline::allocateHardwareBitmap(renderthread::RenderThr bitmap.allocPixels(SkImageInfo::MakeN32(info.width(), info.height(), info.alphaType(), nullptr)); bitmap.eraseColor(0); - if (info.colorType() == kRGBA_F16_SkColorType || convertToSRGB) { + if (info.colorType() == kRGBA_F16_SkColorType) { // Drawing RGBA_F16 onto ARGB_8888 is not supported skBitmap.readPixels(bitmap.info().makeColorSpace(SkColorSpace::MakeSRGB()), bitmap.getPixels(), bitmap.rowBytes(), 0, 0); -- cgit v1.2.3