mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 09:30:45 -05:00
mir: only allow to set foreign surfaces with hardware buffer
And return a CoglBool accordingly.
This commit is contained in:
parent
8e6997db44
commit
77e28d4a77
@ -282,10 +282,12 @@ cogl_mir_onscreen_get_surface (CoglOnscreen *onscreen);
|
||||
*
|
||||
* This function must be called before @onscreen is allocated.
|
||||
*
|
||||
* Returns: whether @surface has been marked as been set as surface or not.
|
||||
*
|
||||
* Since: 1.18
|
||||
* Stability: unstable
|
||||
*/
|
||||
void
|
||||
CoglBool
|
||||
cogl_mir_onscreen_set_foreign_surface (CoglOnscreen *onscreen,
|
||||
struct MirSurface *surface);
|
||||
#endif /* COGL_HAS_EGL_PLATFORM_MIR_SUPPORT */
|
||||
|
@ -658,17 +658,23 @@ cogl_mir_renderer_get_connection (CoglRenderer *renderer)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
CoglBool
|
||||
cogl_mir_onscreen_set_foreign_surface (CoglOnscreen *onscreen,
|
||||
MirSurface *surface)
|
||||
{
|
||||
CoglFramebuffer *fb;
|
||||
_COGL_RETURN_IF_FAIL (mir_surface_is_valid (surface));
|
||||
MirSurfaceParameters parameters;
|
||||
|
||||
_COGL_RETURN_VAL_IF_FAIL (mir_surface_is_valid (surface), FALSE);
|
||||
|
||||
fb = COGL_FRAMEBUFFER (onscreen);
|
||||
_COGL_RETURN_IF_FAIL (!fb->allocated);
|
||||
_COGL_RETURN_VAL_IF_FAIL (!fb->allocated, FALSE);
|
||||
|
||||
mir_surface_get_parameters (surface, ¶meters);
|
||||
_COGL_RETURN_VAL_IF_FAIL (parameters.buffer_usage == mir_buffer_usage_hardware, FALSE);
|
||||
|
||||
onscreen->foreign_surface = surface;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
MirSurface *
|
||||
|
Loading…
Reference in New Issue
Block a user