Loading services/surfaceflinger/Layer.cpp +2 −6 Original line number Diff line number Diff line Loading @@ -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) { Loading services/surfaceflinger/LayerBE.h +1 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ struct CompositionInfo { std::shared_ptr<LayerBE> layer; struct { std::shared_ptr<HWC2::Layer> hwcLayer; int32_t displayId = -1; sp<Fence> fence; HWC2::BlendMode blendMode = HWC2::BlendMode::Invalid; Rect displayFrame; Loading services/surfaceflinger/SurfaceFlinger.cpp +9 −4 Original line number Diff line number Diff line Loading @@ -1482,10 +1482,13 @@ void SurfaceFlinger::handleMessageRefresh() { mVsyncModulator.onRefreshed(mHadClientComposition); mLayersWithQueuedFrames.clear(); for (auto& compositionInfo : getBE().mCompositionInfo) { for (const auto& [token, display] : mDisplays) { const auto displayId = display->getId(); for (auto& compositionInfo : getBE().mCompositionInfo[displayId]) { compositionInfo.hwc.hwcLayer = nullptr; } } } bool SurfaceFlinger::handleMessageInvalidate() { Loading Loading @@ -1569,16 +1572,18 @@ void SurfaceFlinger::calculateWorkingSet() { } mDrawingState.colorMatrixChanged = false; getBE().mCompositionInfo.clear(); for (const auto& [token, display] : mDisplays) { const auto displayId = display->getId(); getBE().mCompositionInfo[displayId].clear(); for (auto& layer : display->getVisibleLayersSortedByZ()) { auto displayId = display->getId(); layer->getBE().compositionInfo.compositionType = layer->getCompositionType(displayId); if (!layer->setHwcLayer(displayId)) { ALOGV("Need to create HWCLayer for %s", layer->getName().string()); } getBE().mCompositionInfo.push_back(layer->getBE().compositionInfo); layer->getBE().compositionInfo.hwc.displayId = displayId; getBE().mCompositionInfo[displayId].push_back(layer->getBE().compositionInfo); layer->getBE().compositionInfo.hwc.hwcLayer = nullptr; } } Loading services/surfaceflinger/SurfaceFlinger.h +1 −1 Original line number Diff line number Diff line Loading @@ -226,7 +226,7 @@ public: // instances. Each hardware composer instance gets a different sequence id. int32_t mComposerSequenceId; std::vector<CompositionInfo> mCompositionInfo; std::unordered_map<int32_t, std::vector<CompositionInfo>> mCompositionInfo; }; Loading Loading
services/surfaceflinger/Layer.cpp +2 −6 Original line number Diff line number Diff line Loading @@ -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) { Loading
services/surfaceflinger/LayerBE.h +1 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ struct CompositionInfo { std::shared_ptr<LayerBE> layer; struct { std::shared_ptr<HWC2::Layer> hwcLayer; int32_t displayId = -1; sp<Fence> fence; HWC2::BlendMode blendMode = HWC2::BlendMode::Invalid; Rect displayFrame; Loading
services/surfaceflinger/SurfaceFlinger.cpp +9 −4 Original line number Diff line number Diff line Loading @@ -1482,10 +1482,13 @@ void SurfaceFlinger::handleMessageRefresh() { mVsyncModulator.onRefreshed(mHadClientComposition); mLayersWithQueuedFrames.clear(); for (auto& compositionInfo : getBE().mCompositionInfo) { for (const auto& [token, display] : mDisplays) { const auto displayId = display->getId(); for (auto& compositionInfo : getBE().mCompositionInfo[displayId]) { compositionInfo.hwc.hwcLayer = nullptr; } } } bool SurfaceFlinger::handleMessageInvalidate() { Loading Loading @@ -1569,16 +1572,18 @@ void SurfaceFlinger::calculateWorkingSet() { } mDrawingState.colorMatrixChanged = false; getBE().mCompositionInfo.clear(); for (const auto& [token, display] : mDisplays) { const auto displayId = display->getId(); getBE().mCompositionInfo[displayId].clear(); for (auto& layer : display->getVisibleLayersSortedByZ()) { auto displayId = display->getId(); layer->getBE().compositionInfo.compositionType = layer->getCompositionType(displayId); if (!layer->setHwcLayer(displayId)) { ALOGV("Need to create HWCLayer for %s", layer->getName().string()); } getBE().mCompositionInfo.push_back(layer->getBE().compositionInfo); layer->getBE().compositionInfo.hwc.displayId = displayId; getBE().mCompositionInfo[displayId].push_back(layer->getBE().compositionInfo); layer->getBE().compositionInfo.hwc.hwcLayer = nullptr; } } Loading
services/surfaceflinger/SurfaceFlinger.h +1 −1 Original line number Diff line number Diff line Loading @@ -226,7 +226,7 @@ public: // instances. Each hardware composer instance gets a different sequence id. int32_t mComposerSequenceId; std::vector<CompositionInfo> mCompositionInfo; std::unordered_map<int32_t, std::vector<CompositionInfo>> mCompositionInfo; }; Loading