On Thu, Sep 8, 2016 at 5:09 AM, Cemil Azizoglu <cemil.azizo...@canonical.com> wrote:
Regardless ​of what EGL (or any other API) needs, there needs to be a way for Mir platform to generically represent a unit of renderable (hw or sw) with a distinct type. That's what MirRenderSurface provides. "Generically" in the sense that it doesn't matter what it's backed by (BS or PC or whatever), and it can be passed around (to other APIs, not just EGL) freely.

Right. There was a point (long ago) at which MirSurface was sort-of this atomic-unit-of-renderable, but with cursor-renderables and multiple-renderables-per-surface this went away.

It is useful to have an absolutely minimal ‘this is a thing that can have image content posted to it’ concept; MirRenderSurface should be that. (Indeed, I'm not sure that that MirRenderSurface should even have a *size*, and it definitely shouldn't have a pixel format; I've remarked as such on the prototype branches).

Whereas, if we pass around, say, a BS handle then we become dependent on a backend that we may want to change or even deprecate in the future.

Also, EGL doesn't impose platforms to have an EGL specific type. A platform has its own type, and EGL is *made* to work with it. Here's a comment from the EGL header :
/* The types NativeDisplayType, NativeWindowType, and NativePixmapType
* are aliases of window-system-dependent types, such as X Display * or
 * Windows Device Context. They must be defined in platform-specific
 * code below. The EGL-prefixed versions of Native*Type are the same
 * types, renamed in EGL 1.3 so all types in the API start with "EGL".
That means we should have one consistent type that may take different forms depending on the backend. So saying "A MirRenderSurface is an EGLNativeWindowType" is not the right way to look at it. Because there is nothing EGL-specific about a MirRenderSurface.

As you know, ANativeWindow in Android, for instance, is not specific to EGL. It just represents a native window for Android for s/w and h/w. MirRenderSurface should be considered the same. You have a point in saying that we already expose clients with too much info on BS & PC. Perhaps we shouldn't, but that's a separate discussion.

Right. EGLNativeWindowType is defined by the platform as “a handle to the thing you can render to”.

This is why Mir's Android support is misleading. On the Android platform Mir pretends to be SurfaceFlinger, and this is obviously awkward, even though Google has deliberately made it possible.

But this really is going to be a special case. We're not going to pretend to be Wayland to get closed-source Mali support; we're not going to pretend to be X11 to get closed-source NVIDIA support, although we could (at the cost of significant madness) in both cases.


--
Mir-devel mailing list
Mir-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/mir-devel

Reply via email to