Use an enum at creation to initialize the compositing mode.

This value won't change and this will force us to avoid
spreading runtime checks.

Change-Id: I7928cbe12d75bacddb5ad5c0578ae9a25d7c138e
Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>