RenderSurfaces can be rendered outside the extents of their containing window

Bug #1667690 reported by Alexandros Frantzis
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mir
Triaged
Medium
Unassigned
mir (Ubuntu)
Triaged
Medium
Unassigned
qtmir (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

If a RenderSurface is larger than its containing window it still gets fully rendered. The expectation is for all RenderSurfaces to be clipped to their containing window's extents. We can't rely on clients to correctly resize their render surfaces.

How to reproduce:

Get lp:~cemil-azizoglu/mir/use-new-egl-backend and *remove* the line which updates the render surface's extents in the window on resize:

mir_window_spec_add_render_surface(spec, surface, new_width, new_height, 0, 0);

Build and launch any egl demo with mir_demo_server. Resize the window, making it smaller, and watch as the render surface is rendered outside the window's extents.

Revision history for this message
Gerry Boland (gerboland) wrote :

+1 I think this is unexpected behaviour, and makes a window manager's job harder

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

This bug was totally expected...

I don't think we have the luxury of GL clipping planes in ES. We could however modify the renderer to limit the glViewport to each window's region (which annoyingly also changes the coordinates ands transformations). Some work would be required there, possibly in our scene architecture to expose window vs renderable information, and also would need separate re-implementation in every compositor/renderer. So that's both Mir and QtMir.

Changed in mir:
importance: High → Medium
Changed in qtmir (Ubuntu):
importance: Undecided → Medium
Changed in mir:
status: New → Triaged
Changed in qtmir (Ubuntu):
status: New → Triaged
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Perhaps the solution is simpler than that. Seems I already solved this in mir_proving_server if you look at how it clips the title string texture:
      if (text_right > inright) // Title too long for window

We could just do similar vertex and texture coordinate modification on each renderable to keep it inside.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I forgot: The answer is glScissor(), which also exists in ES.

Revision history for this message
Michał Sawicz (saviq) wrote :

Syncing task from Mir.

Changed in mir (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
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.