Compare commits
19 Commits
wip/carlos
...
wip/nields
Author | SHA1 | Date | |
---|---|---|---|
![]() |
eb2405f0f4 | ||
![]() |
a2c545c321 | ||
![]() |
3cd8f3b7dc | ||
![]() |
033ce2d956 | ||
![]() |
2b47e89405 | ||
![]() |
80d11287eb | ||
![]() |
f869e4d54b | ||
![]() |
c1059df7f9 | ||
![]() |
e3d3df985f | ||
![]() |
86ff3dfb3c | ||
![]() |
7e0d185120 | ||
![]() |
61c173b777 | ||
![]() |
f99cd18254 | ||
![]() |
0405786573 | ||
![]() |
b016ff29f6 | ||
![]() |
3f2e86f67c | ||
![]() |
0aa4a526c6 | ||
![]() |
85c2aef4bc | ||
![]() |
76664ef891 |
@@ -35,6 +35,7 @@ test-mutter:
|
||||
variables:
|
||||
XDG_RUNTIME_DIR: "$CI_PROJECT_DIR/runtime-dir"
|
||||
GSETTINGS_SCHEMA_DIR: "$CI_PROJECT_DIR/build/data"
|
||||
G_SLICE: "always-malloc"
|
||||
MALLOC_CHECK_: "3"
|
||||
NO_AT_BRIDGE: "1"
|
||||
MALLOC_PERTURB_: "123"
|
||||
@@ -44,7 +45,7 @@ test-mutter:
|
||||
- glib-compile-schemas $GSETTINGS_SCHEMA_DIR
|
||||
- >
|
||||
dbus-run-session -- xvfb-run -s '+iglx -noreset'
|
||||
meson test -C build --no-rebuild -t 10 --verbose --no-stdsplit --wrap catchsegv
|
||||
meson test -C build --no-rebuild -t 10 --verbose --no-stdsplit --print-errorlogs --wrap catchsegv
|
||||
only:
|
||||
- merge_requests
|
||||
- /^.*$/
|
||||
|
@@ -1975,6 +1975,7 @@ selection_paint (ClutterText *self,
|
||||
else
|
||||
{
|
||||
/* Paint selection background first */
|
||||
CoglPipeline *color_pipeline = cogl_pipeline_copy (default_color_pipeline);
|
||||
PangoLayout *layout = clutter_text_get_layout (self);
|
||||
CoglPath *selection_path = cogl_path_new ();
|
||||
CoglColor cogl_color = { 0, };
|
||||
@@ -1987,11 +1988,19 @@ selection_paint (ClutterText *self,
|
||||
else
|
||||
color = &priv->text_color;
|
||||
|
||||
cogl_color_init_from_4ub (&cogl_color,
|
||||
color->red,
|
||||
color->green,
|
||||
color->blue,
|
||||
paint_opacity * color->alpha / 255);
|
||||
cogl_color_premultiply (&cogl_color);
|
||||
cogl_pipeline_set_color (color_pipeline, &cogl_color);
|
||||
|
||||
clutter_text_foreach_selection_rectangle_prescaled (self,
|
||||
add_selection_rectangle_to_path,
|
||||
selection_path);
|
||||
|
||||
cogl_path_fill (selection_path);
|
||||
cogl_framebuffer_fill_path (fb, color_pipeline, selection_path);
|
||||
|
||||
/* Paint selected text */
|
||||
cogl_framebuffer_push_path_clip (fb, selection_path);
|
||||
|
@@ -114,11 +114,12 @@ test_destroy_destroy (ClutterActor *self)
|
||||
test->tex = NULL;
|
||||
}
|
||||
|
||||
g_list_free_full (test->children, (GDestroyNotify) clutter_actor_destroy);
|
||||
test->children = NULL;
|
||||
g_assert_nonnull (test->children);
|
||||
|
||||
if (CLUTTER_ACTOR_CLASS (test_destroy_parent_class)->destroy)
|
||||
CLUTTER_ACTOR_CLASS (test_destroy_parent_class)->destroy (self);
|
||||
|
||||
g_assert_null (test->children);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -460,9 +460,7 @@ cogl_path_fill (CoglPath *path);
|
||||
* use while filling a path.</note>
|
||||
*
|
||||
* Stability: unstable
|
||||
* Deprecated: 1.16: Use cogl_path_fill() instead
|
||||
*/
|
||||
COGL_DEPRECATED_FOR (cogl_path_fill)
|
||||
void
|
||||
cogl_framebuffer_fill_path (CoglFramebuffer *framebuffer,
|
||||
CoglPipeline *pipeline,
|
||||
@@ -492,9 +490,7 @@ cogl_path_stroke (CoglPath *path);
|
||||
* regardless of the current transformation matrix.
|
||||
*
|
||||
* Stability: unstable
|
||||
* Deprecated: 1.16: Use cogl_path_stroke() instead
|
||||
*/
|
||||
COGL_DEPRECATED_FOR (cogl_path_stroke)
|
||||
void
|
||||
cogl_framebuffer_stroke_path (CoglFramebuffer *framebuffer,
|
||||
CoglPipeline *pipeline,
|
||||
@@ -529,9 +525,7 @@ cogl_framebuffer_push_path_clip (CoglFramebuffer *framebuffer,
|
||||
*
|
||||
* Since: 1.8
|
||||
* Stability: Unstable
|
||||
* Deprecated: 1.16: Use cogl_framebuffer_push_path_clip() instead
|
||||
*/
|
||||
COGL_DEPRECATED_FOR (cogl_framebuffer_push_path_clip)
|
||||
void
|
||||
cogl_clip_push_from_path (CoglPath *path);
|
||||
|
||||
|
@@ -1504,7 +1504,6 @@ cogl_framebuffer_push_path_clip (CoglFramebuffer *framebuffer,
|
||||
COGL_FRAMEBUFFER_STATE_CLIP;
|
||||
}
|
||||
|
||||
/* XXX: deprecated */
|
||||
void
|
||||
cogl_clip_push_from_path (CoglPath *path)
|
||||
{
|
||||
@@ -1575,7 +1574,6 @@ _cogl_path_build_stroke_attribute_buffer (CoglPath *path)
|
||||
data->stroke_n_attributes = n_attributes;
|
||||
}
|
||||
|
||||
/* XXX: deprecated */
|
||||
void
|
||||
cogl_framebuffer_fill_path (CoglFramebuffer *framebuffer,
|
||||
CoglPipeline *pipeline,
|
||||
@@ -1588,7 +1586,6 @@ cogl_framebuffer_fill_path (CoglFramebuffer *framebuffer,
|
||||
_cogl_path_fill_nodes (path, framebuffer, pipeline, 0 /* flags */);
|
||||
}
|
||||
|
||||
/* XXX: deprecated */
|
||||
void
|
||||
cogl_framebuffer_stroke_path (CoglFramebuffer *framebuffer,
|
||||
CoglPipeline *pipeline,
|
||||
|
@@ -452,9 +452,6 @@ _cogl_pipeline_free (CoglPipeline *pipeline)
|
||||
_cogl_bitmask_destroy (&uniforms_state->changed_mask);
|
||||
}
|
||||
|
||||
if (pipeline->differences & COGL_PIPELINE_STATE_NEEDS_BIG_STATE)
|
||||
g_slice_free (CoglPipelineBigState, pipeline->big_state);
|
||||
|
||||
if (pipeline->differences & COGL_PIPELINE_STATE_LAYERS)
|
||||
g_list_free_full (pipeline->layer_differences, cogl_object_unref);
|
||||
|
||||
@@ -464,6 +461,9 @@ _cogl_pipeline_free (CoglPipeline *pipeline)
|
||||
if (pipeline->differences & COGL_PIPELINE_STATE_FRAGMENT_SNIPPETS)
|
||||
_cogl_pipeline_snippet_list_free (&pipeline->big_state->fragment_snippets);
|
||||
|
||||
if (pipeline->differences & COGL_PIPELINE_STATE_NEEDS_BIG_STATE)
|
||||
g_slice_free (CoglPipelineBigState, pipeline->big_state);
|
||||
|
||||
g_list_free (pipeline->deprecated_get_layers_list);
|
||||
|
||||
recursively_free_layer_caches (pipeline);
|
||||
|
@@ -29,6 +29,7 @@
|
||||
*/
|
||||
|
||||
#include "cogl-config.h"
|
||||
#include "cogl-defines.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
@@ -308,3 +309,66 @@ cogl_pixel_format_to_string (CoglPixelFormat format)
|
||||
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
#ifdef COGL_HAS_LIBDRM
|
||||
|
||||
typedef struct _PixelFormatMap {
|
||||
uint32_t drm_format;
|
||||
CoglPixelFormat cogl_format;
|
||||
CoglTextureComponents cogl_components;
|
||||
} PixelFormatMap;
|
||||
|
||||
static const PixelFormatMap pixel_format_map[] = {
|
||||
/* DRM formats are defined as little-endian, not machine endian. */
|
||||
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
|
||||
{ DRM_FORMAT_RGB565, COGL_PIXEL_FORMAT_RGB_565, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
{ DRM_FORMAT_ABGR8888, COGL_PIXEL_FORMAT_RGBA_8888_PRE, COGL_TEXTURE_COMPONENTS_RGBA },
|
||||
{ DRM_FORMAT_XBGR8888, COGL_PIXEL_FORMAT_RGBA_8888_PRE, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
{ DRM_FORMAT_ARGB8888, COGL_PIXEL_FORMAT_BGRA_8888_PRE, COGL_TEXTURE_COMPONENTS_RGBA },
|
||||
{ DRM_FORMAT_XRGB8888, COGL_PIXEL_FORMAT_BGRA_8888_PRE, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
{ DRM_FORMAT_BGRA8888, COGL_PIXEL_FORMAT_ARGB_8888_PRE, COGL_TEXTURE_COMPONENTS_RGBA },
|
||||
{ DRM_FORMAT_BGRX8888, COGL_PIXEL_FORMAT_ARGB_8888_PRE, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
{ DRM_FORMAT_RGBA8888, COGL_PIXEL_FORMAT_ABGR_8888_PRE, COGL_TEXTURE_COMPONENTS_RGBA },
|
||||
{ DRM_FORMAT_RGBX8888, COGL_PIXEL_FORMAT_ABGR_8888_PRE, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
#elif G_BYTE_ORDER == G_BIG_ENDIAN
|
||||
/* DRM_FORMAT_RGB565 cannot be expressed. */
|
||||
{ DRM_FORMAT_ABGR8888, COGL_PIXEL_FORMAT_ABGR_8888_PRE, COGL_TEXTURE_COMPONENTS_RGBA },
|
||||
{ DRM_FORMAT_XBGR8888, COGL_PIXEL_FORMAT_ABGR_8888_PRE, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
{ DRM_FORMAT_ARGB8888, COGL_PIXEL_FORMAT_ARGB_8888_PRE, COGL_TEXTURE_COMPONENTS_RGBA },
|
||||
{ DRM_FORMAT_XRGB8888, COGL_PIXEL_FORMAT_ARGB_8888_PRE, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
{ DRM_FORMAT_BGRA8888, COGL_PIXEL_FORMAT_BGRA_8888_PRE, COGL_TEXTURE_COMPONENTS_RGBA },
|
||||
{ DRM_FORMAT_BGRX8888, COGL_PIXEL_FORMAT_BGRA_8888_PRE, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
{ DRM_FORMAT_RGBA8888, COGL_PIXEL_FORMAT_RGBA_8888_PRE, COGL_TEXTURE_COMPONENTS_RGBA },
|
||||
{ DRM_FORMAT_RGBX8888, COGL_PIXEL_FORMAT_RGBA_8888_PRE, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
#else
|
||||
#error "unexpected G_BYTE_ORDER"
|
||||
#endif
|
||||
};
|
||||
|
||||
gboolean
|
||||
cogl_pixel_format_from_drm_format (uint32_t drm_format,
|
||||
CoglPixelFormat *out_format,
|
||||
CoglTextureComponents *out_components)
|
||||
{
|
||||
const size_t n = G_N_ELEMENTS (pixel_format_map);
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
if (pixel_format_map[i].drm_format == drm_format)
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == n)
|
||||
return FALSE;
|
||||
|
||||
if (out_format)
|
||||
*out_format = pixel_format_map[i].cogl_format;
|
||||
|
||||
if (out_components)
|
||||
*out_components = pixel_format_map[i].cogl_components;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -38,6 +38,10 @@
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef COGL_HAS_LIBDRM
|
||||
#include <drm_fourcc.h>
|
||||
#endif
|
||||
|
||||
#include <cogl/cogl-defines.h>
|
||||
|
||||
#include <glib.h>
|
||||
@@ -58,6 +62,9 @@ G_BEGIN_DECLS
|
||||
*
|
||||
* Other examples of factors that can influence the layout in memory are the
|
||||
* system's endianness.
|
||||
*
|
||||
* This file also contains methods to map Linux DRM 4CC codes to
|
||||
* CoglPixelFormats.
|
||||
*/
|
||||
|
||||
#define COGL_A_BIT (1 << 4)
|
||||
@@ -295,6 +302,34 @@ _cogl_pixel_format_is_endian_dependant (CoglPixelFormat format);
|
||||
const char *
|
||||
cogl_pixel_format_to_string (CoglPixelFormat format);
|
||||
|
||||
#ifdef COGL_HAS_LIBDRM
|
||||
|
||||
/* added in libdrm 2.4.95 */
|
||||
#ifndef DRM_FORMAT_INVALID
|
||||
#define DRM_FORMAT_INVALID 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* cogl_pixel_format_from_drm_format:
|
||||
* @drm_format: The DRM 4CC code (as specified in drm_fourcc.h)
|
||||
* @out_format: (optional): The corresponding #CoglPixelFormat (if successful)
|
||||
* @out_components: (optional): The corresponding #CoglTextureComponents (if
|
||||
* sucessful)
|
||||
*
|
||||
* Does an internal lookup to find a #CoglPixelFormat that matches the given
|
||||
* DRM 4CC code. If no such format could be found, this function will return
|
||||
* %FALSE and the output parameters will stay untouched.
|
||||
*
|
||||
* Returns: %TRUE if a #CoglPixelFormat corresponding to the 4CC code exists,
|
||||
* %FALSE otherwise.
|
||||
*/
|
||||
gboolean
|
||||
cogl_pixel_format_from_drm_format (uint32_t drm_format,
|
||||
CoglPixelFormat *out_format,
|
||||
CoglTextureComponents *out_components);
|
||||
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __COGL_PIXEL_FORMAT_H__ */
|
||||
|
@@ -54,41 +54,27 @@ static char *_cogl_x11_display_name = NULL;
|
||||
static GList *_cogl_xlib_renderers = NULL;
|
||||
|
||||
static void
|
||||
destroy_xlib_renderer_data (void *user_data)
|
||||
_xlib_renderer_data_free (CoglXlibRenderer *data)
|
||||
{
|
||||
CoglXlibRenderer *data = user_data;
|
||||
|
||||
if (data->xvisinfo)
|
||||
XFree (data->xvisinfo);
|
||||
|
||||
g_slice_free (CoglXlibRenderer, user_data);
|
||||
g_slice_free (CoglXlibRenderer, data);
|
||||
}
|
||||
|
||||
CoglXlibRenderer *
|
||||
_cogl_xlib_renderer_get_data (CoglRenderer *renderer)
|
||||
{
|
||||
static CoglUserDataKey key;
|
||||
CoglXlibRenderer *data;
|
||||
|
||||
/* Constructs a CoglXlibRenderer struct on demand and attaches it to
|
||||
the object using user data. It's done this way instead of using a
|
||||
subclassing hierarchy in the winsys data because all EGL winsys's
|
||||
need the EGL winsys data but only one of them wants the Xlib
|
||||
data. */
|
||||
|
||||
data = cogl_object_get_user_data (COGL_OBJECT (renderer), &key);
|
||||
if (!renderer->custom_winsys_user_data)
|
||||
renderer->custom_winsys_user_data = g_slice_new0 (CoglXlibRenderer);
|
||||
|
||||
if (data == NULL)
|
||||
{
|
||||
data = g_slice_new0 (CoglXlibRenderer);
|
||||
|
||||
cogl_object_set_user_data (COGL_OBJECT (renderer),
|
||||
&key,
|
||||
data,
|
||||
destroy_xlib_renderer_data);
|
||||
}
|
||||
|
||||
return data;
|
||||
return renderer->custom_winsys_user_data;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -570,6 +556,8 @@ _cogl_xlib_renderer_disconnect (CoglRenderer *renderer)
|
||||
if (!renderer->foreign_xdpy && xlib_renderer->xdpy)
|
||||
XCloseDisplay (xlib_renderer->xdpy);
|
||||
|
||||
g_clear_pointer (&renderer->custom_winsys_user_data, _xlib_renderer_data_free);
|
||||
|
||||
unregister_xlib_renderer (renderer);
|
||||
}
|
||||
|
||||
|
@@ -12,6 +12,9 @@ cdata.set('COGL_HAS_X11', have_x11)
|
||||
cdata.set('COGL_HAS_X11_SUPPORT', have_x11)
|
||||
cdata.set('COGL_HAS_XLIB', have_x11)
|
||||
cdata.set('COGL_HAS_XLIB_SUPPORT', have_x11)
|
||||
if have_native_backend
|
||||
cdata.set('COGL_HAS_LIBDRM', libdrm_dep.found())
|
||||
endif
|
||||
|
||||
cogl_defines_h = configure_file(
|
||||
input: 'cogl-defines.h.meson',
|
||||
|
@@ -353,7 +353,7 @@ find_builtin_output (MetaInputMapper *mapper,
|
||||
return panel != NULL;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static void
|
||||
guess_candidates (MetaInputMapper *mapper,
|
||||
MetaMapperInputInfo *input,
|
||||
DeviceCandidates *info)
|
||||
@@ -387,15 +387,7 @@ guess_candidates (MetaInputMapper *mapper,
|
||||
find_builtin_output (mapper, &info->candidates[META_MATCH_IS_BUILTIN]);
|
||||
}
|
||||
|
||||
if (best < N_OUTPUT_MATCHES)
|
||||
{
|
||||
info->best = best;
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
info->best = best;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -408,8 +400,7 @@ mapping_helper_add (MappingHelper *helper,
|
||||
|
||||
info.input = input;
|
||||
|
||||
if (!guess_candidates (mapper, input, &info))
|
||||
return;
|
||||
guess_candidates (mapper, input, &info);
|
||||
|
||||
for (i = 0; i < helper->device_maps->len; i++)
|
||||
{
|
||||
|
@@ -823,6 +823,7 @@ static void
|
||||
cursor_priv_free (MetaCursorNativePrivate *cursor_priv)
|
||||
{
|
||||
g_hash_table_destroy (cursor_priv->gpu_states);
|
||||
g_free (cursor_priv);
|
||||
}
|
||||
|
||||
static MetaCursorNativePrivate *
|
||||
|
@@ -73,11 +73,6 @@
|
||||
#define EGL_DRM_MASTER_FD_EXT 0x333C
|
||||
#endif
|
||||
|
||||
/* added in libdrm 2.4.95 */
|
||||
#ifndef DRM_FORMAT_INVALID
|
||||
#define DRM_FORMAT_INVALID 0
|
||||
#endif
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
@@ -252,11 +247,6 @@ static void
|
||||
free_next_secondary_bo (MetaGpuKms *gpu_kms,
|
||||
MetaOnscreenNativeSecondaryGpuState *secondary_gpu_state);
|
||||
|
||||
static gboolean
|
||||
cogl_pixel_format_from_drm_format (uint32_t drm_format,
|
||||
CoglPixelFormat *out_format,
|
||||
CoglTextureComponents *out_components);
|
||||
|
||||
static MetaBackend *
|
||||
backend_from_renderer_native (MetaRendererNative *renderer_native)
|
||||
{
|
||||
@@ -2126,65 +2116,6 @@ copy_shared_framebuffer_gpu (CoglOnscreen *onscreen,
|
||||
}
|
||||
}
|
||||
|
||||
typedef struct _PixelFormatMap {
|
||||
uint32_t drm_format;
|
||||
CoglPixelFormat cogl_format;
|
||||
CoglTextureComponents cogl_components;
|
||||
} PixelFormatMap;
|
||||
|
||||
static const PixelFormatMap pixel_format_map[] = {
|
||||
/* DRM formats are defined as little-endian, not machine endian. */
|
||||
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
|
||||
{ DRM_FORMAT_RGB565, COGL_PIXEL_FORMAT_RGB_565, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
{ DRM_FORMAT_ABGR8888, COGL_PIXEL_FORMAT_RGBA_8888_PRE, COGL_TEXTURE_COMPONENTS_RGBA },
|
||||
{ DRM_FORMAT_XBGR8888, COGL_PIXEL_FORMAT_RGBA_8888_PRE, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
{ DRM_FORMAT_ARGB8888, COGL_PIXEL_FORMAT_BGRA_8888_PRE, COGL_TEXTURE_COMPONENTS_RGBA },
|
||||
{ DRM_FORMAT_XRGB8888, COGL_PIXEL_FORMAT_BGRA_8888_PRE, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
{ DRM_FORMAT_BGRA8888, COGL_PIXEL_FORMAT_ARGB_8888_PRE, COGL_TEXTURE_COMPONENTS_RGBA },
|
||||
{ DRM_FORMAT_BGRX8888, COGL_PIXEL_FORMAT_ARGB_8888_PRE, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
{ DRM_FORMAT_RGBA8888, COGL_PIXEL_FORMAT_ABGR_8888_PRE, COGL_TEXTURE_COMPONENTS_RGBA },
|
||||
{ DRM_FORMAT_RGBX8888, COGL_PIXEL_FORMAT_ABGR_8888_PRE, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
#elif G_BYTE_ORDER == G_BIG_ENDIAN
|
||||
/* DRM_FORMAT_RGB565 cannot be expressed. */
|
||||
{ DRM_FORMAT_ABGR8888, COGL_PIXEL_FORMAT_ABGR_8888_PRE, COGL_TEXTURE_COMPONENTS_RGBA },
|
||||
{ DRM_FORMAT_XBGR8888, COGL_PIXEL_FORMAT_ABGR_8888_PRE, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
{ DRM_FORMAT_ARGB8888, COGL_PIXEL_FORMAT_ARGB_8888_PRE, COGL_TEXTURE_COMPONENTS_RGBA },
|
||||
{ DRM_FORMAT_XRGB8888, COGL_PIXEL_FORMAT_ARGB_8888_PRE, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
{ DRM_FORMAT_BGRA8888, COGL_PIXEL_FORMAT_BGRA_8888_PRE, COGL_TEXTURE_COMPONENTS_RGBA },
|
||||
{ DRM_FORMAT_BGRX8888, COGL_PIXEL_FORMAT_BGRA_8888_PRE, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
{ DRM_FORMAT_RGBA8888, COGL_PIXEL_FORMAT_RGBA_8888_PRE, COGL_TEXTURE_COMPONENTS_RGBA },
|
||||
{ DRM_FORMAT_RGBX8888, COGL_PIXEL_FORMAT_RGBA_8888_PRE, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
#else
|
||||
#error "unexpected G_BYTE_ORDER"
|
||||
#endif
|
||||
};
|
||||
|
||||
static gboolean
|
||||
cogl_pixel_format_from_drm_format (uint32_t drm_format,
|
||||
CoglPixelFormat *out_format,
|
||||
CoglTextureComponents *out_components)
|
||||
{
|
||||
const size_t n = G_N_ELEMENTS (pixel_format_map);
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
if (pixel_format_map[i].drm_format == drm_format)
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == n)
|
||||
return FALSE;
|
||||
|
||||
if (out_format)
|
||||
*out_format = pixel_format_map[i].cogl_format;
|
||||
|
||||
if (out_components)
|
||||
*out_components = pixel_format_map[i].cogl_components;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
copy_shared_framebuffer_cpu (CoglOnscreen *onscreen,
|
||||
MetaOnscreenNativeSecondaryGpuState *secondary_gpu_state,
|
||||
|
@@ -203,7 +203,7 @@ meta_renderer_x11_nested_create_view (MetaRenderer *renderer,
|
||||
height = logical_monitor->rect.height;
|
||||
}
|
||||
width = roundf (width * view_scale);
|
||||
height = roundf (width * view_scale);
|
||||
height = roundf (height * view_scale);
|
||||
|
||||
fake_onscreen = create_offscreen (cogl_context, width, height);
|
||||
|
||||
|
@@ -55,17 +55,8 @@ meta_rectangle_free (MetaRectangle *rect)
|
||||
g_free (rect);
|
||||
}
|
||||
|
||||
GType
|
||||
meta_rectangle_get_type (void)
|
||||
{
|
||||
static GType type_id = 0;
|
||||
|
||||
if (!type_id)
|
||||
type_id = g_boxed_type_register_static (g_intern_static_string ("MetaRectangle"),
|
||||
(GBoxedCopyFunc) meta_rectangle_copy,
|
||||
(GBoxedFreeFunc) meta_rectangle_free);
|
||||
return type_id;
|
||||
}
|
||||
G_DEFINE_BOXED_TYPE (MetaRectangle, meta_rectangle,
|
||||
meta_rectangle_copy, meta_rectangle_free);
|
||||
|
||||
char*
|
||||
meta_rectangle_to_string (const MetaRectangle *rect,
|
||||
|
@@ -725,7 +725,7 @@ meta_display_open (void)
|
||||
display->grab_tile_mode = META_TILE_NONE;
|
||||
display->grab_tile_monitor_number = -1;
|
||||
|
||||
display->grab_edge_resistance_data = NULL;
|
||||
meta_display_cleanup_edges (display);
|
||||
|
||||
meta_display_init_keys (display);
|
||||
|
||||
|
@@ -600,8 +600,6 @@ meta_workspace_manager_calc_workspace_layout (MetaWorkspaceManager *workspace_ma
|
||||
|
||||
grid = g_new (int, grid_area);
|
||||
|
||||
current_row = -1;
|
||||
current_col = -1;
|
||||
i = 0;
|
||||
|
||||
switch (workspace_manager->starting_corner)
|
||||
|
@@ -32,6 +32,7 @@
|
||||
#include "wayland/meta-wayland.h"
|
||||
|
||||
#define ALL_TRANSFORMS ((1 << (META_MONITOR_TRANSFORM_FLIPPED_270 + 1)) - 1)
|
||||
#define FRAME_WARNING "Frame has assigned frame counter but no frame drawn time"
|
||||
|
||||
static gboolean
|
||||
run_tests (gpointer data)
|
||||
@@ -40,6 +41,8 @@ run_tests (gpointer data)
|
||||
MetaSettings *settings = meta_backend_get_settings (backend);
|
||||
gboolean ret;
|
||||
|
||||
g_test_log_set_fatal_handler (NULL, NULL);
|
||||
|
||||
meta_settings_override_experimental_features (settings);
|
||||
|
||||
meta_settings_enable_experimental_feature (
|
||||
@@ -53,6 +56,20 @@ run_tests (gpointer data)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ignore_frame_counter_warning (const gchar *log_domain,
|
||||
GLogLevelFlags log_level,
|
||||
const gchar *message,
|
||||
gpointer user_data)
|
||||
{
|
||||
if ((log_level & G_LOG_LEVEL_WARNING) &&
|
||||
g_strcmp0 (log_domain, "mutter") == 0 &&
|
||||
g_str_has_suffix (message, FRAME_WARNING))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_test_headless_start (void)
|
||||
{
|
||||
@@ -193,6 +210,8 @@ main (int argc, char *argv[])
|
||||
meta_init ();
|
||||
meta_register_with_session ();
|
||||
|
||||
g_test_log_set_fatal_handler (ignore_frame_counter_warning, NULL);
|
||||
|
||||
g_idle_add (run_tests, NULL);
|
||||
|
||||
return meta_run ();
|
||||
|
@@ -385,6 +385,9 @@ test_case_do (TestCase *test,
|
||||
argc == 3 ? argv[2] : NULL,
|
||||
NULL))
|
||||
return FALSE;
|
||||
|
||||
if (!test_client_wait (client, error))
|
||||
return FALSE;
|
||||
}
|
||||
else if (strcmp (argv[0], "set_parent") == 0 ||
|
||||
strcmp (argv[0], "set_parent_exported") == 0)
|
||||
|
@@ -31,8 +31,6 @@
|
||||
#include "meta/prefs.h"
|
||||
#include "ui/frames.h"
|
||||
|
||||
#define DEBUG_FILL_STRUCT(s) memset ((s), 0xef, sizeof (*(s)))
|
||||
|
||||
static void scale_border (GtkBorder *border, double factor);
|
||||
|
||||
static MetaFrameLayout *
|
||||
@@ -58,7 +56,6 @@ meta_frame_layout_free (MetaFrameLayout *layout)
|
||||
{
|
||||
g_return_if_fail (layout != NULL);
|
||||
|
||||
DEBUG_FILL_STRUCT (layout);
|
||||
g_free (layout);
|
||||
}
|
||||
|
||||
@@ -967,7 +964,6 @@ meta_theme_free (MetaTheme *theme)
|
||||
if (theme->layouts[i])
|
||||
meta_frame_layout_free (theme->layouts[i]);
|
||||
|
||||
DEBUG_FILL_STRUCT (theme);
|
||||
g_free (theme);
|
||||
}
|
||||
|
||||
|
@@ -43,10 +43,6 @@
|
||||
|
||||
#include "linux-dmabuf-unstable-v1-server-protocol.h"
|
||||
|
||||
#ifndef DRM_FORMAT_MOD_INVALID
|
||||
#define DRM_FORMAT_MOD_INVALID ((1ULL << 56) - 1)
|
||||
#endif
|
||||
|
||||
#define META_WAYLAND_DMA_BUF_MAX_FDS 4
|
||||
|
||||
struct _MetaWaylandDmaBufBuffer
|
||||
@@ -84,28 +80,15 @@ meta_wayland_dma_buf_realize_texture (MetaWaylandBuffer *buffer,
|
||||
if (buffer->dma_buf.texture)
|
||||
return TRUE;
|
||||
|
||||
switch (dma_buf->drm_format)
|
||||
/*
|
||||
* NOTE: The cogl_format here is only used for texture color channel
|
||||
* swizzling as compared to COGL_PIXEL_FORMAT_ARGB. It is *not* used
|
||||
* for accessing the buffer memory. EGL will access the buffer
|
||||
* memory according to the DRM fourcc code. Cogl will not mmap
|
||||
* and access the buffer memory at all.
|
||||
*/
|
||||
if (!cogl_pixel_format_from_drm_format (dma_buf->drm_format, &cogl_format, NULL))
|
||||
{
|
||||
/*
|
||||
* NOTE: The cogl_format here is only used for texture color channel
|
||||
* swizzling as compared to COGL_PIXEL_FORMAT_ARGB. It is *not* used
|
||||
* for accessing the buffer memory. EGL will access the buffer
|
||||
* memory according to the DRM fourcc code. Cogl will not mmap
|
||||
* and access the buffer memory at all.
|
||||
*/
|
||||
case DRM_FORMAT_XRGB8888:
|
||||
cogl_format = COGL_PIXEL_FORMAT_RGB_888;
|
||||
break;
|
||||
case DRM_FORMAT_ARGB8888:
|
||||
cogl_format = COGL_PIXEL_FORMAT_ARGB_8888_PRE;
|
||||
break;
|
||||
case DRM_FORMAT_ARGB2101010:
|
||||
cogl_format = COGL_PIXEL_FORMAT_ARGB_2101010_PRE;
|
||||
break;
|
||||
case DRM_FORMAT_RGB565:
|
||||
cogl_format = COGL_PIXEL_FORMAT_RGB_565;
|
||||
break;
|
||||
default:
|
||||
g_set_error (error, G_IO_ERROR,
|
||||
G_IO_ERROR_FAILED,
|
||||
"Unsupported buffer format %d", dma_buf->drm_format);
|
||||
|
@@ -266,7 +266,7 @@ meta_wayland_seat_free (MetaWaylandSeat *seat)
|
||||
meta_wayland_gtk_text_input_destroy (seat->gtk_text_input);
|
||||
meta_wayland_text_input_destroy (seat->text_input);
|
||||
|
||||
g_slice_free (MetaWaylandSeat, seat);
|
||||
g_free (seat);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@@ -490,6 +490,13 @@ init_x11_bell (MetaX11Display *x11_display)
|
||||
&mask);
|
||||
}
|
||||
}
|
||||
|
||||
/* We are playing sounds using libcanberra support, we handle the
|
||||
* bell whether its an audible bell or a visible bell */
|
||||
XkbChangeEnabledControls (x11_display->xdisplay,
|
||||
XkbUseCoreKbd,
|
||||
XkbAudibleBellMask,
|
||||
0);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -507,32 +514,6 @@ shutdown_x11_bell (MetaX11Display *x11_display)
|
||||
XkbAudibleBellMask);
|
||||
}
|
||||
|
||||
/*
|
||||
* Turns the bell to audible or visual. This tells X what to do, but
|
||||
* not Mutter; you will need to set the "visual bell" pref for that.
|
||||
*/
|
||||
static void
|
||||
set_x11_bell_is_audible (MetaX11Display *x11_display,
|
||||
gboolean is_audible)
|
||||
{
|
||||
/* When we are playing sounds using libcanberra support, we handle the
|
||||
* bell whether its an audible bell or a visible bell */
|
||||
gboolean enable_system_bell = FALSE;
|
||||
|
||||
XkbChangeEnabledControls (x11_display->xdisplay,
|
||||
XkbUseCoreKbd,
|
||||
XkbAudibleBellMask,
|
||||
enable_system_bell ? XkbAudibleBellMask : 0);
|
||||
}
|
||||
|
||||
static void
|
||||
on_is_audible_changed (MetaBell *bell,
|
||||
gboolean is_audible,
|
||||
MetaX11Display *x11_display)
|
||||
{
|
||||
set_x11_bell_is_audible (x11_display, is_audible);
|
||||
}
|
||||
|
||||
static void
|
||||
set_desktop_geometry_hint (MetaX11Display *x11_display)
|
||||
{
|
||||
@@ -1351,12 +1332,6 @@ meta_x11_display_new (MetaDisplay *display, GError **error)
|
||||
|
||||
init_x11_bell (x11_display);
|
||||
|
||||
g_signal_connect_object (display->bell, "is-audible-changed",
|
||||
G_CALLBACK (on_is_audible_changed),
|
||||
x11_display, 0);
|
||||
|
||||
set_x11_bell_is_audible (x11_display, meta_prefs_bell_is_audible ());
|
||||
|
||||
meta_x11_startup_notification_init (x11_display);
|
||||
meta_x11_selection_init (x11_display);
|
||||
|
||||
|
Reference in New Issue
Block a user