Open Bug 1696101 Opened 4 years ago Updated 3 years ago

Add partial rects handling to RenderCompositorOGLSWGL

Categories

(Core :: Graphics: WebRender, enhancement, P4)

enhancement

Tracking

()

People

(Reporter: sotaro, Unassigned)

References

(Depends on 1 open bug, Blocks 3 open bugs)

Details

This is similar to Bug 1695564.

Depends on: 1695564
Severity: -- → N/A
Priority: -- → P4

We don't do any buffer age tracking for partial rects handling.

Here are some (possibly incomplete) notes on how to implement this while it is in my head:

  • In bug 1711211 I am adding an implementation of RequestFullRender() to RenderCompositorOGLSWGL(), to ensure we do a full render whenever the EGL surface is recreated. Once we add proper buffer age and damage tracking support we can remove that, as webrender will already do a full render when the buffer age is zero. (This is how it works for non-swgl RenderCompositorEGL.)
  • We'll need a way for Native compositor's to set draw_previous_partial_present_regions to true, rather than hard-coding it to false.
  • We'll need to query the buffer age and pass it to webrender.
  • Then we'll need to call eglSetDamageRegion in the compositor prior to rendering to the backbuffer. This needs an additional "dirty rect" than the one we currently get as a result from webrender.
    • The dirty rect for eglSwapBuffersWithDamage is the region which has changed between the new frontbuffer (after the swap) and the old front buffer (before the swap). eg the change the user sees on the screen this frame.
    • The dirty rect for eglSetDamageRegion is the region of the backbuffer that we will render to on this frame: that is the region that changed this frame, plus the damage that has occured to the current backbuffer since it was last the front buffer. (Calculated using the buffer age).
    • Webrender already calculates both of these, we just need to plumb it through to RenderCompositorOGLSWGL.
  • We should probably only skip compositing if the latter of these regions is empty, for simplicity reasons.
See Also: → 1713686
You need to log in before you can comment on or make changes to this bug.