summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/OpenGLPipeline.cpp
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2017-04-17 09:39:51 -0700
committerRomain Guy <romainguy@google.com>2017-06-02 11:02:13 -0700
commit26a2b97dbe48ee45e9ae70110714048f2f360f97 (patch)
tree1e8e25d446c598d0b552708c90878246a370ba42 /libs/hwui/renderthread/OpenGLPipeline.cpp
parent3b3388ca64a818f2c036cf0dbf02a9e011ccc8de (diff)
Enable wide color gamut rendering
When wide color gamut rendering is requested, hwui will now use an rgba16f scRGB-nl surface for rendering. This change also fixes the way screenshots are handled in the platform to behave properly with wide gamut rendering. This change does not affect hardware layers. They also need to use rgba16f scRGB-nl; this will be addressed in another CL. Bug: 29940137 Test: CtsUiRenderingTestCases, CtsGraphicsTestCases Change-Id: I68fd96c451652136c566ec48fb0e97c2a7a257c5
Diffstat (limited to 'libs/hwui/renderthread/OpenGLPipeline.cpp')
-rw-r--r--libs/hwui/renderthread/OpenGLPipeline.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/libs/hwui/renderthread/OpenGLPipeline.cpp b/libs/hwui/renderthread/OpenGLPipeline.cpp
index e1ae58532a02..9631fd651016 100644
--- a/libs/hwui/renderthread/OpenGLPipeline.cpp
+++ b/libs/hwui/renderthread/OpenGLPipeline.cpp
@@ -146,7 +146,7 @@ void OpenGLPipeline::onStop() {
}
}
-bool OpenGLPipeline::setSurface(Surface* surface, SwapBehavior swapBehavior) {
+bool OpenGLPipeline::setSurface(Surface* surface, SwapBehavior swapBehavior, ColorMode colorMode) {
if (mEglSurface != EGL_NO_SURFACE) {
mEglManager.destroySurface(mEglSurface);
@@ -154,7 +154,8 @@ bool OpenGLPipeline::setSurface(Surface* surface, SwapBehavior swapBehavior) {
}
if (surface) {
- mEglSurface = mEglManager.createSurface(surface);
+ const bool wideColorGamut = colorMode == ColorMode::WideColorGamut;
+ mEglSurface = mEglManager.createSurface(surface, wideColorGamut);
}
if (mEglSurface != EGL_NO_SURFACE) {