cogl: Move _cogl_xlib_get_damage_base near its only consumer

https://gitlab.gnome.org/GNOME/mutter/merge_requests/885
This commit is contained in:
Adam Jackson 2019-10-24 15:41:49 -04:00
parent ac626f7334
commit b3980f7a94
4 changed files with 13 additions and 67 deletions

View File

@ -45,7 +45,4 @@ struct _CoglXlibTrapState
CoglXlibTrapState *old_state; CoglXlibTrapState *old_state;
}; };
int
_cogl_xlib_get_damage_base (void);
#endif /* __COGL_XLIB_PRIVATE_H */ #endif /* __COGL_XLIB_PRIVATE_H */

View File

@ -1,63 +0,0 @@
/*
* Cogl
*
* A Low Level GPU Graphics and Utilities API
*
* Copyright (C) 2010,2011 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* Authors:
* Robert Bragg <robert@linux.intel.com>
*
*/
#include "cogl-config.h"
#include <cogl-xlib.h>
#include <cogl-object-private.h>
#include <cogl-context-private.h>
#include <cogl-framebuffer-private.h>
#include <cogl-display-private.h>
#include <cogl-renderer-private.h>
#include <cogl-xlib-renderer-private.h>
#include <X11/Xlib.h>
#include <X11/extensions/Xdamage.h>
#include "cogl-xlib.h"
/* FIXME: when we remove the last X11 based Clutter backend then we
* will get rid of these functions and instead rely on the equivalent
* _cogl_xlib_renderer API
*/
int
_cogl_xlib_get_damage_base (void)
{
CoglX11Renderer *x11_renderer;
_COGL_GET_CONTEXT (ctxt, -1);
x11_renderer =
(CoglX11Renderer *) _cogl_xlib_renderer_get_data (ctxt->display->renderer);
return x11_renderer->damage_base;
}

View File

@ -386,7 +386,6 @@ if have_x11
'cogl-xlib-private.h', 'cogl-xlib-private.h',
'cogl-xlib-renderer-private.h', 'cogl-xlib-renderer-private.h',
'cogl-xlib-renderer.c', 'cogl-xlib-renderer.c',
'cogl-xlib.c',
'winsys/cogl-texture-pixmap-x11-private.h', 'winsys/cogl-texture-pixmap-x11-private.h',
'winsys/cogl-texture-pixmap-x11.c', 'winsys/cogl-texture-pixmap-x11.c',
] ]

View File

@ -49,6 +49,8 @@
#include "cogl-renderer-private.h" #include "cogl-renderer-private.h"
#include "cogl-object-private.h" #include "cogl-object-private.h"
#include "cogl-xlib.h" #include "cogl-xlib.h"
#include "cogl-xlib-renderer-private.h"
#include "cogl-x11-renderer-private.h"
#include "cogl-private.h" #include "cogl-private.h"
#include "cogl-gtype-private.h" #include "cogl-gtype-private.h"
#include "driver/gl/cogl-texture-gl-private.h" #include "driver/gl/cogl-texture-gl-private.h"
@ -230,6 +232,17 @@ process_damage_event (CoglTexturePixmapX11 *tex_pixmap,
} }
} }
static int
_cogl_xlib_get_damage_base (void)
{
CoglX11Renderer *x11_renderer;
_COGL_GET_CONTEXT (ctxt, -1);
x11_renderer =
(CoglX11Renderer *) _cogl_xlib_renderer_get_data (ctxt->display->renderer);
return x11_renderer->damage_base;
}
static CoglFilterReturn static CoglFilterReturn
_cogl_texture_pixmap_x11_filter (XEvent *event, void *data) _cogl_texture_pixmap_x11_filter (XEvent *event, void *data)
{ {