From 15fb96e63f2de336bb01e0824cc85141e5edfdea Mon Sep 17 00:00:00 2001 From: David Sodman Date: Sun, 7 Jan 2018 10:23:24 -0800 Subject: SF: Track compositionType across displayId's Make sure that compositionType tracks displayId's Bug: 112259502 Test: cts -m CtsViewTestCases SurfaceFlinger_test vrflinger_test Change-Id: I748ef1a6da8257e780daf89af06d76f29d19ad6f --- services/surfaceflinger/Layer.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'services/surfaceflinger/Layer.cpp') diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index 8e6cf99279..1bb72326d9 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -772,16 +772,12 @@ void Layer::setCompositionType(int32_t displayId, HWC2::Composition type, bool c } HWC2::Composition Layer::getCompositionType(int32_t displayId) const { - if (displayId == DisplayDevice::DISPLAY_ID_INVALID) { + if (getBE().mHwcLayers.count(displayId) == 0) { // If we're querying the composition type for a display that does not // have a HWC counterpart, then it will always be Client return HWC2::Composition::Client; } - if (getBE().mHwcLayers.count(displayId) == 0) { - ALOGE("getCompositionType called with an invalid HWC layer"); - return HWC2::Composition::Invalid; - } - return getBE().mHwcLayers.at(displayId).compositionType; + return getBE().mHwcLayers[displayId].compositionType; } void Layer::setClearClientTarget(int32_t displayId, bool clear) { -- cgit v1.2.3-59-g8ed1b