mer-hybris / qt5-qpa-hwcomposer-plugin

Qt 5 QPA plugin for Droid hwcomposer
22 stars 45 forks source link

[hwcomposer] Enable use of hwcomposer from application and implement it ... #33

Closed sletta closed 9 years ago

sletta commented 9 years ago

...for v11 backend. Contributes to JB#19969.

The plugin exposes the hwcomposer through an internal API called HwcInterface. This api can be queried from the QPlatformNativeIntegration::nativeResourceForIntegration() and passing the string HWC_INTERFACE_STRING. The define is there to provide some safeguarding between app and plugin in the case where one of them has an out-of-date header.

The v11 implementation is a continuation of the threaded hwc implementation and gets complicated a bit by it compared to how hwcomposer's prepare/set mechanism is used in SurfaceFlinger. To test feasibility of a composition, the app sends in a list through 'scheduleLayerList()' and only once this is accepted on a later frame can composition take place. This means that in the switch over from one type of layering to another, there will almost always be one pure GL frame, but this is deemed acceptable.