diff options
Diffstat (limited to 'services/surfaceflinger/Layer.cpp')
| -rw-r--r-- | services/surfaceflinger/Layer.cpp | 11 | 
1 files changed, 6 insertions, 5 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index 90396dd322..949227b119 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -1425,7 +1425,8 @@ void Layer::updateTreeHasFrameRateVote() {      // First traverse the tree and count how many layers has votes      int layersWithVote = 0;      traverseTree([&layersWithVote](Layer* layer) { -        const auto layerVotedWithDefaultCompatibility = layer->mCurrentState.frameRate.rate > 0 && +        const auto layerVotedWithDefaultCompatibility = +                layer->mCurrentState.frameRate.rate.isValid() &&                  layer->mCurrentState.frameRate.type == FrameRateCompatibility::Default;          const auto layerVotedWithNoVote =                  layer->mCurrentState.frameRate.type == FrameRateCompatibility::NoVote; @@ -1486,14 +1487,14 @@ void Layer::setFrameTimelineVsyncForTransaction(int64_t frameTimelineVsyncId, ns  Layer::FrameRate Layer::getFrameRateForLayerTree() const {      const auto frameRate = getDrawingState().frameRate; -    if (frameRate.rate > 0 || frameRate.type == FrameRateCompatibility::NoVote) { +    if (frameRate.rate.isValid() || frameRate.type == FrameRateCompatibility::NoVote) {          return frameRate;      }      // This layer doesn't have a frame rate. If one of its ancestors or successors      // have a vote, return a NoVote for ancestors/successors to set the vote      if (getDrawingState().treeHasFrameRateVote) { -        return {0, FrameRateCompatibility::NoVote}; +        return {Fps(0.0f), FrameRateCompatibility::NoVote};      }      return frameRate; @@ -1687,9 +1688,9 @@ void Layer::miniDump(std::string& result, const DisplayDevice& display) const {      const FloatRect& crop = outputLayerState.sourceCrop;      StringAppendF(&result, "%6.1f %6.1f %6.1f %6.1f | ", crop.left, crop.top, crop.right,                    crop.bottom); -    if (layerState.frameRate.rate != 0 || +    if (layerState.frameRate.rate.isValid() ||          layerState.frameRate.type != FrameRateCompatibility::Default) { -        StringAppendF(&result, "% 6.2ffps %15s seamless=%s", layerState.frameRate.rate, +        StringAppendF(&result, "%s %15s seamless=%s", to_string(layerState.frameRate.rate).c_str(),                        frameRateCompatibilityString(layerState.frameRate.type).c_str(),                        toString(layerState.frameRate.seamlessness).c_str());      } else {  |