Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a4863349 authored by Lloyd Pique's avatar Lloyd Pique
Browse files

CE: Add test coverage for Output::generateClientCompositionRequests

Test: atest libcompositionengine_test
Bug: 144115935
Change-Id: I43c8f31e5cfee6d02dedeaec21c7d4d0ba49add5
parent 6818fa57
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
#pragma once

#include <optional>
#include <ostream>
#include <unordered_set>

#include <renderengine/LayerSettings.h>
@@ -115,5 +116,29 @@ struct LayerFESpHash {

using LayerFESet = std::unordered_set<sp<LayerFE>, LayerFESpHash>;

static inline bool operator==(const LayerFE::ClientCompositionTargetSettings& lhs,
                              const LayerFE::ClientCompositionTargetSettings& rhs) {
    return lhs.clip.hasSameRects(rhs.clip) &&
            lhs.useIdentityTransform == rhs.useIdentityTransform &&
            lhs.needsFiltering == rhs.needsFiltering && lhs.isSecure == rhs.isSecure &&
            lhs.supportsProtectedContent == rhs.supportsProtectedContent &&
            lhs.clearRegion.hasSameRects(rhs.clearRegion);
}

// Defining PrintTo helps with Google Tests.
static inline void PrintTo(const LayerFE::ClientCompositionTargetSettings& settings,
                           ::std::ostream* os) {
    *os << "ClientCompositionTargetSettings{";
    *os << "\n    .clip = \n";
    PrintTo(settings.clip, os);
    *os << "\n    .useIdentityTransform = " << settings.useIdentityTransform;
    *os << "\n    .needsFiltering = " << settings.needsFiltering;
    *os << "\n    .isSecure = " << settings.isSecure;
    *os << "\n    .supportsProtectedContent = " << settings.supportsProtectedContent;
    *os << "\n    .clearRegion = ";
    PrintTo(settings.clearRegion, os);
    *os << "\n}";
}

} // namespace compositionengine
} // namespace android
+486 −181

File changed.

Preview size limit exceeded, changes collapsed.