Loading services/surfaceflinger/BufferLayer.cpp +21 −1 Original line number Diff line number Diff line Loading @@ -515,7 +515,27 @@ Region BufferLayer::latchBuffer(bool& recomputeVisibleRegions, nsecs_t latchTime recomputeVisibleRegions = true; } setDataSpace(mConsumer->getCurrentDataSpace()); // Dataspace::V0_SRGB and Dataspace::V0_SRGB_LINEAR are not legacy // data space, however since framework doesn't distinguish them out of // legacy SRGB, we have to treat them as the same for now. // UNKNOWN is treated as legacy SRGB when the connected api is EGL. ui::Dataspace dataSpace = mConsumer->getCurrentDataSpace(); switch (dataSpace) { case ui::Dataspace::V0_SRGB: dataSpace = ui::Dataspace::SRGB; break; case ui::Dataspace::V0_SRGB_LINEAR: dataSpace = ui::Dataspace::SRGB_LINEAR; break; case ui::Dataspace::UNKNOWN: if (mConsumer->getCurrentApi() == NATIVE_WINDOW_API_EGL) { dataSpace = ui::Dataspace::SRGB; } break; default: break; } setDataSpace(dataSpace); Rect crop(mConsumer->getCurrentCrop()); const uint32_t transform(mConsumer->getCurrentTransform()); Loading services/surfaceflinger/Layer.cpp +2 −12 Original line number Diff line number Diff line Loading @@ -1643,19 +1643,9 @@ bool Layer::detachChildren() { return true; } // Dataspace::UNKNOWN, Dataspace::SRGB, Dataspace::SRGB_LINEAR, // Dataspace::V0_SRGB and Dataspace::V0_SRGB_LINEAR are considered legacy // SRGB data space for now. // Note that Dataspace::V0_SRGB and Dataspace::V0_SRGB_LINEAR are not legacy // data space, however since framework doesn't distinguish them out of legacy // SRGB, we have to treat them as the same for now. bool Layer::isLegacySrgbDataSpace() const { // TODO(lpy) b/77652630, need to figure out when UNKNOWN can be treated as SRGB. return mDrawingState.dataSpace == ui::Dataspace::UNKNOWN || mDrawingState.dataSpace == ui::Dataspace::SRGB || mDrawingState.dataSpace == ui::Dataspace::SRGB_LINEAR || mDrawingState.dataSpace == ui::Dataspace::V0_SRGB || mDrawingState.dataSpace == ui::Dataspace::V0_SRGB_LINEAR; return mDrawingState.dataSpace == ui::Dataspace::SRGB || mDrawingState.dataSpace == ui::Dataspace::SRGB_LINEAR; } void Layer::setParent(const sp<Layer>& layer) { Loading Loading
services/surfaceflinger/BufferLayer.cpp +21 −1 Original line number Diff line number Diff line Loading @@ -515,7 +515,27 @@ Region BufferLayer::latchBuffer(bool& recomputeVisibleRegions, nsecs_t latchTime recomputeVisibleRegions = true; } setDataSpace(mConsumer->getCurrentDataSpace()); // Dataspace::V0_SRGB and Dataspace::V0_SRGB_LINEAR are not legacy // data space, however since framework doesn't distinguish them out of // legacy SRGB, we have to treat them as the same for now. // UNKNOWN is treated as legacy SRGB when the connected api is EGL. ui::Dataspace dataSpace = mConsumer->getCurrentDataSpace(); switch (dataSpace) { case ui::Dataspace::V0_SRGB: dataSpace = ui::Dataspace::SRGB; break; case ui::Dataspace::V0_SRGB_LINEAR: dataSpace = ui::Dataspace::SRGB_LINEAR; break; case ui::Dataspace::UNKNOWN: if (mConsumer->getCurrentApi() == NATIVE_WINDOW_API_EGL) { dataSpace = ui::Dataspace::SRGB; } break; default: break; } setDataSpace(dataSpace); Rect crop(mConsumer->getCurrentCrop()); const uint32_t transform(mConsumer->getCurrentTransform()); Loading
services/surfaceflinger/Layer.cpp +2 −12 Original line number Diff line number Diff line Loading @@ -1643,19 +1643,9 @@ bool Layer::detachChildren() { return true; } // Dataspace::UNKNOWN, Dataspace::SRGB, Dataspace::SRGB_LINEAR, // Dataspace::V0_SRGB and Dataspace::V0_SRGB_LINEAR are considered legacy // SRGB data space for now. // Note that Dataspace::V0_SRGB and Dataspace::V0_SRGB_LINEAR are not legacy // data space, however since framework doesn't distinguish them out of legacy // SRGB, we have to treat them as the same for now. bool Layer::isLegacySrgbDataSpace() const { // TODO(lpy) b/77652630, need to figure out when UNKNOWN can be treated as SRGB. return mDrawingState.dataSpace == ui::Dataspace::UNKNOWN || mDrawingState.dataSpace == ui::Dataspace::SRGB || mDrawingState.dataSpace == ui::Dataspace::SRGB_LINEAR || mDrawingState.dataSpace == ui::Dataspace::V0_SRGB || mDrawingState.dataSpace == ui::Dataspace::V0_SRGB_LINEAR; return mDrawingState.dataSpace == ui::Dataspace::SRGB || mDrawingState.dataSpace == ui::Dataspace::SRGB_LINEAR; } void Layer::setParent(const sp<Layer>& layer) { Loading