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/renderthread/EglManager.h | |
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/renderthread/EglManager.h')
-rw-r--r-- | libs/hwui/renderthread/EglManager.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/libs/hwui/renderthread/EglManager.h b/libs/hwui/renderthread/EglManager.h index 2a44f7e10b80..4dd90961b4f7 100644 --- a/libs/hwui/renderthread/EglManager.h +++ b/libs/hwui/renderthread/EglManager.h @@ -48,7 +48,8 @@ public: bool hasEglContext(); - Result<EGLSurface, EGLint> createSurface(EGLNativeWindowType window, ColorMode colorMode); + Result<EGLSurface, EGLint> createSurface(EGLNativeWindowType window, ColorMode colorMode, + SkColorSpace::Gamut colorGamut); void destroySurface(EGLSurface surface); void destroy(); @@ -80,6 +81,14 @@ public: status_t createReleaseFence(bool useFenceSync, EGLSyncKHR* eglFence, sp<Fence>& nativeFence); private: + enum class SwapBehavior { + Discard, + Preserved, + BufferAge, + }; + + static EGLConfig load8BitsConfig(EGLDisplay display, SwapBehavior swapBehavior); + static EGLConfig loadFP16Config(EGLDisplay display, SwapBehavior swapBehavior); void initExtensions(); void createPBufferSurface(); @@ -93,12 +102,7 @@ private: EGLContext mEglContext; EGLSurface mPBufferSurface; EGLSurface mCurrentSurface; - - enum class SwapBehavior { - Discard, - Preserved, - BufferAge, - }; + bool mHasWideColorGamutSupport; SwapBehavior mSwapBehavior = SwapBehavior::Discard; }; |