1 of 17

RSLL

ie. RenderSurfaceLayerList

2 of 17

What’s in a name?

  • RenderSurfaceLayerList

  • A list of Layers

  • Each layer owns a RenderSurface

3 of 17

Owns a RenderSurface you say?

  • A RenderSurface represents what will be a offscreen texture or FBO.
  • We draw the subtree below the layer who owns the RenderSurface into the buffer
  • Allows us to apply operations (e.g. opacity) to the entire subtree in one pass.

4 of 17

Oh, a RenderSurface

Layer

owns

Render Surface

Layer

Layer

Layer

...Subtree...

5 of 17

What shows up in a RenderSurface?

  • Each RenderSurface has a list of Layers that contribute to the surface.
    • RenderSurface::layer_list()
    • These are the layers that draw content into the surface’s buffer.
  • The layer owning the RenderSurface may or may not contribute to the RenderSurface
    • Depends if the layer draws content at all.

6 of 17

You’re a contributing layer and you’re a contributing layer...!

Layer

owns

Render Surface

Layer

Layer

Layer

...Subtree...

contributes to

contributes to

contributes to

contributes to

7 of 17

Then what happens to the Surface?

  • The content in the RenderSurface itself will be drawn into another RenderSurface
    • (except for the root)
  • The layer owning the RenderSurface will itself contribute to another RenderSurface
    • To contribute its RenderSurface content.
    • Regardless of the layer itself drawing anything.

8 of 17

Ugh, my head.

Layer

owns

Render Surface

...Subtree...

Layer

Layer

Layer

contributes to

contributes to

contributes to

contributes to

Layer

owns

Render Surface

contributes to

9 of 17

So what does this look like?

  • A layer can contribute to a RenderSurface

  • A layer that owns a RenderSurface can contribute to another RenderSurface

10 of 17

So what does this look like for real?

RSLL

Owns

RS::layer_list()

RootLayer

Surface A

RootLayer

Layer A

Layer B

Layer D

Layer B

Surface B

Layer C

Layers that draw content

Layers that do not draw content

11 of 17

So then what’s a RenderTarget?

  • RenderTarget of a layer is the layer owning a RenderSurface that the layer contributes to.
    • Layer A owns a RenderSurface.
    • Layer B contributes to Layer A’s RenderSurface.
    • Layer B’s RenderTarget is A.
  • “Target space” refers to the space of the RenderTarget’s RenderSurface.

12 of 17

Say RenderTarget one more time..

“Target Space”

Layer

owns

Render Surface

Layer

Layer

Layer

...Subtree...

RenderTarget

RenderTarget

RenderTarget

RenderTarget

13 of 17

.. I dare you.

  • Most simply:

  • The layer’s RenderTarget is the nearest ancestor (including itself) that owns a RenderSurface.

14 of 17

How do I use this thing?

  • Walking the RSLL is tricky..

  • Each layer in layer_list() may be contributing its own content.

  • Or maybe it’s contributing the content of the Surface it owns

15 of 17

Surely there is something simpler

  • Introducing: LayerIterator ♪ trumpet noise ♪
  • Allows you to walk the RSLL in FrontToBack order.
  • At each stop in the iteration, it gives you a Layer, and...
  • One of three states.

16 of 17

QuantumLayerIterator?

  • Each stop in the LayerIterator is one of:
    • The layer is contributing its own content.
    • The layer owns a RenderSurface and is contributing that.
    • The layer is itself a RenderTarget (owns a RenderSurface)
  • This third state allows you to perform actions on the RenderSurfaces themselves (after dealing with all contributors)

17 of 17

Ezpz The End

  • gg.

  • I’m sure there’s no questions, so why bother asking?