Mir

[unity8 shell] Surface snapshot is mirrored

Bug #1210286 reported by Gerry Boland
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mir
Won't Fix
Medium
Alexandros Frantzis

Bug Description

In order to correctly display the snapshot of a surface, the snapshot needs to be mirrored (i.e. snapshot is upside-down). Here is the code I'm using:

    QImage image;

    app->session()->take_snapshot(
        [&](mir::shell::Snapshot const& snapshot)
        {
            image = QImage( (const uchar*)snapshot.pixels, // since we mirror, no need to offset starting position
                            snapshot.size.width.as_int(),
                            snapshot.size.height.as_int() - yOffset,
                            QImage::Format_ARGB32_Premultiplied).mirrored();
        });

You mentioned you were doing this mirroring in Mir too. Removing it could speed up snapshots a tiny bit more.

Adding bug so it won't be lost.

Changed in mir:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
kevin gunn (kgunn72) wrote :

alf - is this still a bug ? raising priority just in case.

Changed in mir:
importance: Medium → High
summary: - Surface snapshot is mirrored
+ [unity8 shell] Surface snapshot is mirrored
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

This is not a bug, it's a performance enhancement. Mir gets the pixel rows in bottom-up order from the texture, and has to reverse them to provide the usual top-down view of pixel data. Unity8, however, needs to upload the data to a texture so it needs to reverse the row order again. If Mir exports the data in texture row order, we save two reversals.

Marking this as medium priority, until we get evidence that this creates visible problems on some platform.

Changed in mir:
importance: High → Medium
Changed in mir:
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.