Mir

Code review comment for lp:~kdub/mir/prep-for-1348330

Revision history for this message
Kevin DuBois (kdub) wrote :

@code duplication
This is walking the sometimes-fine line between duplication and the principle of substitutability. Given that a core objective of mir is to have a substitutable shell, its important that we get this right.

So obviously, I've concluded that its time to err in favor of substitutability.
My thinking goes like this:
default-compositor:
* paints squares
* alpha blends
* clears to black
* uses our optimizations
demo-compositor:
* paints squares
* paints shadows
* paints titlebar
* alpha blends
* clears to grey
* attempts to use the optimizations (has a platform-specific problem atm)

In the interest of /not/ duplicating the shared tasks, I want to have the top-level object (the "compositor") be different, while reusing objects that perform these various sub-tasks (DB and GLrenderer). This MP aims to make that top level object different so it can command the sub-objects to do different things. Admittedly the object structure of the GLRenderer makes it non-obvious that different things are actually being commanded. When render() is called, it does markedly different things in the mc::GLRenderer vs the me::GLRenderer because various private functions that are called by render() have been overridden by the example renderer.

The reason to override the mc::Compositor interface as opposed as the renderer is because the difference in behavior involves the DisplayBuffers. The demo compositor needs to command the DisplayBuffer differently than the default compositor. We've 'substituted' at just one level too low; this made sense when it was done, but now we have to shift a bit to override at a level that allows the DisplayBuffer object to be ordered to do different things.

« Back to merge proposal