diff options
| -rw-r--r-- | opengl/libs/EGL/eglApi.cpp | 9 | ||||
| -rw-r--r-- | services/surfaceflinger/ContainerLayer.cpp | 4 | ||||
| -rw-r--r-- | services/surfaceflinger/ContainerLayer.h | 2 |
3 files changed, 14 insertions, 1 deletions
diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp index e824238ac3..36deedcb85 100644 --- a/opengl/libs/EGL/eglApi.cpp +++ b/opengl/libs/EGL/eglApi.cpp @@ -552,6 +552,15 @@ static EGLBoolean processAttributes(egl_display_ptr dp, NativeWindowType window, break; } } + + // If the driver doesn't understand it, we should map sRGB-encoded P3 to + // sRGB rather than just dropping the colorspace on the floor. + // For this format, the driver is expected to apply the sRGB + // transfer function during framebuffer operations. + if (!copyAttribute && attr[1] == EGL_GL_COLORSPACE_DISPLAY_P3_EXT) { + strippedAttribList->push_back(attr[0]); + strippedAttribList->push_back(EGL_GL_COLORSPACE_SRGB_KHR); + } } if (copyAttribute) { strippedAttribList->push_back(attr[0]); diff --git a/services/surfaceflinger/ContainerLayer.cpp b/services/surfaceflinger/ContainerLayer.cpp index 6f5bd0e3a4..f259d93c3f 100644 --- a/services/surfaceflinger/ContainerLayer.cpp +++ b/services/surfaceflinger/ContainerLayer.cpp @@ -30,6 +30,10 @@ ContainerLayer::ContainerLayer(SurfaceFlinger* flinger, const sp<Client>& client void ContainerLayer::onDraw(const RenderArea&, const Region& /* clip */, bool) const {} +bool ContainerLayer::isVisible() const { + return !isHiddenByPolicy(); +} + void ContainerLayer::setPerFrameData(const sp<const DisplayDevice>&) {} } // namespace android diff --git a/services/surfaceflinger/ContainerLayer.h b/services/surfaceflinger/ContainerLayer.h index 38b1882e06..b352b96762 100644 --- a/services/surfaceflinger/ContainerLayer.h +++ b/services/surfaceflinger/ContainerLayer.h @@ -32,7 +32,7 @@ public: const char* getTypeId() const override { return "ContainerLayer"; } void onDraw(const RenderArea& renderArea, const Region& clip, bool useIdentityTransform) const override; - bool isVisible() const override { return false; } + bool isVisible() const override; void setPerFrameData(const sp<const DisplayDevice>& displayDevice) override; |