summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-06-06 07:25:09 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-06-06 07:25:09 +0000
commit4c798c91fdc99b8b4a111fa6f7e569f3bfbecf25 (patch)
treec42d91c5cf156bca54ece0d1f2757b7e62289654
parent9f8a7af982aaeb66ded62d9b62354a46c0aa8511 (diff)
parent3e273065386bde56c4c7710de2ceb585a5eb4784 (diff)
downloadnative-4c798c91fdc99b8b4a111fa6f7e569f3bfbecf25.tar.gz
Snap for 4824048 from 3e273065386bde56c4c7710de2ceb585a5eb4784 to pi-release
Change-Id: If615f7a4ac4730f18de19ad8f4be3aafba2cb650
-rw-r--r--services/surfaceflinger/DisplayDevice.cpp4
-rw-r--r--services/surfaceflinger/DisplayDevice.h6
-rw-r--r--services/surfaceflinger/RenderEngine/RenderEngine.cpp6
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp4
4 files changed, 13 insertions, 7 deletions
diff --git a/services/surfaceflinger/DisplayDevice.cpp b/services/surfaceflinger/DisplayDevice.cpp
index 9ecbacc86b..db095a51d9 100644
--- a/services/surfaceflinger/DisplayDevice.cpp
+++ b/services/surfaceflinger/DisplayDevice.cpp
@@ -761,12 +761,12 @@ bool DisplayDevice::hasRenderIntent(RenderIntent intent) const {
return iter != mColorModes.end() && iter->second.renderIntent == intent;
}
-bool DisplayDevice::hasModernHdrSupport(Dataspace dataspace) const {
+bool DisplayDevice::hasLegacyHdrSupport(Dataspace dataspace) const {
if ((dataspace == Dataspace::BT2020_PQ && hasHDR10Support()) ||
(dataspace == Dataspace::BT2020_HLG && hasHLGSupport())) {
auto iter =
mColorModes.find(getColorModeKey(dataspace, RenderIntent::TONE_MAP_COLORIMETRIC));
- return iter != mColorModes.end() && iter->second.dataspace == dataspace;
+ return iter == mColorModes.end() || iter->second.dataspace != dataspace;
}
return false;
diff --git a/services/surfaceflinger/DisplayDevice.h b/services/surfaceflinger/DisplayDevice.h
index b3859b6793..6c3bd91793 100644
--- a/services/surfaceflinger/DisplayDevice.h
+++ b/services/surfaceflinger/DisplayDevice.h
@@ -150,9 +150,9 @@ public:
bool hasHLGSupport() const { return mHasHLG; }
bool hasDolbyVisionSupport() const { return mHasDolbyVision; }
- // Return true if the corresponding color mode for the HDR dataspace is
- // supported.
- bool hasModernHdrSupport(ui::Dataspace dataspace) const;
+ // Return true if the HDR dataspace is supported but
+ // there is no corresponding color mode.
+ bool hasLegacyHdrSupport(ui::Dataspace dataspace) const;
// The returned HdrCapabilities is the combination of HDR capabilities from
// hardware composer and RenderEngine. When the DisplayDevice supports wide
diff --git a/services/surfaceflinger/RenderEngine/RenderEngine.cpp b/services/surfaceflinger/RenderEngine/RenderEngine.cpp
index 4c878aee31..c2233f9b59 100644
--- a/services/surfaceflinger/RenderEngine/RenderEngine.cpp
+++ b/services/surfaceflinger/RenderEngine/RenderEngine.cpp
@@ -427,6 +427,12 @@ void RenderEngine::unbindNativeBufferAsFrameBuffer(RE::BindNativeBufferAsFramebu
// back to main framebuffer
unbindFramebuffer(bindHelper->mTexName, bindHelper->mFbName);
eglDestroyImageKHR(mEGLDisplay, bindHelper->mImage);
+
+ // Workaround for b/77935566 to force the EGL driver to release the
+ // screenshot buffer
+ setScissor(0, 0, 0, 0);
+ clearWithColor(0.0, 0.0, 0.0, 0.0);
+ disableScissor();
}
// ---------------------------------------------------------------------------
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 97edd357ed..cdd9c1804f 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -1932,9 +1932,9 @@ void SurfaceFlinger::pickColorMode(const sp<DisplayDevice>& displayDevice,
Dataspace hdrDataSpace;
Dataspace bestDataSpace = getBestDataspace(displayDevice, &hdrDataSpace);
- // respect hdrDataSpace only when there is modern HDR support
+ // respect hdrDataSpace only when there is no legacy HDR support
const bool isHdr = hdrDataSpace != Dataspace::UNKNOWN &&
- displayDevice->hasModernHdrSupport(hdrDataSpace);
+ !displayDevice->hasLegacyHdrSupport(hdrDataSpace);
if (isHdr) {
bestDataSpace = hdrDataSpace;
}