From e1043320e8634fb100b5bc2cca4c5ac1f3e9f483 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Thu, 17 May 2018 13:24:48 -0700 Subject: surfaceflinger: use layer drawing dataspace Layer::getDataSpace returns the current (as opposed to drawing) dataspace, which we almost never want and is racy. Remove the helper and access the dataspace directly. Bug: 79210409 Test: boots, Photos Change-Id: Ifec7055cf0a1f2d84da7ad58e27be2c01082e6e9 --- 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 9043234132..2077598371 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -1337,10 +1337,6 @@ bool Layer::setDataSpace(ui::Dataspace dataSpace) { return true; } -ui::Dataspace Layer::getDataSpace() const { - return mCurrentState.dataSpace; -} - uint32_t Layer::getLayerStack() const { auto p = mDrawingParent.promote(); if (p == nullptr) { @@ -1433,7 +1429,7 @@ LayerDebugInfo Layer::getLayerDebugInfo() const { info.mColor = ds.color; info.mFlags = ds.flags; info.mPixelFormat = getPixelFormat(); - info.mDataSpace = static_cast(getDataSpace()); + info.mDataSpace = static_cast(ds.dataSpace); info.mMatrix[0][0] = ds.active.transform[0][0]; info.mMatrix[0][1] = ds.active.transform[0][1]; info.mMatrix[1][0] = ds.active.transform[1][0]; @@ -1960,7 +1956,7 @@ void Layer::writeToProto(LayerProto* layerInfo, LayerVector::StateSet stateSet) layerInfo->set_is_opaque(isOpaque(state)); layerInfo->set_invalidate(contentDirty); - layerInfo->set_dataspace(dataspaceDetails(static_cast(getDataSpace()))); + layerInfo->set_dataspace(dataspaceDetails(static_cast(state.dataSpace))); layerInfo->set_pixel_format(decodePixelFormat(getPixelFormat())); LayerProtoHelper::writeToProto(getColor(), layerInfo->mutable_color()); LayerProtoHelper::writeToProto(state.color, layerInfo->mutable_requested_color()); -- cgit v1.2.3-59-g8ed1b