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

Commit 075f263e authored by Piotr Wilczyński's avatar Piotr Wilczyński Committed by Android (Google) Code Review
Browse files

Merge "DisplayTopologyGraph offset in dp and store densities" into main

parents da025e58 67c53235
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;