mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 17:40:40 -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.
|
* 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
|
* Since: 1.18
|
||||||
* Stability: unstable
|
* Stability: unstable
|
||||||
*/
|
*/
|
||||||
void
|
CoglBool
|
||||||
cogl_mir_onscreen_set_foreign_surface (CoglOnscreen *onscreen,
|
cogl_mir_onscreen_set_foreign_surface (CoglOnscreen *onscreen,
|
||||||
struct MirSurface *surface);
|
struct MirSurface *surface);
|
||||||
#endif /* COGL_HAS_EGL_PLATFORM_MIR_SUPPORT */
|
#endif /* COGL_HAS_EGL_PLATFORM_MIR_SUPPORT */
|
||||||
|
@ -658,17 +658,23 @@ cogl_mir_renderer_get_connection (CoglRenderer *renderer)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
CoglBool
|
||||||
cogl_mir_onscreen_set_foreign_surface (CoglOnscreen *onscreen,
|
cogl_mir_onscreen_set_foreign_surface (CoglOnscreen *onscreen,
|
||||||
MirSurface *surface)
|
MirSurface *surface)
|
||||||
{
|
{
|
||||||
CoglFramebuffer *fb;
|
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);
|
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;
|
onscreen->foreign_surface = surface;
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
MirSurface *
|
MirSurface *
|
||||||
|
Loading…
Reference in New Issue
Block a user