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

Commit 67c53235 authored by Piotr Wilczyński's avatar Piotr Wilczyński
Browse files

DisplayTopologyGraph offset in dp and store densities

Bug: 384668407
Bug: 362719483
Flag: com.android.server.display.feature.flags.display_topology
Test: m
Change-Id: I6d398b3af6609b0774b34e4b3f80e3afc136ed7c
parent bdb3bc4f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ enum class DisplayTopologyPosition : int32_t {
struct DisplayTopologyAdjacentDisplay {
    ui::LogicalDisplayId displayId = ui::LogicalDisplayId::INVALID;
    DisplayTopologyPosition position;
    float offsetPx;
    float offsetDp;
};

/**
@@ -52,6 +52,7 @@ struct DisplayTopologyAdjacentDisplay {
struct DisplayTopologyGraph {
    ui::LogicalDisplayId primaryDisplayId = ui::LogicalDisplayId::INVALID;
    std::unordered_map<ui::LogicalDisplayId, std::vector<DisplayTopologyAdjacentDisplay>> graph;
    std::unordered_map<ui::LogicalDisplayId, int> displaysDensity;
};

} // namespace android
+3 −3
Original line number Diff line number Diff line
@@ -1017,9 +1017,9 @@ PointerChoreographer::findDestinationDisplayLocked(const ui::LogicalDisplayId so
                        sourceBoundary == DisplayTopologyPosition::BOTTOM
                ? (destinationViewport->logicalRight - destinationViewport->logicalLeft)
                : (destinationViewport->logicalBottom - destinationViewport->logicalTop);
        if (cursorOffset >= adjacentDisplay.offsetPx &&
            cursorOffset <= adjacentDisplay.offsetPx + edgeSize) {
            return std::make_pair(destinationViewport, adjacentDisplay.offsetPx);
        if (cursorOffset >= adjacentDisplay.offsetDp &&
            cursorOffset <= adjacentDisplay.offsetDp + edgeSize) {
            return std::make_pair(destinationViewport, adjacentDisplay.offsetDp);
        }
    }
    return std::nullopt;