diff options
author | Peiyong Lin <lpy@google.com> | 2018-12-11 07:56:07 -0800 |
---|---|---|
committer | Peiyong Lin <lpy@google.com> | 2018-12-15 09:35:25 -0800 |
commit | 3bff13550380f02e30f1ae77f2497d9ec89b0ec4 (patch) | |
tree | 75b2fb1ce48d7a93fa4d5e0bf5a0db31f9ab8d64 /libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp | |
parent | 78c2a0de5793fd997ee716de7f4845bfa7c6a7c3 (diff) |
[HWUI] Remove hardcoding around wide color gamut.
Previously we hardcode wide color gamut in HWUI as scRGB color space with FP16
pixel format. However, the hardware composer doesn't support this combination.
This patch plumbs wide color gamut composition preference from composer API to
HWUI such that HWUI can now pick the combination of color space and pixel
format for the surface.
BUG: 111436479
Test: Build, flash and boot, verify with a demo app.
Change-Id: I7a8b4d8deca72ef40069dba9d23a3f5e90dbfe5a
Diffstat (limited to 'libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp')
-rw-r--r-- | libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp b/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp index 07979a22c988..4338b1cc2a21 100644 --- a/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp +++ b/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp @@ -162,22 +162,17 @@ bool SkiaOpenGLPipeline::setSurface(ANativeWindow* surface, SwapBehavior swapBeh mEglSurface = EGL_NO_SURFACE; } + setSurfaceColorProperties(colorMode); + if (surface) { mRenderThread.requireGlContext(); - auto newSurface = mEglManager.createSurface(surface, colorMode); + auto newSurface = mEglManager.createSurface(surface, colorMode, mSurfaceColorGamut); if (!newSurface) { return false; } mEglSurface = newSurface.unwrap(); } - if (colorMode == ColorMode::SRGB) { - mSurfaceColorType = SkColorType::kN32_SkColorType; - } else if (colorMode == ColorMode::WideColorGamut) { - mSurfaceColorType = SkColorType::kRGBA_F16_SkColorType; - } - mSurfaceColorSpace = SkColorSpace::MakeSRGB(); - if (mEglSurface != EGL_NO_SURFACE) { const bool preserveBuffer = (swapBehavior != SwapBehavior::kSwap_discardBuffer); mBufferPreserved = mEglManager.setPreserveBuffer(mEglSurface, preserveBuffer); |