Compare commits

..

1 Commits

Author SHA1 Message Date
Niels De Graef
620a9f5193 ci: Generate a cover report for the test suite
Based on @ebassi's work from https://gitlab.gnome.org/GNOME/glib/merge_requests/769

This MR allows us to see the succeeded/failed tests each time the CI
pipeline is run.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/528
2019-05-03 09:47:55 +02:00
87 changed files with 878 additions and 1668 deletions

View File

@@ -1,4 +1,4 @@
image: registry.gitlab.gnome.org/gnome/mutter/master:v2
image: registry.gitlab.gnome.org/gnome/mutter/master:v1
stages:
- review
@@ -17,7 +17,7 @@ check-commit-log:
build-mutter:
stage: build
script:
- meson . build -Dbuildtype=debugoptimized -Degl_device=true -Dwayland_eglstream=true --werror --prefix /usr
- meson . build -Dbuildtype=debugoptimized -Degl_device=true -Dwayland_eglstream=true --werror
- ninja -C build
- ninja -C build install
artifacts:
@@ -35,29 +35,16 @@ test-mutter:
variables:
XDG_RUNTIME_DIR: "$CI_PROJECT_DIR/runtime-dir"
GSETTINGS_SCHEMA_DIR: "$CI_PROJECT_DIR/build/data"
MALLOC_CHECK_: "3"
NO_AT_BRIDGE: "1"
script:
- mkdir -m 700 $XDG_RUNTIME_DIR
- glib-compile-schemas $GSETTINGS_SCHEMA_DIR
- >
env MALLOC_PERTURB_="$((RANDOM % 256 + 1))"
dbus-run-session -- xvfb-run -s '+iglx -noreset'
meson test -C build --no-rebuild -t 10 --verbose --no-stdsplit --wrap catchsegv
only:
- merge_requests
- /^.*$/
can-build-gnome-shell:
stage: test
dependencies:
- build-mutter
before_script:
- meson install --no-rebuild -C build
script:
- .gitlab-ci/checkout-gnome-shell.sh
- meson gnome-shell gnome-shell/build --prefix /usr
- ninja -C gnome-shell/build install
- bash -x ./.gitlab-ci/run-tests.sh
only:
- merge_requests
- /^.*$/
artifacts:
reports:
junit: "build/${CI_JOB_NAME}-report.xml"
name: "mutter-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
when: always
paths:
- "build/meson-logs"
- "build/${CI_JOB_NAME}-report.xml"

View File

@@ -1,26 +1,17 @@
FROM fedora:30
FROM fedora:29
RUN dnf -y update && dnf -y upgrade && \
dnf install -y 'dnf-command(builddep)' && \
dnf install -y 'dnf-command(copr)' && \
dnf copr enable -y fmuellner/gnome-shell-ci && \
dnf builddep -y mutter && \
# Until Fedora catches up with meson build-deps
dnf install -y meson xorg-x11-server-Xorg gnome-settings-daemon-devel egl-wayland-devel xorg-x11-server-Xwayland && \
# For running unit tests
dnf install -y xorg-x11-server-Xvfb mesa-dri-drivers dbus dbus-x11 '*/xvfb-run' gdm-lib accountsservice-libs && \
dnf install -y xorg-x11-server-Xvfb mesa-dri-drivers dbus dbus-x11 && \
# Unpackaged versions
dnf install -y https://copr-be.cloud.fedoraproject.org/results/jadahl/mutter-ci/fedora-29-x86_64/00834984-gsettings-desktop-schemas/gsettings-desktop-schemas-3.30.1-1.20181206git918efdd69be53.fc29.x86_64.rpm https://copr-be.cloud.fedoraproject.org/results/jadahl/mutter-ci/fedora-29-x86_64/00834984-gsettings-desktop-schemas/gsettings-desktop-schemas-devel-3.30.1-1.20181206git918efdd69be53.fc29.x86_64.rpm && \
dnf install -y https://copr-be.cloud.fedoraproject.org/results/jadahl/mutter-ci/fedora-29-x86_64/00848426-gsettings-desktop-schemas/gsettings-desktop-schemas-3.30.1-1.20181206git918efdd69be53.fc29.x86_64.rpm https://copr-be.cloud.fedoraproject.org/results/jadahl/mutter-ci/fedora-29-x86_64/00848426-gsettings-desktop-schemas/gsettings-desktop-schemas-devel-3.30.1-1.20181206git918efdd69be53.fc29.x86_64.rpm && \
dnf install -y intltool redhat-rpm-config make && \
# GNOME Shell
dnf builddep -y gnome-shell --setopt=install_weak_deps=False && \
dnf remove -y gnome-bluetooth-libs-devel dbus-glib-devel upower-devel python3-devel && \
dnf remove -y --noautoremove mutter mutter-devel && \
dnf clean all

View File

@@ -1,35 +0,0 @@
#!/usr/bin/bash
mutter_branch=$(git describe --contains --all HEAD)
gnome_shell_target=
git clone https://gitlab.gnome.org/GNOME/gnome-shell.git
if [ $? -ne 0 ]; then
echo Checkout failed
exit 1
fi
cd gnome-shell
if [ "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" ]; then
merge_request_remote=${CI_MERGE_REQUEST_SOURCE_PROJECT_URL//mutter/gnome-shell}
merge_request_branch=$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
echo Looking for $merge_request_branch on remote ...
if git fetch -q $merge_request_remote $merge_request_branch 2>/dev/null; then
gnome_shell_target=FETCH_HEAD
else
gnome_shell_target=origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
echo Using $gnome_shell_target instead
fi
fi
if [ -z "$gnome_shell_target" ]; then
gnome_shell_target=$(git branch -r -l origin/$mutter_branch)
gnome_shell_target=${gnome_shell_target:-$(git branch -r -l ${mutter_branch#remotes/})}
gnome_shell_target=${gnome_shell_target:-origin/master}
echo Using $gnome_shell_target instead
fi
git checkout -q $gnome_shell_target

109
.gitlab-ci/meson-junit-report.py Executable file
View File

@@ -0,0 +1,109 @@
#!/usr/bin/env python3
# Turns a Meson testlog.json file into a JUnit XML report
#
# Copyright 2019 GNOME Foundation
#
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# Original author: Emmanuele Bassi
import argparse
import datetime
import json
import os
import sys
import xml.etree.ElementTree as ET
aparser = argparse.ArgumentParser(description='Turns a Meson test log into a JUnit report')
aparser.add_argument('--project-name', metavar='NAME',
help='The project name',
default='unknown')
aparser.add_argument('--job-id', metavar='ID',
help='The job ID for the report',
default='Unknown')
aparser.add_argument('--branch', metavar='NAME',
help='Branch of the project being tested',
default='master')
aparser.add_argument('--output', metavar='FILE',
help='The output file, stdout by default',
type=argparse.FileType('w', encoding='UTF-8'),
default=sys.stdout)
aparser.add_argument('infile', metavar='FILE',
help='The input testlog.json, stdin by default',
type=argparse.FileType('r', encoding='UTF-8'),
default=sys.stdin)
args = aparser.parse_args()
outfile = args.output
testsuites = ET.Element('testsuites')
testsuites.set('id', '{}/{}'.format(args.job_id, args.branch))
testsuites.set('package', args.project_name)
testsuites.set('timestamp', datetime.datetime.utcnow().isoformat(timespec='minutes'))
suites = {}
for line in args.infile:
data = json.loads(line)
(full_suite, unit_name) = data['name'].split(' / ')
(project_name, suite_name) = full_suite.split(':')
duration = data['duration']
return_code = data['returncode']
log = data['stdout']
unit = {
'suite': suite_name,
'name': unit_name,
'duration': duration,
'returncode': return_code,
'stdout': log,
}
units = suites.setdefault(suite_name, [])
units.append(unit)
for name, units in suites.items():
print('Processing suite {} (units: {})'.format(name, len(units)))
def if_failed(unit):
if unit['returncode'] != 0:
return True
return False
def if_succeded(unit):
if unit['returncode'] == 0:
return True
return False
successes = list(filter(if_succeded, units))
failures = list(filter(if_failed, units))
print(' - {}: {} pass, {} fail'.format(name, len(successes), len(failures)))
testsuite = ET.SubElement(testsuites, 'testsuite')
testsuite.set('name', '{}/{}'.format(args.project_name, name))
testsuite.set('tests', str(len(units)))
testsuite.set('errors', str(len(failures)))
testsuite.set('failures', str(len(failures)))
for unit in successes:
testcase = ET.SubElement(testsuite, 'testcase')
testcase.set('classname', '{}/{}'.format(args.project_name, unit['suite']))
testcase.set('name', unit['name'])
testcase.set('time', str(unit['duration']))
for unit in failures:
testcase = ET.SubElement(testsuite, 'testcase')
testcase.set('classname', '{}/{}'.format(args.project_name, unit['suite']))
testcase.set('name', unit['name'])
testcase.set('time', str(unit['duration']))
failure = ET.SubElement(testcase, 'failure')
failure.set('classname', '{}/{}'.format(args.project_name, unit['suite']))
failure.set('name', unit['name'])
failure.set('type', 'error')
failure.text = unit['stdout']
output = ET.tostring(testsuites, encoding='unicode')
outfile.write(output)

20
.gitlab-ci/run-tests.sh Executable file
View File

@@ -0,0 +1,20 @@
#!/usr/bin/bash
set +e
mkdir -m 700 $XDG_RUNTIME_DIR
glib-compile-schemas $GSETTINGS_SCHEMA_DIR
dbus-run-session -- \
xvfb-run -s '+iglx -noreset' \
meson test -C build --no-rebuild -t 10 --wrap catchsegv
exit_code=$?
python3 .gitlab-ci/meson-junit-report.py \
--project-name=mutter \
--job-id "${CI_JOB_NAME}" \
--output "build/${CI_JOB_NAME}-report.xml" \
build/meson-logs/testlog-catchsegv.json
exit $exit_code

40
NEWS
View File

@@ -1,43 +1,3 @@
3.33.2
======
* Fix rendering lag on Xorg [Daniel; !520, !281]
* Misc. bug fixes and cleanups [Carlos, Marco, Jonas D., Florian, Niels,
Daniel, Benjamin, Jonas Å., Ignacio, Vasilis; #598, !576, !547, !578,
!583, !582, !469, !524, !119, !571, !584, !585, !586, #425]
Contributors:
Jonas Ådahl, Benjamin Berg, Jonas Dreßler, Carlos Garnacho, Niels De Graef,
Vasilis Liaskovitis, Florian Müllner, Ignacio Casal Quinteiro,
Marco Trevisan (Treviño), Daniel van Vugt
Translators:
Daniel Mustieles [es]
3.33.1
======
* Remove unused APIs and outdated driver support
[Adam; !481, !468, !489, !487, !546]
* Enable EGL_IMG_context_priority [Adam; !454]
* Disable mouse keys with Numlock on [Olivier; #530]
* Fix crash when restarting on X11 [Marco; #576]
* Implement clipboard manager [Carlos; !320]
* Fix spurious idle signals that prevent session unblank [Jonas Å.; !543]
* Fix mapping of touchscreens that don't report dimensions [Carlos; #581]
* Fix propagating fractional scaling factor [Robert; !537]
* Add experimental RT scheduling support [Carlos; !460]
* Misc. bug fixes and cleanups [Robert, Carlos, Olivier, Ray, Marco, Jonas D.,
Georges, Daniel V., Daniel M; !467, !504, !551, !552, #575, #556, !557, !442,
!562, !535, !548, #586, !567, !396, !422, !507]
Contributors:
Jonas Ådahl, Piotr Drąg, Jonas Dreßler, Olivier Fourdan, Carlos Garnacho,
Adam Jackson, Robert Mader, Daniel García Moreno, Florian Müllner,
Georges Basile Stavracas Neto, Ray Strode, Marco Trevisan (Treviño),
Daniel van Vugt
Translators:
Daniel Mustieles [es], Fabio Tomat [fur], Kukuh Syafaat [id]
3.32.1
======
* Fix fallback app menu on wayland [Florian; #493]

View File

@@ -1044,8 +1044,10 @@ _cally_actor_clean_action_list (CallyActor *cally_actor)
if (priv->action_list)
{
g_list_free_full (priv->action_list,
(GDestroyNotify) _cally_actor_destroy_action_info);
g_list_foreach (priv->action_list,
(GFunc) _cally_actor_destroy_action_info,
NULL);
g_list_free (priv->action_list);
priv->action_list = NULL;
}
}

View File

@@ -577,7 +577,8 @@ _clutter_meta_group_clear_metas (ClutterMetaGroup *group)
{
g_list_foreach (group->meta, (GFunc) _clutter_actor_meta_set_actor, NULL);
g_list_free_full (group->meta, g_object_unref);
g_list_foreach (group->meta, (GFunc) g_object_unref, NULL);
g_list_free (group->meta);
group->meta = NULL;
}

View File

@@ -8849,9 +8849,9 @@ _clutter_actor_queue_redraw_full (ClutterActor *self,
*
* later during _clutter_stage_do_update(), once relayouting is done
* and the scenegraph has been updated we will call:
* clutter_stage_maybe_finish_queue_redraws().
* _clutter_stage_finish_queue_redraws().
*
* clutter_stage_maybe_finish_queue_redraws() will call
* _clutter_stage_finish_queue_redraws() will call
* _clutter_actor_finish_queue_redraw() for each listed actor.
*
* Note: actors *are* allowed to queue further redraws during this

View File

@@ -235,7 +235,8 @@ clutter_binding_pool_finalize (GObject *gobject)
g_hash_table_destroy (pool->entries_hash);
g_slist_free_full (pool->entries, (GDestroyNotify) binding_entry_free);
g_slist_foreach (pool->entries, (GFunc) binding_entry_free, NULL);
g_slist_free (pool->entries);
G_OBJECT_CLASS (clutter_binding_pool_parent_class)->finalize (gobject);
}

View File

@@ -355,10 +355,6 @@ on_captured_event (ClutterActor *stage,
switch (clutter_event_type (event))
{
case CLUTTER_TOUCH_CANCEL:
clutter_click_action_release (action);
break;
case CLUTTER_TOUCH_END:
has_button = FALSE;
case CLUTTER_BUTTON_RELEASE:

View File

@@ -282,7 +282,6 @@ clutter_deform_effect_paint_target (ClutterOffscreenEffect *effect)
/* enable depth testing */
cogl_depth_state_init (&depth_state);
cogl_depth_state_set_test_enabled (&depth_state, TRUE);
cogl_depth_state_set_test_function (&depth_state, COGL_DEPTH_TEST_FUNCTION_LEQUAL);
cogl_pipeline_set_depth_state (pipeline, &depth_state, NULL);
/* enable backface culling if we have a back material */

View File

@@ -1021,9 +1021,6 @@ clutter_event_get_event_sequence (const ClutterEvent *event)
event->type == CLUTTER_TOUCH_END ||
event->type == CLUTTER_TOUCH_CANCEL)
return event->touch.sequence;
else if (event->type == CLUTTER_ENTER ||
event->type == CLUTTER_LEAVE)
return event->crossing.sequence;
return NULL;
}

View File

@@ -269,7 +269,6 @@ struct _ClutterCrossingEvent
gfloat x;
gfloat y;
ClutterInputDevice *device;
ClutterEventSequence *sequence;
ClutterActor *related;
};

View File

@@ -834,7 +834,6 @@ _clutter_input_device_set_actor (ClutterInputDevice *device,
event->crossing.x = device->current_x;
event->crossing.y = device->current_y;
event->crossing.related = actor;
event->crossing.sequence = sequence;
clutter_event_set_device (event, device);
/* we need to make sure that this event is processed
@@ -871,7 +870,6 @@ _clutter_input_device_set_actor (ClutterInputDevice *device,
event->crossing.y = device->current_y;
event->crossing.source = actor;
event->crossing.related = old_actor;
event->crossing.sequence = sequence;
clutter_event_set_device (event, device);
/* see above */
@@ -1036,10 +1034,9 @@ _clutter_input_device_update (ClutterInputDevice *device,
ClutterActor *new_cursor_actor;
ClutterActor *old_cursor_actor;
ClutterPoint point = { -1, -1 };
ClutterInputDeviceType device_type = device->device_type;
g_assert (device_type != CLUTTER_KEYBOARD_DEVICE &&
device_type != CLUTTER_PAD_DEVICE);
if (device->device_type == CLUTTER_KEYBOARD_DEVICE)
return NULL;
stage = device->stage;
if (G_UNLIKELY (stage == NULL))

View File

@@ -2004,36 +2004,6 @@ emit_pointer_event (ClutterEvent *event,
}
}
static inline void
emit_crossing_event (ClutterEvent *event,
ClutterInputDevice *device)
{
ClutterMainContext *context = _clutter_context_get_default ();
ClutterEventSequence *sequence = clutter_event_get_event_sequence (event);
ClutterActor *grab_actor = NULL;
if (_clutter_event_process_filters (event))
return;
if (sequence)
{
if (device->sequence_grab_actors != NULL)
grab_actor = g_hash_table_lookup (device->sequence_grab_actors, sequence);
}
else
{
if (context->pointer_grab_actor != NULL)
grab_actor = context->pointer_grab_actor;
else if (device != NULL && device->pointer_grab_actor != NULL)
grab_actor = device->pointer_grab_actor;
}
if (grab_actor != NULL)
clutter_actor_event (grab_actor, event, FALSE);
else
emit_event_chain (event);
}
static inline void
emit_touch_event (ClutterEvent *event,
ClutterInputDevice *device)
@@ -2207,7 +2177,7 @@ _clutter_process_event_details (ClutterActor *stage,
{
ClutterActor *actor = NULL;
emit_crossing_event (event, device);
emit_pointer_event (event, device);
actor = _clutter_input_device_update (device, NULL, FALSE);
if (actor != stage)
@@ -2219,12 +2189,12 @@ _clutter_process_event_details (ClutterActor *stage,
crossing->crossing.related = stage;
crossing->crossing.source = actor;
emit_crossing_event (crossing, device);
emit_pointer_event (crossing, device);
clutter_event_free (crossing);
}
}
else
emit_crossing_event (event, device);
emit_pointer_event (event, device);
break;
case CLUTTER_LEAVE:
@@ -2243,10 +2213,10 @@ _clutter_process_event_details (ClutterActor *stage,
crossing->crossing.related = stage;
crossing->crossing.source = device->cursor_actor;
emit_crossing_event (crossing, device);
emit_pointer_event (crossing, device);
clutter_event_free (crossing);
}
emit_crossing_event (event, device);
emit_pointer_event (event, device);
break;
case CLUTTER_DESTROY_NOTIFY:

View File

@@ -412,7 +412,8 @@ master_clock_advance_timelines (ClutterMasterClockDefault *master_clock)
for (l = timelines; l != NULL; l = l->next)
_clutter_timeline_do_tick (l->data, master_clock->cur_tick / 1000);
g_slist_free_full (timelines, g_object_unref);
g_slist_foreach (timelines, (GFunc) g_object_unref, NULL);
g_slist_free (timelines);
#ifdef CLUTTER_ENABLE_DEBUG
if (_clutter_diagnostic_enabled ())
@@ -573,7 +574,8 @@ clutter_clock_dispatch (GSource *source,
master_clock_reschedule_stage_updates (master_clock, stages);
g_slist_free_full (stages, g_object_unref);
g_slist_foreach (stages, (GFunc) g_object_unref, NULL);
g_slist_free (stages);
master_clock->prev_tick = master_clock->cur_tick;

View File

@@ -295,7 +295,8 @@ clutter_path_clear (ClutterPath *path)
{
ClutterPathPrivate *priv = path->priv;
g_slist_free_full (priv->nodes, (GDestroyNotify) clutter_path_node_full_free);
g_slist_foreach (priv->nodes, (GFunc) clutter_path_node_full_free, NULL);
g_slist_free (priv->nodes);
priv->nodes = priv->nodes_tail = NULL;
priv->nodes_dirty = TRUE;
@@ -658,7 +659,8 @@ clutter_path_parse_description (const gchar *p,
return TRUE;
fail:
g_slist_free_full (nodes, (GDestroyNotify) clutter_path_node_full_free);
g_slist_foreach (nodes, (GFunc) clutter_path_node_full_free, NULL);
g_slist_free (nodes);
return FALSE;
}

View File

@@ -303,11 +303,6 @@ gboolean _clutter_util_matrix_decompose (const ClutterMatrix *src,
ClutterVertex *translate_p,
ClutterVertex4 *perspective_p);
PangoDirection _clutter_pango_unichar_direction (gunichar ch);
PangoDirection _clutter_pango_find_base_dir (const gchar *text,
gint length);
typedef struct _ClutterPlane
{
float v0[3];

View File

@@ -2021,7 +2021,8 @@ add_children (ClutterScript *script,
clutter_container_add_actor (container, CLUTTER_ACTOR (object));
}
g_list_free_full (oinfo->children, g_free);
g_list_foreach (oinfo->children, (GFunc) g_free, NULL);
g_list_free (oinfo->children);
oinfo->children = unresolved;
}

View File

@@ -346,12 +346,15 @@ object_info_free (gpointer data)
g_free (oinfo->class_name);
g_free (oinfo->type_func);
g_list_free_full (oinfo->properties, property_info_free);
g_list_foreach (oinfo->properties, (GFunc) property_info_free, NULL);
g_list_free (oinfo->properties);
g_list_free_full (oinfo->signals, signal_info_free);
g_list_foreach (oinfo->signals, (GFunc) signal_info_free, NULL);
g_list_free (oinfo->signals);
/* these are ids */
g_list_free_full (oinfo->children, g_free);
g_list_foreach (oinfo->children, (GFunc) g_free, NULL);
g_list_free (oinfo->children);
/* we unref top-level objects and leave the actors alone,
* unless we are unmerging in which case we have to destroy
@@ -843,7 +846,8 @@ clutter_script_unmerge_objects (ClutterScript *script,
for (l = data.ids; l != NULL; l = l->next)
g_hash_table_remove (priv->objects, l->data);
g_slist_free_full (data.ids, g_free);
g_slist_foreach (data.ids, (GFunc) g_free, NULL);
g_slist_free (data.ids);
clutter_script_ensure_objects (script);
}

View File

@@ -89,8 +89,8 @@ clutter_stage_manager_dispose (GObject *gobject)
stage_manager = CLUTTER_STAGE_MANAGER (gobject);
g_slist_free_full (stage_manager->stages,
(GDestroyNotify) clutter_actor_destroy);
g_slist_foreach (stage_manager->stages, (GFunc) clutter_actor_destroy, NULL);
g_slist_free (stage_manager->stages);
stage_manager->stages = NULL;
G_OBJECT_CLASS (clutter_stage_manager_parent_class)->dispose (gobject);

View File

@@ -1303,8 +1303,14 @@ clutter_stage_real_queue_redraw (ClutterActor *actor,
return TRUE;
if (_clutter_stage_window_ignoring_redraw_clips (stage_window))
return FALSE;
{
_clutter_stage_window_add_redraw_clip (stage_window, NULL);
return FALSE;
}
/* Convert the clip volume into stage coordinates and then into an
* axis aligned stage coordinates bounding box...
*/
if (redraw_clip == NULL)
{
_clutter_stage_window_add_redraw_clip (stage_window, NULL);
@@ -1314,8 +1320,6 @@ clutter_stage_real_queue_redraw (ClutterActor *actor,
if (redraw_clip->is_empty)
return TRUE;
/* Convert the clip volume into stage coordinates and then into an
* axis aligned stage coordinates bounding box... */
_clutter_paint_volume_get_stage_paint_box (redraw_clip,
stage,
&bounding_box);

View File

@@ -751,7 +751,7 @@ clutter_text_create_layout_no_cache (ClutterText *text,
if (priv->password_char != 0)
pango_dir = PANGO_DIRECTION_NEUTRAL;
else
pango_dir = _clutter_pango_find_base_dir (contents, contents_len);
pango_dir = pango_find_base_dir (contents, contents_len);
if (pango_dir == PANGO_DIRECTION_NEUTRAL)
{

View File

@@ -32,7 +32,6 @@
#include "clutter-build-config.h"
#include <fribidi.h>
#include <math.h>
#include "clutter-debug.h"
@@ -106,9 +105,8 @@ _clutter_util_fully_transform_vertices (const CoglMatrix *modelview,
}
}
void
_clutter_util_rect_from_rectangle (const cairo_rectangle_int_t *src,
ClutterRect *dest)
void _clutter_util_rect_from_rectangle (const cairo_rectangle_int_t *src,
ClutterRect *dest)
{
*dest = (ClutterRect) {
.origin = {
@@ -122,9 +120,8 @@ _clutter_util_rect_from_rectangle (const cairo_rectangle_int_t *src,
};
}
void
_clutter_util_rectangle_int_extents (const ClutterRect *src,
cairo_rectangle_int_t *dest)
void _clutter_util_rectangle_int_extents (const ClutterRect *src,
cairo_rectangle_int_t *dest)
{
ClutterRect tmp = *src;
@@ -138,11 +135,10 @@ _clutter_util_rectangle_int_extents (const ClutterRect *src,
};
}
void
_clutter_util_rectangle_offset (const cairo_rectangle_int_t *src,
int x,
int y,
cairo_rectangle_int_t *dest)
void _clutter_util_rectangle_offset (const cairo_rectangle_int_t *src,
int x,
int y,
cairo_rectangle_int_t *dest)
{
*dest = *src;
@@ -700,45 +696,3 @@ clutter_interval_register_progress_func (GType value_type,
G_UNLOCK (progress_funcs);
}
PangoDirection
_clutter_pango_unichar_direction (gunichar ch)
{
FriBidiCharType fribidi_ch_type;
G_STATIC_ASSERT (sizeof (FriBidiChar) == sizeof (gunichar));
fribidi_ch_type = fribidi_get_bidi_type (ch);
if (!FRIBIDI_IS_STRONG (fribidi_ch_type))
return PANGO_DIRECTION_NEUTRAL;
else if (FRIBIDI_IS_RTL (fribidi_ch_type))
return PANGO_DIRECTION_RTL;
else
return PANGO_DIRECTION_LTR;
}
PangoDirection
_clutter_pango_find_base_dir (const gchar *text,
gint length)
{
PangoDirection dir = PANGO_DIRECTION_NEUTRAL;
const gchar *p;
g_return_val_if_fail (text != NULL || length == 0, PANGO_DIRECTION_NEUTRAL);
p = text;
while ((length < 0 || p < text + length) && *p)
{
gunichar wc = g_utf8_get_char (p);
dir = _clutter_pango_unichar_direction (wc);
if (dir != PANGO_DIRECTION_NEUTRAL)
break;
p = g_utf8_next_char (p);
}
return dir;
}

View File

@@ -77,10 +77,6 @@ enum
PROP_LAST
};
static void
clutter_stage_cogl_schedule_update (ClutterStageWindow *stage_window,
gint sync_delay);
static void
clutter_stage_cogl_unrealize (ClutterStageWindow *stage_window)
{
@@ -126,16 +122,6 @@ _clutter_stage_cogl_presented (ClutterStageCogl *stage_cogl,
}
_clutter_stage_presented (stage_cogl->wrapper, frame_event, frame_info);
if (frame_event == COGL_FRAME_EVENT_COMPLETE &&
stage_cogl->update_time != -1)
{
ClutterStageWindow *stage_window = CLUTTER_STAGE_WINDOW (stage_cogl);
stage_cogl->update_time = -1;
clutter_stage_cogl_schedule_update (stage_window,
stage_cogl->last_sync_delay);
}
}
static gboolean
@@ -166,15 +152,10 @@ clutter_stage_cogl_schedule_update (ClutterStageWindow *stage_window,
gint64 now;
float refresh_rate;
gint64 refresh_interval;
int64_t min_render_time_allowed;
int64_t max_render_time_allowed;
int64_t next_presentation_time;
if (stage_cogl->update_time != -1)
return;
stage_cogl->last_sync_delay = sync_delay;
now = g_get_monotonic_time ();
if (sync_delay < 0)
@@ -203,18 +184,10 @@ clutter_stage_cogl_schedule_update (ClutterStageWindow *stage_window,
if (refresh_interval == 0)
refresh_interval = 16667; /* 1/60th second */
min_render_time_allowed = refresh_interval / 2;
max_render_time_allowed = refresh_interval - 1000 * sync_delay;
stage_cogl->update_time = stage_cogl->last_presentation_time + 1000 * sync_delay;
if (min_render_time_allowed > max_render_time_allowed)
min_render_time_allowed = max_render_time_allowed;
next_presentation_time = stage_cogl->last_presentation_time + refresh_interval;
while (next_presentation_time < now + min_render_time_allowed)
next_presentation_time += refresh_interval;
stage_cogl->update_time = next_presentation_time - max_render_time_allowed;
while (stage_cogl->update_time < now)
stage_cogl->update_time += refresh_interval;
}
static gint64
@@ -300,7 +273,7 @@ clutter_stage_cogl_ignoring_redraw_clips (ClutterStageWindow *stage_window)
}
/* A redraw clip represents (in stage coordinates) the bounding box of
* something that needs to be redrawn. Typically they are added to the
* something that needs to be redraw. Typically they are added to the
* StageWindow as a result of clutter_actor_queue_clipped_redraw() by
* actors such as ClutterGLXTexturePixmap. All redraw clips are
* discarded after the next paint.
@@ -529,8 +502,8 @@ fill_current_damage_history_and_step (ClutterStageView *view)
*current_fb_damage = (cairo_rectangle_int_t) {
.x = 0,
.y = 0,
.width = ceilf (view_rect.width * fb_scale),
.height = ceilf (view_rect.height * fb_scale)
.width = view_rect.width * fb_scale,
.height = view_rect.height * fb_scale
};
view_priv->damage_index++;
}

View File

@@ -59,8 +59,6 @@ struct _ClutterStageCogl
* junk frames to start with. */
unsigned int frame_count;
gint last_sync_delay;
cairo_rectangle_int_t bounding_redraw_clip;
guint initialized_redraw_clip : 1;

View File

@@ -250,8 +250,7 @@ get_direction (XkbDescPtr xkb,
{
int level = 0;
KeySym sym = XkbKeySymEntry (xkb, code, level, group);
PangoDirection dir =
_clutter_pango_unichar_direction (clutter_keysym_to_unicode (sym));
PangoDirection dir = pango_unichar_direction (clutter_keysym_to_unicode (sym));
switch (dir)
{

View File

@@ -38,7 +38,6 @@ clutter_pkg_deps = [
]
clutter_pkg_private_deps = [
fribidi_dep,
gdk_pixbuf_dep,
gthread_dep,
gmodule_no_export_dep,

View File

@@ -114,7 +114,8 @@ test_destroy_destroy (ClutterActor *self)
test->tex = NULL;
}
g_list_free_full (test->children, (GDestroyNotify) clutter_actor_destroy);
g_list_foreach (test->children, (GFunc) clutter_actor_destroy, NULL);
g_list_free (test->children);
test->children = NULL;
if (CLUTTER_ACTOR_CLASS (test_destroy_parent_class)->destroy)

View File

@@ -38,7 +38,8 @@ timeline_data_init (TimelineData *data, int timeline_num)
static void
timeline_data_destroy (TimelineData *data)
{
g_slist_free_full (data->markers_hit, g_free);
g_slist_foreach (data->markers_hit, (GFunc) g_free, NULL);
g_slist_free (data->markers_hit);
}
static void

View File

@@ -483,8 +483,8 @@ _cogl_pango_display_list_node_free (CoglPangoDisplayListNode *node)
void
_cogl_pango_display_list_clear (CoglPangoDisplayList *dl)
{
g_slist_free_full (dl->nodes, (GDestroyNotify)
_cogl_pango_display_list_node_free);
g_slist_foreach (dl->nodes, (GFunc) _cogl_pango_display_list_node_free, NULL);
g_slist_free (dl->nodes);
dl->nodes = NULL;
dl->last_node = NULL;
}

View File

@@ -43,7 +43,6 @@ typedef struct _CoglBitmap CoglBitmap;
#include <cogl/cogl-buffer.h>
#include <cogl/cogl-context.h>
#include <cogl/cogl-pixel-buffer.h>
#include <cogl/cogl-pixel-format.h>
#include <glib-object.h>

View File

@@ -31,7 +31,7 @@
#ifndef __COGL_MUTTER_H___
#define __COGL_MUTTER_H___
#include "cogl-config.h"
#include "cogl-mutter-config.h"
#include "cogl-defines.h"
#include <cogl/cogl-texture.h>

View File

@@ -456,7 +456,11 @@ _cogl_pipeline_free (CoglPipeline *pipeline)
g_slice_free (CoglPipelineBigState, pipeline->big_state);
if (pipeline->differences & COGL_PIPELINE_STATE_LAYERS)
g_list_free_full (pipeline->layer_differences, cogl_object_unref);
{
g_list_foreach (pipeline->layer_differences,
(GFunc)cogl_object_unref, NULL);
g_list_free (pipeline->layer_differences);
}
if (pipeline->differences & COGL_PIPELINE_STATE_VERTEX_SNIPPETS)
_cogl_pipeline_snippet_list_free (&pipeline->big_state->vertex_snippets);
@@ -933,7 +937,12 @@ _cogl_pipeline_copy_differences (CoglPipeline *dest,
if (dest->differences & COGL_PIPELINE_STATE_LAYERS &&
dest->layer_differences)
g_list_free_full (dest->layer_differences, cogl_object_unref);
{
g_list_foreach (dest->layer_differences,
(GFunc)cogl_object_unref,
NULL);
g_list_free (dest->layer_differences);
}
for (l = src->layer_differences; l; l = l->next)
{

View File

@@ -1,310 +0,0 @@
/*
* Cogl
*
* A Low Level GPU Graphics and Utilities API
*
* Copyright (C) 2007,2008,2009,2010 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.
*
*
*/
#include "cogl-config.h"
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include "cogl-pixel-format.h"
/* An entry to map CoglPixelFormats to their respective properties */
typedef struct _CoglPixelFormatInfo
{
CoglPixelFormat cogl_format;
const char *format_str;
int bpp; /* Bytes per pixel */
int aligned; /* Aligned components? (-1 if n/a) */
} CoglPixelFormatInfo;
static const CoglPixelFormatInfo format_info_table[] = {
{
.cogl_format = COGL_PIXEL_FORMAT_ANY,
.format_str = "ANY",
.bpp = 0,
.aligned = -1
},
{
.cogl_format = COGL_PIXEL_FORMAT_A_8,
.format_str = "A_8",
.bpp = 1,
.aligned = 1
},
{
.cogl_format = COGL_PIXEL_FORMAT_RGB_565,
.format_str = "RGB_565",
.bpp = 2,
.aligned = 0
},
{
.cogl_format = COGL_PIXEL_FORMAT_RGBA_4444,
.format_str = "RGBA_4444",
.bpp = 2,
.aligned = 0
},
{
.cogl_format = COGL_PIXEL_FORMAT_RGBA_5551,
.format_str = "RGBA_5551",
.bpp = 2,
.aligned = 0
},
{
.cogl_format = COGL_PIXEL_FORMAT_YUV,
.format_str = "YUV",
.bpp = 0,
.aligned = -1
},
{
.cogl_format = COGL_PIXEL_FORMAT_G_8,
.format_str = "G_8",
.bpp = 1,
.aligned = 1
},
{
.cogl_format = COGL_PIXEL_FORMAT_RG_88,
.format_str = "RG_88",
.bpp = 2,
.aligned = 1
},
{
.cogl_format = COGL_PIXEL_FORMAT_RGB_888,
.format_str = "RGB_888",
.bpp = 3,
.aligned = 1
},
{
.cogl_format = COGL_PIXEL_FORMAT_BGR_888,
.format_str = "BGR_888",
.bpp = 3,
.aligned = 1
},
{
.cogl_format = COGL_PIXEL_FORMAT_RGBA_8888,
.format_str = "RGBA_8888",
.bpp = 4,
.aligned = 1
},
{
.cogl_format = COGL_PIXEL_FORMAT_BGRA_8888,
.format_str = "BGRA_8888",
.bpp = 4,
.aligned = 1
},
{
.cogl_format = COGL_PIXEL_FORMAT_ARGB_8888,
.format_str = "ARGB_8888",
.bpp = 4,
.aligned = 1
},
{
.cogl_format = COGL_PIXEL_FORMAT_ABGR_8888,
.format_str = "ABGR_8888",
.bpp = 4,
.aligned = 1
},
{
.cogl_format = COGL_PIXEL_FORMAT_RGBA_1010102,
.format_str = "RGBA_1010102",
.bpp = 4,
.aligned = 0
},
{
.cogl_format = COGL_PIXEL_FORMAT_BGRA_1010102,
.format_str = "BGRA_1010102",
.bpp = 4,
.aligned = 0
},
{
.cogl_format = COGL_PIXEL_FORMAT_ARGB_2101010,
.format_str = "ARGB_2101010",
.bpp = 4,
.aligned = 0
},
{
.cogl_format = COGL_PIXEL_FORMAT_ABGR_2101010,
.format_str = "ABGR_2101010",
.bpp = 4,
.aligned = 0
},
{
.cogl_format = COGL_PIXEL_FORMAT_RGBA_8888_PRE,
.format_str = "RGBA_8888_PRE",
.bpp = 4,
.aligned = 1
},
{
.cogl_format = COGL_PIXEL_FORMAT_BGRA_8888_PRE,
.format_str = "BGRA_8888_PRE",
.bpp = 4,
.aligned = 1
},
{
.cogl_format = COGL_PIXEL_FORMAT_ARGB_8888_PRE,
.format_str = "ARGB_8888_PRE",
.bpp = 4,
.aligned = 1
},
{
.cogl_format = COGL_PIXEL_FORMAT_ABGR_8888_PRE,
.format_str = "ABGR_8888_PRE",
.bpp = 4,
.aligned = 1
},
{
.cogl_format = COGL_PIXEL_FORMAT_RGBA_4444_PRE,
.format_str = "RGBA_4444_PRE",
.bpp = 2,
.aligned = 0
},
{
.cogl_format = COGL_PIXEL_FORMAT_RGBA_5551_PRE,
.format_str = "RGBA_5551_PRE",
.bpp = 2,
.aligned = 0
},
{
.cogl_format = COGL_PIXEL_FORMAT_RGBA_1010102_PRE,
.format_str = "RGBA_1010102_PRE",
.bpp = 4,
.aligned = 0
},
{
.cogl_format = COGL_PIXEL_FORMAT_BGRA_1010102_PRE,
.format_str = "BGRA_1010102_PRE",
.bpp = 4,
.aligned = 0
},
{
.cogl_format = COGL_PIXEL_FORMAT_ARGB_2101010_PRE,
.format_str = "ARGB_2101010_PRE",
.bpp = 4,
.aligned = 0
},
{
.cogl_format = COGL_PIXEL_FORMAT_ABGR_2101010_PRE,
.format_str = "ABGR_2101010_PRE",
.bpp = 4,
.aligned = 0
},
{
.cogl_format = COGL_PIXEL_FORMAT_DEPTH_16,
.format_str = "DEPTH_16",
.bpp = 2,
.aligned = 1
},
{
.cogl_format = COGL_PIXEL_FORMAT_DEPTH_32,
.format_str = "DEPTH_32",
.bpp = 4,
.aligned = 1
},
{
.cogl_format = COGL_PIXEL_FORMAT_DEPTH_24_STENCIL_8,
.format_str = "DEPTH_24_STENCIL_8",
.bpp = 4,
.aligned = 1
},
};
/*
* Returns the number of bytes-per-pixel of a given format. The bpp
* can be extracted from the least significant nibble of the pixel
* format (see CoglPixelFormat).
*
* The mapping is the following (see discussion on bug #660188):
*
* 0 = undefined
* 1, 8 = 1 bpp (e.g. A_8, G_8)
* 2 = 3 bpp, aligned (e.g. 888)
* 3 = 4 bpp, aligned (e.g. 8888)
* 4-6 = 2 bpp, not aligned (e.g. 565, 4444, 5551)
* 7 = undefined yuv
* 9 = 2 bpp, aligned
* 10 = undefined
* 11 = undefined
* 12 = 3 bpp, not aligned
* 13 = 4 bpp, not aligned (e.g. 2101010)
* 14-15 = undefined
*/
int
_cogl_pixel_format_get_bytes_per_pixel (CoglPixelFormat format)
{
size_t i;
for (i = 0; i < G_N_ELEMENTS (format_info_table); i++)
{
if (format_info_table[i].cogl_format == format)
return format_info_table[i].bpp;
}
g_assert_not_reached ();
}
/* Note: this also refers to the mapping defined above for
* _cogl_pixel_format_get_bytes_per_pixel() */
gboolean
_cogl_pixel_format_is_endian_dependant (CoglPixelFormat format)
{
int aligned = -1;
size_t i;
/* NB: currently checking whether the format components are aligned
* or not determines whether the format is endian dependent or not.
* In the future though we might consider adding formats with
* aligned components that are also endian independant. */
for (i = 0; i < G_N_ELEMENTS (format_info_table); i++)
{
if (format_info_table[i].cogl_format == format)
{
aligned = format_info_table[i].aligned;
break;
}
}
g_return_val_if_fail (aligned != -1, FALSE);
return aligned;
}
const char *
cogl_pixel_format_to_string (CoglPixelFormat format)
{
size_t i;
for (i = 0; i < G_N_ELEMENTS (format_info_table); i++)
{
if (format_info_table[i].cogl_format == format)
return format_info_table[i].format_str;
}
g_assert_not_reached ();
}

View File

@@ -1,300 +0,0 @@
/*
* Cogl
*
* A Low Level GPU Graphics and Utilities API
*
* Copyright (C) 2008,2009 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.
*
*
*/
#if !defined(__COGL_H_INSIDE__) && !defined(COGL_COMPILATION)
#error "Only <cogl/cogl.h> can be included directly."
#endif
#ifndef __COGL_PIXEL_FORMAT_H__
#define __COGL_PIXEL_FORMAT_H__
#include <stdint.h>
#include <stddef.h>
#include <cogl/cogl-defines.h>
#include <glib.h>
#include <glib-object.h>
G_BEGIN_DECLS
/**
* SECTION:cogl-pixel-format
* @short_description: Pixel formats supported by Cogl
*
* The pixel format of an image descrbes how the bits of each pixel are
* represented in memory. For example: an image can be laid out as one long
* sequence of pixels, where each pixel is a sequence of 8 bits of Red, Green
* and Blue. The amount of bits that are used can be different for each pixel
* format, as well as the components (for example an Alpha layer to include
* transparency, or non_RGBA).
*
* Other examples of factors that can influence the layout in memory are the
* system's endianness.
*/
#define COGL_A_BIT (1 << 4)
#define COGL_BGR_BIT (1 << 5)
#define COGL_AFIRST_BIT (1 << 6)
#define COGL_PREMULT_BIT (1 << 7)
#define COGL_DEPTH_BIT (1 << 8)
#define COGL_STENCIL_BIT (1 << 9)
/* XXX: Notes to those adding new formats here...
*
* First this diagram outlines how we allocate the 32bits of a
* CoglPixelFormat currently...
*
* 6 bits for flags
* |-----|
* enum unused 4 bits for the bytes-per-pixel
* and component alignment info
* |------| |-------------| |--|
* 00000000 xxxxxxxx xxxxxxSD PFBA0000
* ^ stencil
* ^ depth
* ^ premult
* ^ alpha first
* ^ bgr order
* ^ has alpha
*
* The most awkward part about the formats is how we use the last 4
* bits to encode the bytes per pixel and component alignment
* information. Ideally we should have had 3 bits for the bpp and a
* flag for alignment but we didn't plan for that in advance so we
* instead use a small lookup table to query the bpp and whether the
* components are byte aligned or not.
*
* The mapping is the following (see discussion on bug #660188):
*
* 0 = undefined
* 1, 8 = 1 bpp (e.g. A_8, G_8)
* 2 = 3 bpp, aligned (e.g. 888)
* 3 = 4 bpp, aligned (e.g. 8888)
* 4-6 = 2 bpp, not aligned (e.g. 565, 4444, 5551)
* 7 = YUV: undefined bpp, undefined alignment
* 9 = 2 bpp, aligned
* 10 = depth, aligned (8, 16, 24, 32, 32f)
* 11 = undefined
* 12 = 3 bpp, not aligned
* 13 = 4 bpp, not aligned (e.g. 2101010)
* 14-15 = undefined
*
* Note: the gap at 10-11 is just because we wanted to maintain that
* all non-aligned formats have the third bit set in case that's
* useful later.
*
* Since we don't want to waste bits adding more and more flags, we'd
* like to see most new pixel formats that can't be represented
* uniquely with the existing flags in the least significant byte
* simply be enumerated with sequential values in the most significant
* enum byte.
*
* Note: Cogl avoids exposing any padded XRGB or RGBX formats and
* instead we leave it up to applications to decided whether they
* consider the A component as padding or valid data. We shouldn't
* change this policy without good reasoning.
*
* So to add a new format:
* 1) Use the mapping table above to figure out what to but in
* the lowest nibble.
* 2) OR in the COGL_PREMULT_BIT, COGL_AFIRST_BIT, COGL_A_BIT and
* COGL_BGR_BIT flags as appropriate.
* 3) If the result is not yet unique then also combine with an
* increment of the last sequence number in the most significant
* byte.
*
* The last sequence number used was 0 (i.e. no formats currently need
* a sequence number)
* Update this note whenever a new sequence number is used.
*/
/**
* CoglPixelFormat:
* @COGL_PIXEL_FORMAT_ANY: Any format
* @COGL_PIXEL_FORMAT_A_8: 8 bits alpha mask
* @COGL_PIXEL_FORMAT_RG_88: RG, 16 bits. Note that red-green textures
* are only available if %COGL_FEATURE_ID_TEXTURE_RG is advertised.
* See cogl_texture_set_components() for details.
* @COGL_PIXEL_FORMAT_RGB_565: RGB, 16 bits
* @COGL_PIXEL_FORMAT_RGBA_4444: RGBA, 16 bits
* @COGL_PIXEL_FORMAT_RGBA_5551: RGBA, 16 bits
* @COGL_PIXEL_FORMAT_YUV: Not currently supported
* @COGL_PIXEL_FORMAT_G_8: Single luminance component
* @COGL_PIXEL_FORMAT_RGB_888: RGB, 24 bits
* @COGL_PIXEL_FORMAT_BGR_888: BGR, 24 bits
* @COGL_PIXEL_FORMAT_RGBA_8888: RGBA, 32 bits
* @COGL_PIXEL_FORMAT_BGRA_8888: BGRA, 32 bits
* @COGL_PIXEL_FORMAT_ARGB_8888: ARGB, 32 bits
* @COGL_PIXEL_FORMAT_ABGR_8888: ABGR, 32 bits
* @COGL_PIXEL_FORMAT_RGBA_1010102 : RGBA, 32 bits, 10 bpc
* @COGL_PIXEL_FORMAT_BGRA_1010102 : BGRA, 32 bits, 10 bpc
* @COGL_PIXEL_FORMAT_ARGB_2101010 : ARGB, 32 bits, 10 bpc
* @COGL_PIXEL_FORMAT_ABGR_2101010 : ABGR, 32 bits, 10 bpc
* @COGL_PIXEL_FORMAT_RGBA_8888_PRE: Premultiplied RGBA, 32 bits
* @COGL_PIXEL_FORMAT_BGRA_8888_PRE: Premultiplied BGRA, 32 bits
* @COGL_PIXEL_FORMAT_ARGB_8888_PRE: Premultiplied ARGB, 32 bits
* @COGL_PIXEL_FORMAT_ABGR_8888_PRE: Premultiplied ABGR, 32 bits
* @COGL_PIXEL_FORMAT_RGBA_4444_PRE: Premultiplied RGBA, 16 bits
* @COGL_PIXEL_FORMAT_RGBA_5551_PRE: Premultiplied RGBA, 16 bits
* @COGL_PIXEL_FORMAT_RGBA_1010102_PRE: Premultiplied RGBA, 32 bits, 10 bpc
* @COGL_PIXEL_FORMAT_BGRA_1010102_PRE: Premultiplied BGRA, 32 bits, 10 bpc
* @COGL_PIXEL_FORMAT_ARGB_2101010_PRE: Premultiplied ARGB, 32 bits, 10 bpc
* @COGL_PIXEL_FORMAT_ABGR_2101010_PRE: Premultiplied ABGR, 32 bits, 10 bpc
*
* Pixel formats used by Cogl. For the formats with a byte per
* component, the order of the components specify the order in
* increasing memory addresses. So for example
* %COGL_PIXEL_FORMAT_RGB_888 would have the red component in the
* lowest address, green in the next address and blue after that
* regardless of the endianness of the system.
*
* For the formats with non byte aligned components the component
* order specifies the order within a 16-bit or 32-bit number from
* most significant bit to least significant. So for
* %COGL_PIXEL_FORMAT_RGB_565, the red component would be in bits
* 11-15, the green component would be in 6-11 and the blue component
* would be in 1-5. Therefore the order in memory depends on the
* endianness of the system.
*
* When uploading a texture %COGL_PIXEL_FORMAT_ANY can be used as the
* internal format. Cogl will try to pick the best format to use
* internally and convert the texture data if necessary.
*
* Since: 0.8
*/
typedef enum /*< prefix=COGL_PIXEL_FORMAT >*/
{
COGL_PIXEL_FORMAT_ANY = 0,
COGL_PIXEL_FORMAT_A_8 = 1 | COGL_A_BIT,
COGL_PIXEL_FORMAT_RGB_565 = 4,
COGL_PIXEL_FORMAT_RGBA_4444 = 5 | COGL_A_BIT,
COGL_PIXEL_FORMAT_RGBA_5551 = 6 | COGL_A_BIT,
COGL_PIXEL_FORMAT_YUV = 7,
COGL_PIXEL_FORMAT_G_8 = 8,
COGL_PIXEL_FORMAT_RG_88 = 9,
COGL_PIXEL_FORMAT_RGB_888 = 2,
COGL_PIXEL_FORMAT_BGR_888 = (2 | COGL_BGR_BIT),
COGL_PIXEL_FORMAT_RGBA_8888 = (3 | COGL_A_BIT),
COGL_PIXEL_FORMAT_BGRA_8888 = (3 | COGL_A_BIT | COGL_BGR_BIT),
COGL_PIXEL_FORMAT_ARGB_8888 = (3 | COGL_A_BIT | COGL_AFIRST_BIT),
COGL_PIXEL_FORMAT_ABGR_8888 = (3 | COGL_A_BIT | COGL_BGR_BIT | COGL_AFIRST_BIT),
COGL_PIXEL_FORMAT_RGBA_1010102 = (13 | COGL_A_BIT),
COGL_PIXEL_FORMAT_BGRA_1010102 = (13 | COGL_A_BIT | COGL_BGR_BIT),
COGL_PIXEL_FORMAT_ARGB_2101010 = (13 | COGL_A_BIT | COGL_AFIRST_BIT),
COGL_PIXEL_FORMAT_ABGR_2101010 = (13 | COGL_A_BIT | COGL_BGR_BIT | COGL_AFIRST_BIT),
COGL_PIXEL_FORMAT_RGBA_8888_PRE = (3 | COGL_A_BIT | COGL_PREMULT_BIT),
COGL_PIXEL_FORMAT_BGRA_8888_PRE = (3 | COGL_A_BIT | COGL_PREMULT_BIT | COGL_BGR_BIT),
COGL_PIXEL_FORMAT_ARGB_8888_PRE = (3 | COGL_A_BIT | COGL_PREMULT_BIT | COGL_AFIRST_BIT),
COGL_PIXEL_FORMAT_ABGR_8888_PRE = (3 | COGL_A_BIT | COGL_PREMULT_BIT | COGL_BGR_BIT | COGL_AFIRST_BIT),
COGL_PIXEL_FORMAT_RGBA_4444_PRE = (COGL_PIXEL_FORMAT_RGBA_4444 | COGL_A_BIT | COGL_PREMULT_BIT),
COGL_PIXEL_FORMAT_RGBA_5551_PRE = (COGL_PIXEL_FORMAT_RGBA_5551 | COGL_A_BIT | COGL_PREMULT_BIT),
COGL_PIXEL_FORMAT_RGBA_1010102_PRE = (COGL_PIXEL_FORMAT_RGBA_1010102 | COGL_PREMULT_BIT),
COGL_PIXEL_FORMAT_BGRA_1010102_PRE = (COGL_PIXEL_FORMAT_BGRA_1010102 | COGL_PREMULT_BIT),
COGL_PIXEL_FORMAT_ARGB_2101010_PRE = (COGL_PIXEL_FORMAT_ARGB_2101010 | COGL_PREMULT_BIT),
COGL_PIXEL_FORMAT_ABGR_2101010_PRE = (COGL_PIXEL_FORMAT_ABGR_2101010 | COGL_PREMULT_BIT),
COGL_PIXEL_FORMAT_DEPTH_16 = (9 | COGL_DEPTH_BIT),
COGL_PIXEL_FORMAT_DEPTH_32 = (3 | COGL_DEPTH_BIT),
COGL_PIXEL_FORMAT_DEPTH_24_STENCIL_8 = (3 | COGL_DEPTH_BIT | COGL_STENCIL_BIT)
} CoglPixelFormat;
/*
* _cogl_pixel_format_get_bytes_per_pixel:
* @format: a #CoglPixelFormat
*
* Queries how many bytes a pixel of the given @format takes.
*
* Return value: The number of bytes taken for a pixel of the given
* @format.
*/
int
_cogl_pixel_format_get_bytes_per_pixel (CoglPixelFormat format);
/*
* _cogl_pixel_format_has_aligned_components:
* @format: a #CoglPixelFormat
*
* Queries whether the ordering of the components for the given
* @format depend on the endianness of the host CPU or if the
* components can be accessed using bit shifting and bitmasking by
* loading a whole pixel into a word.
*
* XXX: If we ever consider making something like this public we
* should really try to think of a better name and come up with
* much clearer documentation since it really depends on what
* point of view you consider this from whether a format like
* COGL_PIXEL_FORMAT_RGBA_8888 is endian dependent. E.g. If you
* read an RGBA_8888 pixel into a uint32
* it's endian dependent how you mask out the different channels.
* But If you already have separate color components and you want
* to write them to an RGBA_8888 pixel then the bytes can be
* written sequentially regardless of the endianness.
*
* Return value: %TRUE if you need to consider the host CPU
* endianness when dealing with the given @format
* else %FALSE.
*/
gboolean
_cogl_pixel_format_is_endian_dependant (CoglPixelFormat format);
/*
* COGL_PIXEL_FORMAT_CAN_HAVE_PREMULT(format):
* @format: a #CoglPixelFormat
*
* Returns TRUE if the pixel format can take a premult bit. This is
* currently true for all formats that have an alpha channel except
* COGL_PIXEL_FORMAT_A_8 (because that doesn't have any other
* components to multiply by the alpha).
*/
#define COGL_PIXEL_FORMAT_CAN_HAVE_PREMULT(format) \
(((format) & COGL_A_BIT) && (format) != COGL_PIXEL_FORMAT_A_8)
/**
* cogl_pixel_format_to_string:
* @format: a #CoglPixelFormat
*
* Returns a string representation of @format, useful for debugging purposes.
*
* Returns: (transfer none): A string representation of @format.
*/
const char *
cogl_pixel_format_to_string (CoglPixelFormat format);
G_END_DECLS
#endif /* __COGL_PIXEL_FORMAT_H__ */

View File

@@ -116,6 +116,57 @@ _cogl_get_enable_legacy_state (void);
#define _cogl_has_private_feature(ctx, feature) \
COGL_FLAGS_GET ((ctx)->private_features, (feature))
/*
* _cogl_pixel_format_get_bytes_per_pixel:
* @format: a #CoglPixelFormat
*
* Queries how many bytes a pixel of the given @format takes.
*
* Return value: The number of bytes taken for a pixel of the given
* @format.
*/
int
_cogl_pixel_format_get_bytes_per_pixel (CoglPixelFormat format);
/*
* _cogl_pixel_format_has_aligned_components:
* @format: a #CoglPixelFormat
*
* Queries whether the ordering of the components for the given
* @format depend on the endianness of the host CPU or if the
* components can be accessed using bit shifting and bitmasking by
* loading a whole pixel into a word.
*
* XXX: If we ever consider making something like this public we
* should really try to think of a better name and come up with
* much clearer documentation since it really depends on what
* point of view you consider this from whether a format like
* COGL_PIXEL_FORMAT_RGBA_8888 is endian dependent. E.g. If you
* read an RGBA_8888 pixel into a uint32
* it's endian dependent how you mask out the different channels.
* But If you already have separate color components and you want
* to write them to an RGBA_8888 pixel then the bytes can be
* written sequentially regardless of the endianness.
*
* Return value: %TRUE if you need to consider the host CPU
* endianness when dealing with the given @format
* else %FALSE.
*/
gboolean
_cogl_pixel_format_is_endian_dependant (CoglPixelFormat format);
/*
* COGL_PIXEL_FORMAT_CAN_HAVE_PREMULT(format):
* @format: a #CoglPixelFormat
*
* Returns TRUE if the pixel format can take a premult bit. This is
* currently true for all formats that have an alpha channel except
* COGL_PIXEL_FORMAT_A_8 (because that doesn't have any other
* components to multiply by the alpha).
*/
#define COGL_PIXEL_FORMAT_CAN_HAVE_PREMULT(format) \
(((format) & COGL_A_BIT) && (format) != COGL_PIXEL_FORMAT_A_8)
G_END_DECLS
#endif /* __COGL_PRIVATE_H__ */

View File

@@ -194,8 +194,10 @@ _cogl_renderer_free (CoglRenderer *renderer)
if (renderer->libgl_module)
g_module_close (renderer->libgl_module);
g_slist_free_full (renderer->event_filters,
(GDestroyNotify) native_filter_closure_free);
g_slist_foreach (renderer->event_filters,
(GFunc) native_filter_closure_free,
NULL);
g_slist_free (renderer->event_filters);
g_array_free (renderer->poll_fds, TRUE);

View File

@@ -53,7 +53,6 @@ typedef struct _CoglTexture CoglTexture;
#include <cogl/cogl-macros.h>
#include <cogl/cogl-defines.h>
#include <cogl/cogl-pixel-buffer.h>
#include <cogl/cogl-pixel-format.h>
#include <cogl/cogl-bitmap.h>
#include <glib-object.h>

View File

@@ -147,6 +147,172 @@ typedef struct _CoglTextureVertex CoglTextureVertex;
#define COGL_DEPTH_BIT (1 << 8)
#define COGL_STENCIL_BIT (1 << 9)
/* XXX: Notes to those adding new formats here...
*
* First this diagram outlines how we allocate the 32bits of a
* CoglPixelFormat currently...
*
* 6 bits for flags
* |-----|
* enum unused 4 bits for the bytes-per-pixel
* and component alignment info
* |------| |-------------| |--|
* 00000000 xxxxxxxx xxxxxxSD PFBA0000
* ^ stencil
* ^ depth
* ^ premult
* ^ alpha first
* ^ bgr order
* ^ has alpha
*
* The most awkward part about the formats is how we use the last 4
* bits to encode the bytes per pixel and component alignment
* information. Ideally we should have had 3 bits for the bpp and a
* flag for alignment but we didn't plan for that in advance so we
* instead use a small lookup table to query the bpp and whether the
* components are byte aligned or not.
*
* The mapping is the following (see discussion on bug #660188):
*
* 0 = undefined
* 1, 8 = 1 bpp (e.g. A_8, G_8)
* 2 = 3 bpp, aligned (e.g. 888)
* 3 = 4 bpp, aligned (e.g. 8888)
* 4-6 = 2 bpp, not aligned (e.g. 565, 4444, 5551)
* 7 = YUV: undefined bpp, undefined alignment
* 9 = 2 bpp, aligned
* 10 = depth, aligned (8, 16, 24, 32, 32f)
* 11 = undefined
* 12 = 3 bpp, not aligned
* 13 = 4 bpp, not aligned (e.g. 2101010)
* 14-15 = undefined
*
* Note: the gap at 10-11 is just because we wanted to maintain that
* all non-aligned formats have the third bit set in case that's
* useful later.
*
* Since we don't want to waste bits adding more and more flags, we'd
* like to see most new pixel formats that can't be represented
* uniquely with the existing flags in the least significant byte
* simply be enumerated with sequential values in the most significant
* enum byte.
*
* Note: Cogl avoids exposing any padded XRGB or RGBX formats and
* instead we leave it up to applications to decided whether they
* consider the A component as padding or valid data. We shouldn't
* change this policy without good reasoning.
*
* So to add a new format:
* 1) Use the mapping table above to figure out what to but in
* the lowest nibble.
* 2) OR in the COGL_PREMULT_BIT, COGL_AFIRST_BIT, COGL_A_BIT and
* COGL_BGR_BIT flags as appropriate.
* 3) If the result is not yet unique then also combine with an
* increment of the last sequence number in the most significant
* byte.
*
* The last sequence number used was 0 (i.e. no formats currently need
* a sequence number)
* Update this note whenever a new sequence number is used.
*/
/**
* CoglPixelFormat:
* @COGL_PIXEL_FORMAT_ANY: Any format
* @COGL_PIXEL_FORMAT_A_8: 8 bits alpha mask
* @COGL_PIXEL_FORMAT_RG_88: RG, 16 bits. Note that red-green textures
* are only available if %COGL_FEATURE_ID_TEXTURE_RG is advertised.
* See cogl_texture_set_components() for details.
* @COGL_PIXEL_FORMAT_RGB_565: RGB, 16 bits
* @COGL_PIXEL_FORMAT_RGBA_4444: RGBA, 16 bits
* @COGL_PIXEL_FORMAT_RGBA_5551: RGBA, 16 bits
* @COGL_PIXEL_FORMAT_YUV: Not currently supported
* @COGL_PIXEL_FORMAT_G_8: Single luminance component
* @COGL_PIXEL_FORMAT_RGB_888: RGB, 24 bits
* @COGL_PIXEL_FORMAT_BGR_888: BGR, 24 bits
* @COGL_PIXEL_FORMAT_RGBA_8888: RGBA, 32 bits
* @COGL_PIXEL_FORMAT_BGRA_8888: BGRA, 32 bits
* @COGL_PIXEL_FORMAT_ARGB_8888: ARGB, 32 bits
* @COGL_PIXEL_FORMAT_ABGR_8888: ABGR, 32 bits
* @COGL_PIXEL_FORMAT_RGBA_1010102 : RGBA, 32 bits, 10 bpc
* @COGL_PIXEL_FORMAT_BGRA_1010102 : BGRA, 32 bits, 10 bpc
* @COGL_PIXEL_FORMAT_ARGB_2101010 : ARGB, 32 bits, 10 bpc
* @COGL_PIXEL_FORMAT_ABGR_2101010 : ABGR, 32 bits, 10 bpc
* @COGL_PIXEL_FORMAT_RGBA_8888_PRE: Premultiplied RGBA, 32 bits
* @COGL_PIXEL_FORMAT_BGRA_8888_PRE: Premultiplied BGRA, 32 bits
* @COGL_PIXEL_FORMAT_ARGB_8888_PRE: Premultiplied ARGB, 32 bits
* @COGL_PIXEL_FORMAT_ABGR_8888_PRE: Premultiplied ABGR, 32 bits
* @COGL_PIXEL_FORMAT_RGBA_4444_PRE: Premultiplied RGBA, 16 bits
* @COGL_PIXEL_FORMAT_RGBA_5551_PRE: Premultiplied RGBA, 16 bits
* @COGL_PIXEL_FORMAT_RGBA_1010102_PRE: Premultiplied RGBA, 32 bits, 10 bpc
* @COGL_PIXEL_FORMAT_BGRA_1010102_PRE: Premultiplied BGRA, 32 bits, 10 bpc
* @COGL_PIXEL_FORMAT_ARGB_2101010_PRE: Premultiplied ARGB, 32 bits, 10 bpc
* @COGL_PIXEL_FORMAT_ABGR_2101010_PRE: Premultiplied ABGR, 32 bits, 10 bpc
*
* Pixel formats used by Cogl. For the formats with a byte per
* component, the order of the components specify the order in
* increasing memory addresses. So for example
* %COGL_PIXEL_FORMAT_RGB_888 would have the red component in the
* lowest address, green in the next address and blue after that
* regardless of the endianness of the system.
*
* For the formats with non byte aligned components the component
* order specifies the order within a 16-bit or 32-bit number from
* most significant bit to least significant. So for
* %COGL_PIXEL_FORMAT_RGB_565, the red component would be in bits
* 11-15, the green component would be in 6-11 and the blue component
* would be in 1-5. Therefore the order in memory depends on the
* endianness of the system.
*
* When uploading a texture %COGL_PIXEL_FORMAT_ANY can be used as the
* internal format. Cogl will try to pick the best format to use
* internally and convert the texture data if necessary.
*
* Since: 0.8
*/
typedef enum /*< prefix=COGL_PIXEL_FORMAT >*/
{
COGL_PIXEL_FORMAT_ANY = 0,
COGL_PIXEL_FORMAT_A_8 = 1 | COGL_A_BIT,
COGL_PIXEL_FORMAT_RGB_565 = 4,
COGL_PIXEL_FORMAT_RGBA_4444 = 5 | COGL_A_BIT,
COGL_PIXEL_FORMAT_RGBA_5551 = 6 | COGL_A_BIT,
COGL_PIXEL_FORMAT_YUV = 7,
COGL_PIXEL_FORMAT_G_8 = 8,
COGL_PIXEL_FORMAT_RG_88 = 9,
COGL_PIXEL_FORMAT_RGB_888 = 2,
COGL_PIXEL_FORMAT_BGR_888 = (2 | COGL_BGR_BIT),
COGL_PIXEL_FORMAT_RGBA_8888 = (3 | COGL_A_BIT),
COGL_PIXEL_FORMAT_BGRA_8888 = (3 | COGL_A_BIT | COGL_BGR_BIT),
COGL_PIXEL_FORMAT_ARGB_8888 = (3 | COGL_A_BIT | COGL_AFIRST_BIT),
COGL_PIXEL_FORMAT_ABGR_8888 = (3 | COGL_A_BIT | COGL_BGR_BIT | COGL_AFIRST_BIT),
COGL_PIXEL_FORMAT_RGBA_1010102 = (13 | COGL_A_BIT),
COGL_PIXEL_FORMAT_BGRA_1010102 = (13 | COGL_A_BIT | COGL_BGR_BIT),
COGL_PIXEL_FORMAT_ARGB_2101010 = (13 | COGL_A_BIT | COGL_AFIRST_BIT),
COGL_PIXEL_FORMAT_ABGR_2101010 = (13 | COGL_A_BIT | COGL_BGR_BIT | COGL_AFIRST_BIT),
COGL_PIXEL_FORMAT_RGBA_8888_PRE = (3 | COGL_A_BIT | COGL_PREMULT_BIT),
COGL_PIXEL_FORMAT_BGRA_8888_PRE = (3 | COGL_A_BIT | COGL_PREMULT_BIT | COGL_BGR_BIT),
COGL_PIXEL_FORMAT_ARGB_8888_PRE = (3 | COGL_A_BIT | COGL_PREMULT_BIT | COGL_AFIRST_BIT),
COGL_PIXEL_FORMAT_ABGR_8888_PRE = (3 | COGL_A_BIT | COGL_PREMULT_BIT | COGL_BGR_BIT | COGL_AFIRST_BIT),
COGL_PIXEL_FORMAT_RGBA_4444_PRE = (COGL_PIXEL_FORMAT_RGBA_4444 | COGL_A_BIT | COGL_PREMULT_BIT),
COGL_PIXEL_FORMAT_RGBA_5551_PRE = (COGL_PIXEL_FORMAT_RGBA_5551 | COGL_A_BIT | COGL_PREMULT_BIT),
COGL_PIXEL_FORMAT_RGBA_1010102_PRE = (COGL_PIXEL_FORMAT_RGBA_1010102 | COGL_PREMULT_BIT),
COGL_PIXEL_FORMAT_BGRA_1010102_PRE = (COGL_PIXEL_FORMAT_BGRA_1010102 | COGL_PREMULT_BIT),
COGL_PIXEL_FORMAT_ARGB_2101010_PRE = (COGL_PIXEL_FORMAT_ARGB_2101010 | COGL_PREMULT_BIT),
COGL_PIXEL_FORMAT_ABGR_2101010_PRE = (COGL_PIXEL_FORMAT_ABGR_2101010 | COGL_PREMULT_BIT),
COGL_PIXEL_FORMAT_DEPTH_16 = (9 | COGL_DEPTH_BIT),
COGL_PIXEL_FORMAT_DEPTH_32 = (3 | COGL_DEPTH_BIT),
COGL_PIXEL_FORMAT_DEPTH_24_STENCIL_8 = (3 | COGL_DEPTH_BIT | COGL_STENCIL_BIT)
} CoglPixelFormat;
/**
* CoglFeatureFlags:
* @COGL_FEATURE_TEXTURE_YUV: ycbcr conversion support

View File

@@ -35,7 +35,6 @@
#include <math.h>
#include <cogl/cogl-defines.h>
#include <cogl/cogl-pixel-format.h>
#include "cogl-types.h"
#include <stdio.h>

View File

@@ -764,3 +764,55 @@ _cogl_init (void)
initialized = TRUE;
}
}
/*
* Returns the number of bytes-per-pixel of a given format. The bpp
* can be extracted from the least significant nibble of the pixel
* format (see CoglPixelFormat).
*
* The mapping is the following (see discussion on bug #660188):
*
* 0 = undefined
* 1, 8 = 1 bpp (e.g. A_8, G_8)
* 2 = 3 bpp, aligned (e.g. 888)
* 3 = 4 bpp, aligned (e.g. 8888)
* 4-6 = 2 bpp, not aligned (e.g. 565, 4444, 5551)
* 7 = undefined yuv
* 9 = 2 bpp, aligned
* 10 = undefined
* 11 = undefined
* 12 = 3 bpp, not aligned
* 13 = 4 bpp, not aligned (e.g. 2101010)
* 14-15 = undefined
*/
int
_cogl_pixel_format_get_bytes_per_pixel (CoglPixelFormat format)
{
int bpp_lut[] = { 0, 1, 3, 4,
2, 2, 2, 0,
1, 2, 0, 0,
3, 4, 0, 0 };
return bpp_lut [format & 0xf];
}
/* Note: this also refers to the mapping defined above for
* _cogl_pixel_format_get_bytes_per_pixel() */
gboolean
_cogl_pixel_format_is_endian_dependant (CoglPixelFormat format)
{
int aligned_lut[] = { -1, 1, 1, 1,
0, 0, 0, -1,
1, 1, -1, -1,
0, 0, -1, -1};
int aligned = aligned_lut[format & 0xf];
_COGL_RETURN_VAL_IF_FAIL (aligned != -1, FALSE);
/* NB: currently checking whether the format components are aligned
* or not determines whether the format is endian dependent or not.
* In the future though we might consider adding formats with
* aligned components that are also endian independant. */
return aligned;
}

View File

@@ -64,7 +64,6 @@
#include <cogl/cogl-matrix.h>
#include <cogl/cogl-matrix-stack.h>
#include <cogl/cogl-offscreen.h>
#include <cogl/cogl-pixel-format.h>
#include <cogl/cogl-primitives.h>
#include <cogl/cogl-texture.h>
#include <cogl/cogl-types.h>

View File

@@ -59,8 +59,10 @@ _cogl_program_free (CoglProgram *program)
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
/* Unref all of the attached shaders and destroy the list */
g_slist_free_full (program->attached_shaders, cogl_handle_unref);
/* Unref all of the attached shaders */
g_slist_foreach (program->attached_shaders, (GFunc) cogl_handle_unref, NULL);
/* Destroy the list */
g_slist_free (program->attached_shaders);
for (i = 0; i < program->custom_uniforms->len; i++)
{

View File

@@ -88,7 +88,6 @@ cogl_headers = [
'cogl-pipeline.h',
'cogl-pipeline-state.h',
'cogl-pipeline-layer-state.h',
'cogl-pixel-format.h',
'cogl-primitives.h',
'cogl-texture.h',
'cogl-texture-2d.h',
@@ -234,7 +233,6 @@ cogl_sources = [
'cogl-display.c',
'cogl-driver.h',
'cogl.c',
'cogl-pixel-format.c',
'cogl-object-private.h',
'cogl-object.h',
'cogl-object.c',

View File

@@ -14,6 +14,12 @@ cogl_config_h = configure_file(
output: 'cogl-config.h',
configuration: cdata)
# TODO: Remove this when autotools support is removed
cogl_mutter_config_h = configure_file(
input: 'cogl-config.h.meson',
output: 'cogl-mutter-config.h',
configuration: cdata)
cogl_pkg_deps = [
glib_dep,
gobject_dep,

View File

@@ -4,9 +4,19 @@ cdata = configuration_data()
cdata.set('HAVE_GL', have_gl.to_int())
cdata.set('HAVE_GLES2', have_gles2.to_int())
cogl_installed_tests_libexecdir = join_paths(
mutter_installed_tests_libexecdir, 'cogl', 'conform')
install_data('run-tests.sh', install_dir: cogl_installed_tests_libexecdir)
# Until meson 0.50 setting the install parameter in 'configure_file' is ignored
# if 'install_dir' is set, then until mutter doesn't depend on such meson version
# cogl_installed_tests_libexecdir should be empty unless have_installed_tests
# is false, or this file will be installed anyway.
#
# See https://github.com/mesonbuild/meson/issues/4160
cogl_installed_tests_libexecdir = ''
if have_installed_tests
cogl_installed_tests_libexecdir = join_paths(
mutter_installed_tests_libexecdir, 'cogl', 'conform')
install_data('run-tests.sh', install_dir: cogl_installed_tests_libexecdir)
endif
cogl_config_env = configure_file(
input: 'config.env.in',

View File

@@ -120,10 +120,6 @@
framebuffers instead of window content,
to manage HiDPI monitors. Does not
require a restart.
• “rt-scheduler” — makes mutter request a low priority
real-time scheduling. The executable
or user must have CAP_SYS_NICE.
Requires a restart.
</description>
</key>

View File

@@ -1,6 +1,6 @@
project('mutter', 'c',
version: '3.33.2',
meson_version: '>= 0.50.0',
version: '3.32.1',
meson_version: '>= 0.48.0',
license: 'GPLv2+'
)
@@ -9,7 +9,6 @@ mutter_plugin_api_version = '3'
libmutter_api_version = '4'
# generic version requirements
fribidi_req = '>= 1.0.0'
glib_req = '>= 2.53.2'
gi_req = '>= 0.9.5'
gtk3_req = '>= 3.19.8'
@@ -87,7 +86,6 @@ pango_dep = dependency('pango', version: pango_req)
cairo_dep = dependency('cairo', version: cairo_req)
cairo_gobject_dep = dependency('cairo-gobject', version: cairo_req)
pangocairo_dep = dependency('pangocairo', version: pangocairo_req)
fribidi_dep = dependency('fribidi', version: fribidi_req)
gsettings_desktop_schemas_dep = dependency('gsettings-desktop-schemas',
version: gsettings_desktop_schemas_req)
glib_dep = dependency('glib-2.0', version: glib_req)

View File

@@ -26,7 +26,6 @@ src/ui/theme.c
src/wayland/meta-wayland-tablet-pad.c
src/x11/meta-x11-display.c
src/x11/meta-x11-errors.c
src/x11/meta-x11-selection-input-stream.c
src/x11/session.c
src/x11/window-props.c
src/x11/xprops.c

View File

@@ -13,8 +13,8 @@ msgid ""
msgstr ""
"Project-Id-Version: mutter.master\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n"
"POT-Creation-Date: 2019-05-15 13:19+0000\n"
"PO-Revision-Date: 2019-05-16 12:38+0200\n"
"POT-Creation-Date: 2019-03-28 12:21+0000\n"
"PO-Revision-Date: 2019-03-01 12:17+0100\n"
"Last-Translator: Daniel Mustieles <daniel.mustieles@gmail.com>\n"
"Language-Team: es <gnome-es-list@gnome.org>\n"
"Language: es\n"
@@ -22,7 +22,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Gtranslator 3.32.0\n"
"X-Generator: Gtranslator 3.31.90\n"
#: data/50-mutter-navigation.xml:6
msgid "Navigation"
@@ -397,16 +397,6 @@ msgid "Enable experimental features"
msgstr "Activar las características experimentales"
#: data/org.gnome.mutter.gschema.xml.in:108
#| msgid ""
#| "To enable experimental features, add the feature keyword to the list. "
#| "Whether the feature requires restarting the compositor depends on the "
#| "given feature. Any experimental feature is not required to still be "
#| "available, or configurable. Dont expect adding anything in this setting "
#| "to be future proof. Currently possible keywords: • “scale-monitor-"
#| "framebuffer” — makes mutter default to layout logical monitors in a "
#| "logical pixel coordinate space, while scaling monitor framebuffers "
#| "instead of window content, to manage HiDPI monitors. Does not require a "
#| "restart."
msgid ""
"To enable experimental features, add the feature keyword to the list. "
"Whether the feature requires restarting the compositor depends on the given "
@@ -415,9 +405,7 @@ msgid ""
"proof. Currently possible keywords: • “scale-monitor-framebuffer” — makes "
"mutter default to layout logical monitors in a logical pixel coordinate "
"space, while scaling monitor framebuffers instead of window content, to "
"manage HiDPI monitors. Does not require a restart. • “rt-scheduler” — makes "
"mutter request a low priority real-time scheduling. The executable or user "
"must have CAP_SYS_NICE. Requires a restart."
"manage HiDPI monitors. Does not require a restart."
msgstr ""
"Para activar las características experimentales, añada la palabra clave de "
"la característica a la lista. Depende de la característica que se deba "
@@ -428,23 +416,21 @@ msgstr ""
"manera predeterminada de disponer monitores lógicos en un espacio lógico de "
"coordenadas de píxeles, al escalar framebuffers de monitores framebuffers en "
"lugar del contenido de ventana, para administrar monitores HiDPI. No "
"requiere un reinicio. • “rt-scheduler” — hace que mutter pida una "
"planificación en tiempo real con prioridad baja. El ejecutable o el usuario "
"deben tener CAP_SYS_NICE. Requiere reniciar."
"requiere un reinicio."
#: data/org.gnome.mutter.gschema.xml.in:145
#: data/org.gnome.mutter.gschema.xml.in:141
msgid "Select window from tab popup"
msgstr "Seleccionar ventana de la pestaña emergente"
#: data/org.gnome.mutter.gschema.xml.in:150
#: data/org.gnome.mutter.gschema.xml.in:146
msgid "Cancel tab popup"
msgstr "Cancelar pestaña emergente"
#: data/org.gnome.mutter.gschema.xml.in:155
#: data/org.gnome.mutter.gschema.xml.in:151
msgid "Switch monitor configurations"
msgstr "Cambiar la configuración del monitor"
#: data/org.gnome.mutter.gschema.xml.in:160
#: data/org.gnome.mutter.gschema.xml.in:156
msgid "Rotates the built-in monitor configuration"
msgstr "Rota la configuración del monitor empotrado"
@@ -548,7 +534,7 @@ msgstr ""
#. TRANSLATORS: This string refers to a button that switches between
#. * different modes.
#.
#: src/backends/meta-input-settings.c:2426
#: src/backends/meta-input-settings.c:2424
#, c-format
msgid "Mode Switch (Group %d)"
msgstr "Cambiar modo (grupo %d)"
@@ -556,34 +542,34 @@ msgstr "Cambiar modo (grupo %d)"
#. TRANSLATORS: This string refers to an action, cycles drawing tablets'
#. * mapping through the available outputs.
#.
#: src/backends/meta-input-settings.c:2449
#: src/backends/meta-input-settings.c:2447
msgid "Switch monitor"
msgstr "Cambiar monitor"
#: src/backends/meta-input-settings.c:2451
#: src/backends/meta-input-settings.c:2449
msgid "Show on-screen help"
msgstr "Mostrar la ayuda en pantalla"
#: src/backends/meta-monitor-manager.c:976
#: src/backends/meta-monitor-manager.c:955
msgid "Built-in display"
msgstr "Pantalla integrada"
#: src/backends/meta-monitor-manager.c:1008
#: src/backends/meta-monitor-manager.c:987
msgid "Unknown"
msgstr "Desconocida"
#: src/backends/meta-monitor-manager.c:1010
#: src/backends/meta-monitor-manager.c:989
msgid "Unknown Display"
msgstr "Pantalla desconocida"
#: src/backends/meta-monitor-manager.c:1018
#: src/backends/meta-monitor-manager.c:997
#, c-format
msgctxt ""
"This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'"
msgid "%s %s"
msgstr "%s %s"
#: src/backends/meta-monitor-manager.c:1026
#: src/backends/meta-monitor-manager.c:1005
#, c-format
msgctxt ""
"This is a monitor vendor name followed by product/model name where size in "
@@ -593,7 +579,7 @@ msgstr "%s %s"
#. This probably means that a non-WM compositor like xcompmgr is running;
#. * we have no way to get it to exit
#: src/compositor/compositor.c:508
#: src/compositor/compositor.c:482
#, c-format
msgid ""
"Another compositing manager is already running on screen %i on display “%s”."
@@ -713,7 +699,7 @@ msgstr "Mutter fue compilado sin soporte para modo prolijo\n"
msgid "Mode Switch: Mode %d"
msgstr "Cambiar modo: modo %d"
#: src/x11/meta-x11-display.c:669
#: src/x11/meta-x11-display.c:666
#, c-format
msgid ""
"Display “%s” already has a window manager; try using the --replace option to "
@@ -722,25 +708,20 @@ msgstr ""
"La pantalla «%s» ya tiene un gestor de ventanas; pruebe a usar la opción «--"
"replace» para reemplazar el gestor de ventanas activo."
#: src/x11/meta-x11-display.c:1011
#: src/x11/meta-x11-display.c:1008
msgid "Failed to initialize GDK\n"
msgstr "Falló al inicializar GDK\n"
#: src/x11/meta-x11-display.c:1035
#: src/x11/meta-x11-display.c:1032
#, c-format
msgid "Failed to open X Window System display “%s”\n"
msgstr "Ocurrió un error al abrir la pantalla de X Window System «%s»\n"
#: src/x11/meta-x11-display.c:1116
#: src/x11/meta-x11-display.c:1113
#, c-format
msgid "Screen %d on display “%s” is invalid\n"
msgstr "La ventana %d en la pantalla «%s» no es válida\n"
#: src/x11/meta-x11-selection-input-stream.c:445
#, c-format
msgid "Format %s not supported"
msgstr "Formato %s no soportado"
#: src/x11/session.c:1821
msgid ""
"These windows do not support “save current setup” and will have to be "

View File

@@ -7,15 +7,15 @@ msgid ""
msgstr ""
"Project-Id-Version: mutter master\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n"
"POT-Creation-Date: 2019-05-03 17:25+0000\n"
"PO-Revision-Date: 2019-05-03 19:39+0200\n"
"POT-Creation-Date: 2019-02-04 17:52+0000\n"
"PO-Revision-Date: 2019-02-05 12:13+0100\n"
"Last-Translator: Fabio Tomat <f.t.public@gmail.com>\n"
"Language-Team: Friulian <fur@li.org>\n"
"Language: fur\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.2.1\n"
"X-Generator: Poedit 2.2\n"
#: data/50-mutter-navigation.xml:6
msgid "Navigation"
@@ -522,7 +522,7 @@ msgstr ""
#. TRANSLATORS: This string refers to a button that switches between
#. * different modes.
#.
#: src/backends/meta-input-settings.c:2426
#: src/backends/meta-input-settings.c:2423
#, c-format
msgid "Mode Switch (Group %d)"
msgstr "Cambie mût (Grup %d)"
@@ -530,34 +530,34 @@ msgstr "Cambie mût (Grup %d)"
#. TRANSLATORS: This string refers to an action, cycles drawing tablets'
#. * mapping through the available outputs.
#.
#: src/backends/meta-input-settings.c:2449
#: src/backends/meta-input-settings.c:2446
msgid "Switch monitor"
msgstr "Cambie visôr"
#: src/backends/meta-input-settings.c:2451
#: src/backends/meta-input-settings.c:2448
msgid "Show on-screen help"
msgstr "Mostre jutori a schermi"
#: src/backends/meta-monitor-manager.c:976
#: src/backends/meta-monitor-manager.c:954
msgid "Built-in display"
msgstr "Display integrât"
#: src/backends/meta-monitor-manager.c:1008
#: src/backends/meta-monitor-manager.c:986
msgid "Unknown"
msgstr "No cognossût"
#: src/backends/meta-monitor-manager.c:1010
#: src/backends/meta-monitor-manager.c:988
msgid "Unknown Display"
msgstr "Display no cognossût"
#: src/backends/meta-monitor-manager.c:1018
#: src/backends/meta-monitor-manager.c:996
#, c-format
msgctxt ""
"This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'"
msgid "%s %s"
msgstr "%s %s"
#: src/backends/meta-monitor-manager.c:1026
#: src/backends/meta-monitor-manager.c:1004
#, c-format
msgctxt ""
"This is a monitor vendor name followed by product/model name where size in "
@@ -567,7 +567,7 @@ msgstr "%s %s"
#. This probably means that a non-WM compositor like xcompmgr is running;
#. * we have no way to get it to exit
#: src/compositor/compositor.c:508
#: src/compositor/compositor.c:482
#, c-format
msgid ""
"Another compositing manager is already running on screen %i on display “%s”."
@@ -575,7 +575,7 @@ msgstr ""
"Un altri compositing manager al è za in esecuzion sul schermi %i sul display "
"“%s”."
#: src/core/bell.c:192
#: src/core/bell.c:252
msgid "Bell event"
msgstr "Event cjampane"
@@ -624,16 +624,16 @@ msgid "Run with X11 backend"
msgstr "Eseguìs cul backend X11"
#. Translators: %s is a window title
#: src/core/meta-close-dialog-default.c:151
#: src/core/meta-close-dialog-default.c:150
#, c-format
msgid "“%s” is not responding."
msgstr "“%s” nol rispuint."
#: src/core/meta-close-dialog-default.c:153
#: src/core/meta-close-dialog-default.c:152
msgid "Application is not responding."
msgstr "La aplicazion no rispuint."
#: src/core/meta-close-dialog-default.c:158
#: src/core/meta-close-dialog-default.c:157
msgid ""
"You may choose to wait a short while for it to continue or force the "
"application to quit entirely."
@@ -641,11 +641,11 @@ msgstr ""
"Al è pussibil sielzi di spietâ un pôc lassant che la aplicazion e continui o "
"sfuarçâ la aplicazion par sierâle dal dut."
#: src/core/meta-close-dialog-default.c:165
#: src/core/meta-close-dialog-default.c:164
msgid "_Force Quit"
msgstr "Sfuarce _Jessude"
#: src/core/meta-close-dialog-default.c:165
#: src/core/meta-close-dialog-default.c:164
msgid "_Wait"
msgstr "_Spiete"
@@ -686,7 +686,7 @@ msgstr "Mutter al è stât compilât cence supuart pe modalitât fetose\n"
msgid "Mode Switch: Mode %d"
msgstr "Cambie mût: mût %d"
#: src/x11/meta-x11-display.c:669
#: src/x11/meta-x11-display.c:666
#, c-format
msgid ""
"Display “%s” already has a window manager; try using the --replace option to "
@@ -695,25 +695,20 @@ msgstr ""
"Il display “%s” al à za un window manager; prove dopre la opzion --replace "
"par rimplaçâ chel atuâl."
#: src/x11/meta-x11-display.c:1011
#: src/x11/meta-x11-display.c:1008
msgid "Failed to initialize GDK\n"
msgstr "No si è rivâts a inizializâ GDK\n"
#: src/x11/meta-x11-display.c:1035
#: src/x11/meta-x11-display.c:1032
#, c-format
msgid "Failed to open X Window System display “%s”\n"
msgstr "Impussibil vierzi il display “%s” di X Window System\n"
#: src/x11/meta-x11-display.c:1116
#: src/x11/meta-x11-display.c:1115
#, c-format
msgid "Screen %d on display “%s” is invalid\n"
msgstr "Schermi %d su display “%s” no valit\n"
#: src/x11/meta-x11-selection-input-stream.c:445
#, c-format
msgid "Format %s not supported"
msgstr "Il formât %s nol è supuartât"
#: src/x11/session.c:1821
msgid ""
"These windows do not support “save current setup” and will have to be "
@@ -722,7 +717,7 @@ msgstr ""
"Chescj barcons no supuartin la funzion “salve impostazions atuâls” e si "
"scugnarà tornâ a inviâlis a man tal prossim acès."
#: src/x11/window-props.c:569
#: src/x11/window-props.c:568
#, c-format
msgid "%s (on %s)"
msgstr "%s (su %s)"

View File

@@ -6,13 +6,12 @@
# Ahmad Riza H Nst <rizahnst@eriagempita.co.id>, 2006.
# Dirgita <dirgitadevina@yahoo.co.id>, 2011, 2012, 2014.
# Andika Triwidada <andika@gmail.com>, 2011-2015.
# Kukuh Syafaat <kukuhsyafaat@gnome.org>, 2017, 2018, 2019.
msgid ""
msgstr ""
"Project-Id-Version: mutter master\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n"
"POT-Creation-Date: 2019-05-06 16:50+0000\n"
"PO-Revision-Date: 2019-05-07 14:13+0700\n"
"POT-Creation-Date: 2019-02-04 17:52+0000\n"
"PO-Revision-Date: 2019-02-06 21:17+0700\n"
"Last-Translator: Kukuh Syafaat <kukuhsyafaat@gnome.org>\n"
"Language-Team: Indonesian <gnome-l10n-id@googlegroups.com>\n"
"Language: id\n"
@@ -527,7 +526,7 @@ msgstr ""
#. TRANSLATORS: This string refers to a button that switches between
#. * different modes.
#.
#: src/backends/meta-input-settings.c:2426
#: src/backends/meta-input-settings.c:2423
#, c-format
msgid "Mode Switch (Group %d)"
msgstr "Tukar Mode: (Grup %d)"
@@ -535,34 +534,34 @@ msgstr "Tukar Mode: (Grup %d)"
#. TRANSLATORS: This string refers to an action, cycles drawing tablets'
#. * mapping through the available outputs.
#.
#: src/backends/meta-input-settings.c:2449
#: src/backends/meta-input-settings.c:2446
msgid "Switch monitor"
msgstr "Berpindah monitor"
#: src/backends/meta-input-settings.c:2451
#: src/backends/meta-input-settings.c:2448
msgid "Show on-screen help"
msgstr "Tampilkan bantuan pada layar"
#: src/backends/meta-monitor-manager.c:976
#: src/backends/meta-monitor-manager.c:954
msgid "Built-in display"
msgstr "Tampilan bawaan"
#: src/backends/meta-monitor-manager.c:1008
#: src/backends/meta-monitor-manager.c:986
msgid "Unknown"
msgstr "Tak Dikenal"
#: src/backends/meta-monitor-manager.c:1010
#: src/backends/meta-monitor-manager.c:988
msgid "Unknown Display"
msgstr "Tampilan Tak Dikenal"
#: src/backends/meta-monitor-manager.c:1018
#: src/backends/meta-monitor-manager.c:996
#, c-format
msgctxt ""
"This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'"
msgid "%s %s"
msgstr "%s %s"
#: src/backends/meta-monitor-manager.c:1026
#: src/backends/meta-monitor-manager.c:1004
#, c-format
msgctxt ""
"This is a monitor vendor name followed by product/model name where size in "
@@ -572,14 +571,14 @@ msgstr "%s %s"
#. This probably means that a non-WM compositor like xcompmgr is running;
#. * we have no way to get it to exit
#: src/compositor/compositor.c:508
#: src/compositor/compositor.c:482
#, c-format
msgid ""
"Another compositing manager is already running on screen %i on display “%s”."
msgstr ""
"Manajer komposit lain telah berjalan pada layar %i pada tampilan \"%s\"."
#: src/core/bell.c:192
#: src/core/bell.c:252
msgid "Bell event"
msgstr "Bel peristiwa"
@@ -628,27 +627,27 @@ msgid "Run with X11 backend"
msgstr "Jalankan dengan backend X11"
#. Translators: %s is a window title
#: src/core/meta-close-dialog-default.c:151
#: src/core/meta-close-dialog-default.c:150
#, c-format
msgid "“%s” is not responding."
msgstr "\"%s\" tak merespon."
#: src/core/meta-close-dialog-default.c:153
#: src/core/meta-close-dialog-default.c:152
msgid "Application is not responding."
msgstr "Aplikasi tak merespon."
#: src/core/meta-close-dialog-default.c:158
#: src/core/meta-close-dialog-default.c:157
msgid ""
"You may choose to wait a short while for it to continue or force the "
"application to quit entirely."
msgstr ""
"Anda bisa memilih untuk menunggu sebentar atau memaksa aplikasi keluar."
#: src/core/meta-close-dialog-default.c:165
#: src/core/meta-close-dialog-default.c:164
msgid "_Force Quit"
msgstr "_Matikan Paksa"
#: src/core/meta-close-dialog-default.c:165
#: src/core/meta-close-dialog-default.c:164
msgid "_Wait"
msgstr "_Tunggu"
@@ -690,7 +689,7 @@ msgstr "Muter dikompilasi tanpa dukungan mode riuh\n"
msgid "Mode Switch: Mode %d"
msgstr "Tukar Mode: Mode %d"
#: src/x11/meta-x11-display.c:669
#: src/x11/meta-x11-display.c:666
#, c-format
msgid ""
"Display “%s” already has a window manager; try using the --replace option to "
@@ -699,25 +698,20 @@ msgstr ""
"Tampilan \"%s\" sudah memiliki manajer jendela; cobalah gunakan pilihan --"
"replace untuk mengganti manajer jendela saat ini."
#: src/x11/meta-x11-display.c:1011
#: src/x11/meta-x11-display.c:1008
msgid "Failed to initialize GDK\n"
msgstr "Gagal menginisialisasi GDK\n"
#: src/x11/meta-x11-display.c:1035
#: src/x11/meta-x11-display.c:1032
#, c-format
msgid "Failed to open X Window System display “%s”\n"
msgstr "Gagal membuka tampilan X Window System \"%s\"\n"
#: src/x11/meta-x11-display.c:1116
#: src/x11/meta-x11-display.c:1115
#, c-format
msgid "Screen %d on display “%s” is invalid\n"
msgstr "Layar %d pada tampilan \"%s\" tidak valid\n"
#: src/x11/meta-x11-selection-input-stream.c:445
#, c-format
msgid "Format %s not supported"
msgstr "Format %s tidak didukung"
#: src/x11/session.c:1821
msgid ""
"These windows do not support “save current setup” and will have to be "
@@ -726,7 +720,7 @@ msgstr ""
"Jendela ini tidak mendukung \"menyimpan setelan aktif saat ini\" dan mesti "
"dijalankan ulang secara manual kala berikut Anda log masuk."
#: src/x11/window-props.c:569
#: src/x11/window-props.c:568
#, c-format
msgid "%s (on %s)"
msgstr "%s (pada %s)"

View File

@@ -381,7 +381,7 @@ guess_candidates (MetaInputMapper *mapper,
info->candidates[META_MATCH_SIZE] = matched_monitor;
}
if (input->builtin || best == N_OUTPUT_MATCHES)
if (input->builtin)
{
best = MIN (best, META_MATCH_IS_BUILTIN);
find_builtin_output (mapper, &info->candidates[META_MATCH_IS_BUILTIN]);

View File

@@ -589,7 +589,12 @@ meta_monitor_normal_derive_layout (MetaMonitor *monitor,
output = meta_monitor_get_main_output (monitor);
crtc = meta_output_get_assigned_crtc (output);
*layout = crtc->rect;
*layout = (MetaRectangle) {
.x = crtc->rect.x,
.y = crtc->rect.y,
.width = crtc->rect.width,
.height = crtc->rect.height
};
}
static gboolean

View File

@@ -33,7 +33,6 @@ typedef enum _MetaExperimentalFeature
META_EXPERIMENTAL_FEATURE_NONE = 0,
META_EXPERIMENTAL_FEATURE_SCALE_MONITOR_FRAMEBUFFER = (1 << 0),
META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS = (1 << 1),
META_EXPERIMENTAL_FEATURE_RT_SCHEDULER = (1 << 2),
} MetaExperimentalFeature;
#define META_TYPE_SETTINGS (meta_settings_get_type ())

View File

@@ -264,8 +264,6 @@ experimental_features_handler (GVariant *features_variant,
features |= META_EXPERIMENTAL_FEATURE_SCALE_MONITOR_FRAMEBUFFER;
else if (g_str_equal (feature, "kms-modifiers"))
features |= META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS;
else if (g_str_equal (feature, "rt-scheduler"))
features |= META_EXPERIMENTAL_FEATURE_RT_SCHEDULER;
else
g_info ("Unknown experimental feature '%s'\n", feature);
}

View File

@@ -37,7 +37,6 @@
#include "backends/native/meta-backend-native.h"
#include "backends/native/meta-backend-native-private.h"
#include <sched.h>
#include <stdlib.h>
#include "backends/meta-cursor-tracker-private.h"
@@ -45,7 +44,6 @@
#include "backends/meta-logical-monitor.h"
#include "backends/meta-monitor-manager-private.h"
#include "backends/meta-pointer-constraint.h"
#include "backends/meta-settings-private.h"
#include "backends/meta-stage-private.h"
#include "backends/native/meta-barrier-native.h"
#include "backends/native/meta-clutter-backend-native.h"
@@ -333,7 +331,6 @@ static void
meta_backend_native_post_init (MetaBackend *backend)
{
ClutterDeviceManager *manager = clutter_device_manager_get_default ();
MetaSettings *settings = meta_backend_get_settings (backend);
META_BACKEND_CLASS (meta_backend_native_parent_class)->post_init (backend);
@@ -341,20 +338,6 @@ meta_backend_native_post_init (MetaBackend *backend)
NULL, NULL);
clutter_evdev_set_relative_motion_filter (manager, relative_motion_filter,
meta_backend_get_monitor_manager (backend));
if (meta_settings_is_experimental_feature_enabled (settings,
META_EXPERIMENTAL_FEATURE_RT_SCHEDULER))
{
int retval;
struct sched_param sp = {
.sched_priority = sched_get_priority_min (SCHED_RR)
};
retval = sched_setscheduler (0, SCHED_RR | SCHED_RESET_ON_FORK, &sp);
if (retval != 0)
g_warning ("Failed to set RT scheduler: %m");
}
}
static MetaMonitorManager *

View File

@@ -1,65 +0,0 @@
/*
* Copyright (C) 2011 Intel Corporation.
* Copyright (C) 2016 Red Hat
* Copyright (C) 2018 DisplayLink (UK) Ltd.
* Copyright (C) 2018 Canonical Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
#include "config.h"
#include "backends/native/meta-drm-buffer-dumb.h"
struct _MetaDrmBufferDumb
{
MetaDrmBuffer parent;
uint32_t fb_id;
};
G_DEFINE_TYPE (MetaDrmBufferDumb, meta_drm_buffer_dumb, META_TYPE_DRM_BUFFER)
MetaDrmBufferDumb *
meta_drm_buffer_dumb_new (uint32_t dumb_fb_id)
{
MetaDrmBufferDumb *buffer_dumb;
buffer_dumb = g_object_new (META_TYPE_DRM_BUFFER_DUMB, NULL);
buffer_dumb->fb_id = dumb_fb_id;
return buffer_dumb;
}
static uint32_t
meta_drm_buffer_dumb_get_fb_id (MetaDrmBuffer *buffer)
{
return META_DRM_BUFFER_DUMB (buffer)->fb_id;
}
static void
meta_drm_buffer_dumb_init (MetaDrmBufferDumb *buffer_dumb)
{
}
static void
meta_drm_buffer_dumb_class_init (MetaDrmBufferDumbClass *klass)
{
MetaDrmBufferClass *buffer_class = META_DRM_BUFFER_CLASS (klass);
buffer_class->get_fb_id = meta_drm_buffer_dumb_get_fb_id;
}

View File

@@ -1,35 +0,0 @@
/*
* Copyright (C) 2018 Canonical Ltd.
* Copyright (C) 2019 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
#ifndef META_DRM_BUFFER_DUMB_H
#define META_DRM_BUFFER_DUMB_H
#include "backends/native/meta-drm-buffer.h"
#define META_TYPE_DRM_BUFFER_DUMB (meta_drm_buffer_dumb_get_type ())
G_DECLARE_FINAL_TYPE (MetaDrmBufferDumb,
meta_drm_buffer_dumb,
META, DRM_BUFFER_DUMB,
MetaDrmBuffer)
MetaDrmBufferDumb * meta_drm_buffer_dumb_new (uint32_t dumb_fb_id);
#endif /* META_DRM_BUFFER_DUMB_H */

View File

@@ -1,232 +0,0 @@
/*
* Copyright (C) 2011 Intel Corporation.
* Copyright (C) 2016 Red Hat
* Copyright (C) 2018 DisplayLink (UK) Ltd.
* Copyright (C) 2018 Canonical Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
#include "config.h"
#include "backends/native/meta-drm-buffer-gbm.h"
#include <drm_fourcc.h>
#include <errno.h>
#include <xf86drm.h>
#include <xf86drmMode.h>
#define INVALID_FB_ID 0U
struct _MetaDrmBufferGbm
{
MetaDrmBuffer parent;
MetaGpuKms *gpu_kms;
struct gbm_surface *surface;
struct gbm_bo *bo;
uint32_t fb_id;
};
G_DEFINE_TYPE (MetaDrmBufferGbm, meta_drm_buffer_gbm, META_TYPE_DRM_BUFFER)
struct gbm_bo *
meta_drm_buffer_gbm_get_bo (MetaDrmBufferGbm *buffer_gbm)
{
return buffer_gbm->bo;
}
static gboolean
acquire_swapped_buffer (MetaDrmBufferGbm *buffer_gbm,
gboolean use_modifiers,
GError **error)
{
uint32_t handles[4] = {0, 0, 0, 0};
uint32_t strides[4] = {0, 0, 0, 0};
uint32_t offsets[4] = {0, 0, 0, 0};
uint64_t modifiers[4] = {0, 0, 0, 0};
uint32_t width, height;
uint32_t format;
struct gbm_bo *bo;
int kms_fd;
kms_fd = meta_gpu_kms_get_fd (buffer_gbm->gpu_kms);
bo = gbm_surface_lock_front_buffer (buffer_gbm->surface);
if (!bo)
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_FAILED,
"gbm_surface_lock_front_buffer failed");
return FALSE;
}
if (gbm_bo_get_handle_for_plane (bo, 0).s32 == -1)
{
/* Failed to fetch handle to plane, falling back to old method */
strides[0] = gbm_bo_get_stride (bo);
handles[0] = gbm_bo_get_handle (bo).u32;
offsets[0] = 0;
modifiers[0] = DRM_FORMAT_MOD_INVALID;
}
else
{
int i;
for (i = 0; i < gbm_bo_get_plane_count (bo); i++)
{
strides[i] = gbm_bo_get_stride_for_plane (bo, i);
handles[i] = gbm_bo_get_handle_for_plane (bo, i).u32;
offsets[i] = gbm_bo_get_offset (bo, i);
modifiers[i] = gbm_bo_get_modifier (bo);
}
}
width = gbm_bo_get_width (bo);
height = gbm_bo_get_height (bo);
format = gbm_bo_get_format (bo);
if (use_modifiers && modifiers[0] != DRM_FORMAT_MOD_INVALID)
{
if (drmModeAddFB2WithModifiers (kms_fd,
width, height,
format,
handles,
strides,
offsets,
modifiers,
&buffer_gbm->fb_id,
DRM_MODE_FB_MODIFIERS))
{
g_set_error (error,
G_IO_ERROR,
g_io_error_from_errno (errno),
"drmModeAddFB2WithModifiers failed: %s",
g_strerror (errno));
gbm_surface_release_buffer (buffer_gbm->surface, bo);
return FALSE;
}
}
else if (drmModeAddFB2 (kms_fd,
width,
height,
format,
handles,
strides,
offsets,
&buffer_gbm->fb_id,
0))
{
if (format != DRM_FORMAT_XRGB8888)
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_FAILED,
"drmModeAddFB does not support format 0x%x",
format);
gbm_surface_release_buffer (buffer_gbm->surface, bo);
return FALSE;
}
if (drmModeAddFB (kms_fd,
width,
height,
24,
32,
strides[0],
handles[0],
&buffer_gbm->fb_id))
{
g_set_error (error,
G_IO_ERROR,
g_io_error_from_errno (errno),
"drmModeAddFB failed: %s",
g_strerror (errno));
gbm_surface_release_buffer (buffer_gbm->surface, bo);
return FALSE;
}
}
buffer_gbm->bo = bo;
return TRUE;
}
MetaDrmBufferGbm *
meta_drm_buffer_gbm_new (MetaGpuKms *gpu_kms,
struct gbm_surface *gbm_surface,
gboolean use_modifiers,
GError **error)
{
MetaDrmBufferGbm *buffer_gbm;
buffer_gbm = g_object_new (META_TYPE_DRM_BUFFER_GBM, NULL);
buffer_gbm->gpu_kms = gpu_kms;
buffer_gbm->surface = gbm_surface;
if (!acquire_swapped_buffer (buffer_gbm, use_modifiers, error))
{
g_object_unref (buffer_gbm);
return NULL;
}
return buffer_gbm;
}
static uint32_t
meta_drm_buffer_gbm_get_fb_id (MetaDrmBuffer *buffer)
{
return META_DRM_BUFFER_GBM (buffer)->fb_id;
}
static void
meta_drm_buffer_gbm_finalize (GObject *object)
{
MetaDrmBufferGbm *buffer_gbm = META_DRM_BUFFER_GBM (object);
if (buffer_gbm->fb_id != INVALID_FB_ID)
{
int kms_fd;
kms_fd = meta_gpu_kms_get_fd (buffer_gbm->gpu_kms);
drmModeRmFB (kms_fd, buffer_gbm->fb_id);
}
if (buffer_gbm->bo)
gbm_surface_release_buffer (buffer_gbm->surface, buffer_gbm->bo);
G_OBJECT_CLASS (meta_drm_buffer_gbm_parent_class)->finalize (object);
}
static void
meta_drm_buffer_gbm_init (MetaDrmBufferGbm *buffer_gbm)
{
}
static void
meta_drm_buffer_gbm_class_init (MetaDrmBufferGbmClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
MetaDrmBufferClass *buffer_class = META_DRM_BUFFER_CLASS (klass);
object_class->finalize = meta_drm_buffer_gbm_finalize;
buffer_class->get_fb_id = meta_drm_buffer_gbm_get_fb_id;
}

View File

@@ -1,43 +0,0 @@
/*
* Copyright (C) 2018 Canonical Ltd.
* Copyright (C) 2019 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
#ifndef META_DRM_BUFFER_GBM_H
#define META_DRM_BUFFER_GBM_H
#include <gbm.h>
#include "backends/native/meta-drm-buffer.h"
#include "backends/native/meta-gpu-kms.h"
#define META_TYPE_DRM_BUFFER_GBM (meta_drm_buffer_gbm_get_type ())
G_DECLARE_FINAL_TYPE (MetaDrmBufferGbm,
meta_drm_buffer_gbm,
META, DRM_BUFFER_GBM,
MetaDrmBuffer)
MetaDrmBufferGbm * meta_drm_buffer_gbm_new (MetaGpuKms *gpu_kms,
struct gbm_surface *gbm_surface,
gboolean use_modifiers,
GError **error);
struct gbm_bo * meta_drm_buffer_gbm_get_bo (MetaDrmBufferGbm *buffer_gbm);
#endif /* META_DRM_BUFFER_GBM_H */

View File

@@ -1,45 +0,0 @@
/*
* Copyright (C) 2011 Intel Corporation.
* Copyright (C) 2016 Red Hat
* Copyright (C) 2018 DisplayLink (UK) Ltd.
* Copyright (C) 2018 Canonical Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* Author: Daniel van Vugt <daniel.van.vugt@canonical.com>
*/
#include "config.h"
#include "backends/native/meta-drm-buffer.h"
G_DEFINE_ABSTRACT_TYPE (MetaDrmBuffer, meta_drm_buffer, G_TYPE_OBJECT)
uint32_t
meta_drm_buffer_get_fb_id (MetaDrmBuffer *buffer)
{
return META_DRM_BUFFER_GET_CLASS (buffer)->get_fb_id (buffer);
}
static void
meta_drm_buffer_init (MetaDrmBuffer *buffer)
{
}
static void
meta_drm_buffer_class_init (MetaDrmBufferClass *klass)
{
}

View File

@@ -1,46 +0,0 @@
/*
* Copyright (C) 2018 Canonical Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* Author: Daniel van Vugt <daniel.van.vugt@canonical.com>
*/
#ifndef META_DRM_BUFFER_H
#define META_DRM_BUFFER_H
#include <glib-object.h>
#include <stdint.h>
#define META_TYPE_DRM_BUFFER (meta_drm_buffer_get_type ())
G_DECLARE_DERIVABLE_TYPE (MetaDrmBuffer,
meta_drm_buffer,
META, DRM_BUFFER,
GObject)
struct _MetaDrmBufferClass
{
GObjectClass parent_class;
uint32_t (* get_fb_id) (MetaDrmBuffer *buffer);
};
MetaDrmBuffer *
meta_drm_buffer_new_from_dumb (uint32_t dumb_fb_id);
uint32_t meta_drm_buffer_get_fb_id (MetaDrmBuffer *buffer);
#endif /* META_DRM_BUFFER_H */

View File

@@ -251,15 +251,13 @@ get_session_proxy (GCancellable *cancellable,
}
static Login1Seat *
get_seat_proxy (gchar *seat_id,
GCancellable *cancellable,
get_seat_proxy (GCancellable *cancellable,
GError **error)
{
g_autofree char *seat_proxy_path = get_escaped_dbus_path ("/org/freedesktop/login1/seat", seat_id);
Login1Seat *seat = login1_seat_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
"org.freedesktop.login1",
seat_proxy_path,
"/org/freedesktop/login1/seat/self",
cancellable, error);
if (!seat)
g_prefix_error(error, "Could not get seat proxy: ");
@@ -513,7 +511,7 @@ meta_launcher_new (GError **error)
if (!seat_id)
goto fail;
seat_proxy = get_seat_proxy (seat_id, NULL, error);
seat_proxy = get_seat_proxy (NULL, error);
if (!seat_proxy)
goto fail;

View File

@@ -58,9 +58,6 @@
#include "backends/meta-output.h"
#include "backends/meta-renderer-view.h"
#include "backends/native/meta-crtc-kms.h"
#include "backends/native/meta-drm-buffer-dumb.h"
#include "backends/native/meta-drm-buffer-gbm.h"
#include "backends/native/meta-drm-buffer.h"
#include "backends/native/meta-gpu-kms.h"
#include "backends/native/meta-monitor-manager-kms.h"
#include "backends/native/meta-renderer-native-gles3.h"
@@ -147,8 +144,10 @@ typedef struct _MetaOnscreenNativeSecondaryGpuState
struct {
struct gbm_surface *surface;
MetaDrmBuffer *current_fb;
MetaDrmBuffer *next_fb;
uint32_t current_fb_id;
uint32_t next_fb_id;
struct gbm_bo *current_bo;
struct gbm_bo *next_bo;
} gbm;
struct {
@@ -169,8 +168,10 @@ typedef struct _MetaOnscreenNative
struct {
struct gbm_surface *surface;
MetaDrmBuffer *current_fb;
MetaDrmBuffer *next_fb;
uint32_t current_fb_id;
uint32_t next_fb_id;
struct gbm_bo *current_bo;
struct gbm_bo *next_bo;
} gbm;
#ifdef HAVE_EGL_DEVICE
@@ -970,12 +971,25 @@ free_current_secondary_bo (MetaGpuKms *gpu_kms,
MetaOnscreenNativeSecondaryGpuState *secondary_gpu_state)
{
MetaRendererNativeGpuData *renderer_gpu_data;
int kms_fd;
kms_fd = meta_gpu_kms_get_fd (gpu_kms);
renderer_gpu_data = secondary_gpu_state->renderer_gpu_data;
switch (renderer_gpu_data->secondary.copy_mode)
{
case META_SHARED_FRAMEBUFFER_COPY_MODE_GPU:
g_clear_object (&secondary_gpu_state->gbm.current_fb);
if (secondary_gpu_state->gbm.current_fb_id)
{
drmModeRmFB (kms_fd, secondary_gpu_state->gbm.current_fb_id);
secondary_gpu_state->gbm.current_fb_id = 0;
}
if (secondary_gpu_state->gbm.current_bo)
{
gbm_surface_release_buffer (secondary_gpu_state->gbm.surface,
secondary_gpu_state->gbm.current_bo);
secondary_gpu_state->gbm.current_bo = NULL;
}
break;
case META_SHARED_FRAMEBUFFER_COPY_MODE_CPU:
break;
@@ -987,8 +1001,22 @@ free_current_bo (CoglOnscreen *onscreen)
{
CoglOnscreenEGL *onscreen_egl = onscreen->winsys;
MetaOnscreenNative *onscreen_native = onscreen_egl->platform;
MetaGpuKms *render_gpu = onscreen_native->render_gpu;
int kms_fd;
g_clear_object (&onscreen_native->gbm.current_fb);
kms_fd = meta_gpu_kms_get_fd (render_gpu);
if (onscreen_native->gbm.current_fb_id)
{
drmModeRmFB (kms_fd, onscreen_native->gbm.current_fb_id);
onscreen_native->gbm.current_fb_id = 0;
}
if (onscreen_native->gbm.current_bo)
{
gbm_surface_release_buffer (onscreen_native->gbm.surface,
onscreen_native->gbm.current_bo);
onscreen_native->gbm.current_bo = NULL;
}
g_hash_table_foreach (onscreen_native->secondary_gpu_states,
(GHFunc) free_current_secondary_bo,
@@ -1282,9 +1310,11 @@ static void
swap_secondary_drm_fb (MetaGpuKms *gpu_kms,
MetaOnscreenNativeSecondaryGpuState *secondary_gpu_state)
{
g_set_object (&secondary_gpu_state->gbm.current_fb,
secondary_gpu_state->gbm.next_fb);
g_clear_object (&secondary_gpu_state->gbm.next_fb);
secondary_gpu_state->gbm.current_fb_id = secondary_gpu_state->gbm.next_fb_id;
secondary_gpu_state->gbm.next_fb_id = 0;
secondary_gpu_state->gbm.current_bo = secondary_gpu_state->gbm.next_bo;
secondary_gpu_state->gbm.next_bo = NULL;
}
static void
@@ -1295,8 +1325,11 @@ meta_onscreen_native_swap_drm_fb (CoglOnscreen *onscreen)
free_current_bo (onscreen);
g_set_object (&onscreen_native->gbm.current_fb, onscreen_native->gbm.next_fb);
g_clear_object (&onscreen_native->gbm.next_fb);
onscreen_native->gbm.current_fb_id = onscreen_native->gbm.next_fb_id;
onscreen_native->gbm.next_fb_id = 0;
onscreen_native->gbm.current_bo = onscreen_native->gbm.next_bo;
onscreen_native->gbm.next_bo = NULL;
g_hash_table_foreach (onscreen_native->secondary_gpu_states,
(GHFunc) swap_secondary_drm_fb,
@@ -1380,7 +1413,17 @@ free_next_secondary_bo (MetaGpuKms *gpu_kms,
switch (renderer_gpu_data->secondary.copy_mode)
{
case META_SHARED_FRAMEBUFFER_COPY_MODE_GPU:
g_clear_object (&secondary_gpu_state->gbm.next_fb);
if (secondary_gpu_state->gbm.next_fb_id)
{
int kms_fd;
kms_fd = meta_gpu_kms_get_fd (gpu_kms);
drmModeRmFB (kms_fd, secondary_gpu_state->gbm.next_fb_id);
gbm_surface_release_buffer (secondary_gpu_state->gbm.surface,
secondary_gpu_state->gbm.next_bo);
secondary_gpu_state->gbm.next_fb_id = 0;
secondary_gpu_state->gbm.next_bo = NULL;
}
break;
case META_SHARED_FRAMEBUFFER_COPY_MODE_CPU:
break;
@@ -1405,7 +1448,17 @@ flip_closure_destroyed (MetaRendererView *view)
switch (renderer_gpu_data->mode)
{
case META_RENDERER_NATIVE_MODE_GBM:
g_clear_object (&onscreen_native->gbm.next_fb);
if (onscreen_native->gbm.next_fb_id)
{
int kms_fd;
kms_fd = meta_gpu_kms_get_fd (render_gpu);
drmModeRmFB (kms_fd, onscreen_native->gbm.next_fb_id);
gbm_surface_release_buffer (onscreen_native->gbm.surface,
onscreen_native->gbm.next_bo);
onscreen_native->gbm.next_bo = NULL;
onscreen_native->gbm.next_fb_id = 0;
}
g_hash_table_foreach (onscreen_native->secondary_gpu_states,
(GHFunc) free_next_secondary_bo,
@@ -1755,12 +1808,12 @@ meta_onscreen_native_flip_crtc (CoglOnscreen *onscreen,
case META_RENDERER_NATIVE_MODE_GBM:
if (gpu_kms == render_gpu)
{
fb_id = meta_drm_buffer_get_fb_id (onscreen_native->gbm.next_fb);
fb_id = onscreen_native->gbm.next_fb_id;
}
else
{
secondary_gpu_state = get_secondary_gpu_state (onscreen, gpu_kms);
fb_id = meta_drm_buffer_get_fb_id (secondary_gpu_state->gbm.next_fb);
fb_id = secondary_gpu_state->gbm.next_fb_id;
}
if (!meta_gpu_kms_flip_crtc (gpu_kms,
@@ -1826,7 +1879,7 @@ set_crtc_fb (CoglOnscreen *onscreen,
if (!secondary_gpu_state)
return;
fb_id = meta_drm_buffer_get_fb_id (secondary_gpu_state->gbm.next_fb);
fb_id = secondary_gpu_state->gbm.next_fb_id;
}
x = crtc->rect.x - logical_monitor->rect.x;
@@ -1869,7 +1922,7 @@ meta_onscreen_native_set_crtc_modes (CoglOnscreen *onscreen)
switch (renderer_gpu_data->mode)
{
case META_RENDERER_NATIVE_MODE_GBM:
fb_id = meta_drm_buffer_get_fb_id (onscreen_native->gbm.next_fb);
fb_id = onscreen_native->gbm.next_fb_id;
break;
#ifdef HAVE_EGL_DEVICE
case META_RENDERER_NATIVE_MODE_EGL_DEVICE:
@@ -1937,7 +1990,7 @@ crtc_mode_set_fallback (CoglOnscreen *onscreen,
return FALSE;
}
fb_id = meta_drm_buffer_get_fb_id (onscreen_native->gbm.next_fb);
fb_id = onscreen_native->gbm.next_fb_id;
set_crtc_fb (onscreen, logical_monitor, crtc, fb_id);
return TRUE;
}
@@ -2037,6 +2090,101 @@ meta_onscreen_native_flip_crtcs (CoglOnscreen *onscreen)
g_closure_unref (flip_closure);
}
static gboolean
gbm_get_next_fb_id (MetaGpuKms *gpu_kms,
struct gbm_surface *gbm_surface,
struct gbm_bo **out_next_bo,
uint32_t *out_next_fb_id)
{
MetaRendererNative *renderer_native = meta_renderer_native_from_gpu (gpu_kms);
struct gbm_bo *next_bo;
uint32_t next_fb_id;
int kms_fd;
uint32_t handles[4] = { 0, };
uint32_t strides[4] = { 0, };
uint32_t offsets[4] = { 0, };
uint64_t modifiers[4] = { 0, };
int i;
/* Now we need to set the CRTC to whatever is the front buffer */
next_bo = gbm_surface_lock_front_buffer (gbm_surface);
if (!next_bo)
{
g_error ("Impossible to lock surface front buffer: %m");
return FALSE;
}
if (gbm_bo_get_handle_for_plane (next_bo, 0).s32 == -1)
{
/* Failed to fetch handle to plane, falling back to old method */
strides[0] = gbm_bo_get_stride (next_bo);
handles[0] = gbm_bo_get_handle (next_bo).u32;
offsets[0] = 0;
modifiers[0] = DRM_FORMAT_MOD_INVALID;
}
else
{
for (i = 0; i < gbm_bo_get_plane_count (next_bo); i++)
{
strides[i] = gbm_bo_get_stride_for_plane (next_bo, i);
handles[i] = gbm_bo_get_handle_for_plane (next_bo, i).u32;
offsets[i] = gbm_bo_get_offset (next_bo, i);
modifiers[i] = gbm_bo_get_modifier (next_bo);
}
}
kms_fd = meta_gpu_kms_get_fd (gpu_kms);
if (renderer_native->use_modifiers &&
modifiers[0] != DRM_FORMAT_MOD_INVALID)
{
if (drmModeAddFB2WithModifiers (kms_fd,
gbm_bo_get_width (next_bo),
gbm_bo_get_height (next_bo),
gbm_bo_get_format (next_bo),
handles,
strides,
offsets,
modifiers,
&next_fb_id,
DRM_MODE_FB_MODIFIERS))
{
g_warning ("Failed to create new back buffer handle: %m");
gbm_surface_release_buffer (gbm_surface, next_bo);
return FALSE;
}
}
else if (drmModeAddFB2 (kms_fd,
gbm_bo_get_width (next_bo),
gbm_bo_get_height (next_bo),
gbm_bo_get_format (next_bo),
handles,
strides,
offsets,
&next_fb_id,
0))
{
if (drmModeAddFB (kms_fd,
gbm_bo_get_width (next_bo),
gbm_bo_get_height (next_bo),
24, /* depth */
32, /* bpp */
strides[0],
handles[0],
&next_fb_id))
{
g_warning ("Failed to create new back buffer handle: %m");
gbm_surface_release_buffer (gbm_surface, next_bo);
return FALSE;
}
}
*out_next_bo = next_bo;
*out_next_fb_id = next_fb_id;
return TRUE;
}
static void
wait_for_pending_flips (CoglOnscreen *onscreen)
{
@@ -2069,8 +2217,6 @@ copy_shared_framebuffer_gpu (CoglOnscreen *onscreen,
MetaRendererNative *renderer_native = renderer_gpu_data->renderer_native;
MetaEgl *egl = meta_renderer_native_get_egl (renderer_native);
GError *error = NULL;
MetaDrmBufferGbm *buffer_gbm;
struct gbm_bo *bo;
if (!meta_egl_make_current (egl,
renderer_gpu_data->egl_display,
@@ -2086,14 +2232,12 @@ copy_shared_framebuffer_gpu (CoglOnscreen *onscreen,
*egl_context_changed = TRUE;
buffer_gbm = META_DRM_BUFFER_GBM (onscreen_native->gbm.next_fb);
bo = meta_drm_buffer_gbm_get_bo (buffer_gbm);
if (!meta_renderer_native_gles3_blit_shared_bo (egl,
renderer_native->gles3,
renderer_gpu_data->egl_display,
renderer_gpu_data->secondary.egl_context,
secondary_gpu_state->egl_surface,
bo,
onscreen_native->gbm.next_bo,
&error))
{
g_warning ("Failed to blit shared framebuffer: %s", error->message);
@@ -2111,19 +2255,10 @@ copy_shared_framebuffer_gpu (CoglOnscreen *onscreen,
return;
}
g_clear_object (&secondary_gpu_state->gbm.next_fb);
buffer_gbm = meta_drm_buffer_gbm_new (secondary_gpu_state->gpu_kms,
secondary_gpu_state->gbm.surface,
renderer_native->use_modifiers,
&error);
secondary_gpu_state->gbm.next_fb = META_DRM_BUFFER (buffer_gbm);
if (!secondary_gpu_state->gbm.next_fb)
{
g_warning ("meta_drm_buffer_gbm_new failed: %s",
error->message);
g_error_free (error);
return;
}
gbm_get_next_fb_id (secondary_gpu_state->gpu_kms,
secondary_gpu_state->gbm.surface,
&secondary_gpu_state->gbm.next_bo,
&secondary_gpu_state->gbm.next_fb_id);
}
typedef struct _PixelFormatMap {
@@ -2202,7 +2337,6 @@ copy_shared_framebuffer_cpu (CoglOnscreen *onscreen,
CoglBitmap *dumb_bitmap;
CoglPixelFormat cogl_format;
gboolean ret;
MetaDrmBufferDumb *buffer_dumb;
width = cogl_framebuffer_get_width (framebuffer);
height = cogl_framebuffer_get_height (framebuffer);
@@ -2243,9 +2377,7 @@ copy_shared_framebuffer_cpu (CoglOnscreen *onscreen,
cogl_object_unref (dumb_bitmap);
g_clear_object (&secondary_gpu_state->gbm.next_fb);
buffer_dumb = meta_drm_buffer_dumb_new (target_fb_id);
secondary_gpu_state->gbm.next_fb = META_DRM_BUFFER (buffer_dumb);
secondary_gpu_state->gbm.next_fb_id = target_fb_id;
}
static void
@@ -2332,8 +2464,6 @@ meta_onscreen_native_swap_buffers_with_damage (CoglOnscreen *onscreen,
CoglFrameInfo *frame_info;
gboolean egl_context_changed = FALSE;
MetaPowerSave power_save_mode;
g_autoptr (GError) error = NULL;
MetaDrmBufferGbm *buffer_gbm;
/*
* Wait for the flip callback before continuing, as we might have started the
@@ -2355,20 +2485,14 @@ meta_onscreen_native_swap_buffers_with_damage (CoglOnscreen *onscreen,
switch (renderer_gpu_data->mode)
{
case META_RENDERER_NATIVE_MODE_GBM:
g_warn_if_fail (onscreen_native->gbm.next_fb == NULL);
g_clear_object (&onscreen_native->gbm.next_fb);
g_warn_if_fail (onscreen_native->gbm.next_bo == NULL &&
onscreen_native->gbm.next_fb_id == 0);
buffer_gbm = meta_drm_buffer_gbm_new (render_gpu,
onscreen_native->gbm.surface,
renderer_native->use_modifiers,
&error);
onscreen_native->gbm.next_fb = META_DRM_BUFFER (buffer_gbm);
if (!onscreen_native->gbm.next_fb)
{
g_warning ("meta_drm_buffer_gbm_new failed: %s",
error->message);
return;
}
if (!gbm_get_next_fb_id (render_gpu,
onscreen_native->gbm.surface,
&onscreen_native->gbm.next_bo,
&onscreen_native->gbm.next_fb_id))
return;
break;
#ifdef HAVE_EGL_DEVICE
@@ -2959,7 +3083,7 @@ meta_renderer_native_release_onscreen (CoglOnscreen *onscreen)
case META_RENDERER_NATIVE_MODE_GBM:
/* flip state takes a reference on the onscreen so there should
* never be outstanding flips when we reach here. */
g_return_if_fail (onscreen_native->gbm.next_fb == NULL);
g_return_if_fail (onscreen_native->gbm.next_fb_id == 0);
free_current_bo (onscreen);

View File

@@ -851,7 +851,10 @@ meta_rectangle_expand_to_avoiding_struts (MetaRectangle *rect,
void
meta_rectangle_free_list_and_elements (GList *filled_list)
{
g_list_free_full (filled_list, g_free);
g_list_foreach (filled_list,
(void (*)(gpointer,gpointer))&g_free, /* ew, for ugly */
NULL);
g_list_free (filled_list);
}
gboolean
@@ -2051,11 +2054,25 @@ meta_rectangle_scale_double (const MetaRectangle *rect,
MetaRoundingStrategy rounding_strategy,
MetaRectangle *dest)
{
ClutterRect tmp = CLUTTER_RECT_INIT (rect->x, rect->y,
rect->width, rect->height);
clutter_rect_scale (&tmp, scale, scale);
meta_rectangle_from_clutter_rect (&tmp, rounding_strategy, dest);
switch (rounding_strategy)
{
case META_ROUNDING_STRATEGY_SHRINK:
*dest = (MetaRectangle) {
.x = (int) ceil (rect->x * scale),
.y = (int) ceil (rect->y * scale),
.width = (int) floor (rect->width * scale),
.height = (int) floor (rect->height * scale),
};
break;
case META_ROUNDING_STRATEGY_GROW:
*dest = (MetaRectangle) {
.x = (int) floor (rect->x * scale),
.y = (int) floor (rect->y * scale),
.width = (int) ceil (rect->width * scale),
.height = (int) ceil (rect->height * scale),
};
break;
}
}
void
@@ -2068,7 +2085,12 @@ meta_rectangle_transform (const MetaRectangle *rect,
switch (transform)
{
case META_MONITOR_TRANSFORM_NORMAL:
*dest = *rect;
*dest = (MetaRectangle) {
.x = rect->x,
.y = rect->y,
.width = rect->width,
.height = rect->height,
};
break;
case META_MONITOR_TRANSFORM_90:
*dest = (MetaRectangle) {

View File

@@ -1157,7 +1157,13 @@ compute_resistance_and_snapping_edges (MetaDisplay *display)
g_list_free (stacked_windows);
/* Free the memory used by the obscuring windows/docks lists */
g_slist_free (window_stacking);
g_slist_free_full (obscuring_windows, g_free);
/* FIXME: Shouldn't there be a helper function to make this one line of code
* to free a list instead of four ugly ones?
*/
g_slist_foreach (obscuring_windows,
(void (*)(gpointer,gpointer))&g_free, /* ew, for ugly */
NULL);
g_slist_free (obscuring_windows);
/* Sort the list. FIXME: Should I bother with this sorting? I just
* sort again later in cache_edges() anyway...

View File

@@ -110,24 +110,13 @@ static void
meta_launch_context_constructed (GObject *object)
{
MetaLaunchContext *context = META_LAUNCH_CONTEXT (object);
const char *x11_display, *wayland_display;
G_OBJECT_CLASS (meta_launch_context_parent_class)->constructed (object);
x11_display = getenv ("DISPLAY");
wayland_display = getenv ("WAYLAND_DISPLAY");
if (x11_display)
{
g_app_launch_context_setenv (G_APP_LAUNCH_CONTEXT (context),
"DISPLAY", x11_display);
}
if (wayland_display)
{
g_app_launch_context_setenv (G_APP_LAUNCH_CONTEXT (context),
"WAYLAND_DISPLAY", wayland_display);
}
g_app_launch_context_setenv (G_APP_LAUNCH_CONTEXT (context),
"DISPLAY", getenv ("DISPLAY"));
g_app_launch_context_setenv (G_APP_LAUNCH_CONTEXT (context),
"WAYLAND_DISPLAY", getenv ("WAYLAND_DISPLAY"));
}
static gchar *

View File

@@ -622,9 +622,12 @@ meta_window_process_placement (MetaWindow *window,
window_height = placement_rule->height;
meta_window_get_frame_rect (parent, &parent_rect);
anchor_rect = placement_rule->anchor_rect;
anchor_rect.x += parent_rect.x;
anchor_rect.y += parent_rect.y;
anchor_rect = (MetaRectangle) {
.x = parent_rect.x + placement_rule->anchor_rect.x,
.y = parent_rect.y + placement_rule->anchor_rect.y,
.width = placement_rule->anchor_rect.width,
.height = placement_rule->anchor_rect.height,
};
/* Place at anchor point. */
if (placement_rule->anchor & META_PLACEMENT_ANCHOR_LEFT)

View File

@@ -575,7 +575,8 @@ meta_startup_notification_finalize (GObject *object)
if (sn->startup_sequence_timeout)
g_source_remove (sn->startup_sequence_timeout);
g_slist_free_full (sn->startup_sequences, g_object_unref);
g_slist_foreach (sn->startup_sequences, (GFunc) g_object_unref, NULL);
g_slist_free (sn->startup_sequences);
sn->startup_sequences = NULL;
G_OBJECT_CLASS (meta_startup_notification_parent_class)->finalize (object);

View File

@@ -241,6 +241,20 @@ utf8_fputs (const char *str,
return retval;
}
/**
* meta_free_gslist_and_elements: (skip)
* @list_to_deep_free: list to deep free
*
*/
void
meta_free_gslist_and_elements (GSList *list_to_deep_free)
{
g_slist_foreach (list_to_deep_free,
(void (*)(gpointer,gpointer))&g_free, /* ew, for ugly */
NULL);
g_slist_free (list_to_deep_free);
}
#ifdef WITH_VERBOSE_MODE
void
meta_debug_spew_real (const char *format, ...)

View File

@@ -692,7 +692,7 @@ meta_window_class_init (MetaWindowClass *klass)
* MetaWindow::size-changed:
* @window: a #MetaWindow
*
* This is emitted when the size of a window might
* This is emitted when the position of a window might
* have changed. Specifically, this is emitted when the
* size of the toplevel window has changed, or when the
* size of the client window has changed.
@@ -1525,7 +1525,7 @@ meta_window_unmanage (MetaWindow *window,
if (window->struts)
{
g_slist_free_full (window->struts, g_free);
meta_free_gslist_and_elements (window->struts);
window->struts = NULL;
meta_topic (META_DEBUG_WORKAREA,

View File

@@ -52,6 +52,8 @@ void meta_workspace_queue_calc_showing (MetaWorkspace *workspace);
static void focus_ancestor_or_top_window (MetaWorkspace *workspace,
MetaWindow *not_this_one,
guint32 timestamp);
static void free_this (gpointer candidate,
gpointer dummy);
G_DEFINE_TYPE (MetaWorkspace, meta_workspace, G_TYPE_OBJECT);
@@ -263,6 +265,13 @@ meta_workspace_new (MetaWorkspaceManager *workspace_manager)
return workspace;
}
/* Foreach function for workspace_free_struts() */
static void
free_this (gpointer candidate, gpointer dummy)
{
g_free (candidate);
}
/**
* workspace_free_all_struts:
* @workspace: The workspace.
@@ -275,7 +284,8 @@ workspace_free_all_struts (MetaWorkspace *workspace)
if (workspace->all_struts == NULL)
return;
g_slist_free_full (workspace->all_struts, g_free);
g_slist_foreach (workspace->all_struts, free_this, NULL);
g_slist_free (workspace->all_struts);
workspace->all_struts = NULL;
}
@@ -291,7 +301,8 @@ workspace_free_builtin_struts (MetaWorkspace *workspace)
if (workspace->builtin_struts == NULL)
return;
g_slist_free_full (workspace->builtin_struts, g_free);
g_slist_foreach (workspace->builtin_struts, free_this, NULL);
g_slist_free (workspace->builtin_struts);
workspace->builtin_struts = NULL;
}

View File

@@ -574,12 +574,6 @@ if have_native_backend
'backends/native/meta-crtc-kms.h',
'backends/native/meta-cursor-renderer-native.c',
'backends/native/meta-cursor-renderer-native.h',
'backends/native/meta-drm-buffer-dumb.c',
'backends/native/meta-drm-buffer-dumb.h',
'backends/native/meta-drm-buffer-gbm.c',
'backends/native/meta-drm-buffer-gbm.h',
'backends/native/meta-drm-buffer.c',
'backends/native/meta-drm-buffer.h',
'backends/native/meta-gpu-kms.c',
'backends/native/meta-gpu-kms.h',
'backends/native/meta-input-settings-native.c',

View File

@@ -149,6 +149,9 @@ char* meta_external_binding_name_for_action (guint keybinding_action);
META_EXPORT
char* meta_g_utf8_strndup (const gchar *src, gsize n);
META_EXPORT
void meta_free_gslist_and_elements (GSList *list_to_deep_free);
META_EXPORT
GPid meta_show_dialog (const char *type,
const char *message,

View File

@@ -121,7 +121,6 @@
<arg name="dy" type="d" direction="in" />
<arg name="flags" type="u" direction="in" />
</method>
<!--
NotifyPointerAxisDiscrete:
@@ -135,7 +134,7 @@
<!--
NotifyPointerMotionRelative:
A relative pointer motion event notification
A absolute pointer motion event notification
-->
<method name="NotifyPointerMotionRelative">
<arg name="dx" type="d" direction="in" />

View File

@@ -221,7 +221,13 @@ test_basic_fitting (void)
static void
free_strut_list (GSList *struts)
{
g_slist_free_full (struts, g_free);
GSList *tmp = struts;
while (tmp)
{
g_free (tmp->data);
tmp = tmp->next;
}
g_slist_free (struts);
}
static GSList*

View File

@@ -253,9 +253,16 @@ meta_wayland_actor_surface_commit (MetaWaylandSurfaceRole *surface_role,
{
MetaWaylandActorSurface *actor_surface =
META_WAYLAND_ACTOR_SURFACE (surface_role);
MetaWaylandSurface *surface =
meta_wayland_surface_role_get_surface (surface_role);
MetaWaylandSurface *toplevel_surface;
meta_wayland_actor_surface_queue_frame_callbacks (actor_surface, pending);
toplevel_surface = meta_wayland_surface_get_toplevel (surface);
if (!toplevel_surface || !toplevel_surface->window)
return;
meta_wayland_actor_surface_sync_actor_state (actor_surface);
}

View File

@@ -45,12 +45,8 @@ dnd_surface_commit (MetaWaylandSurfaceRole *surface_role,
{
MetaWaylandSurface *surface =
meta_wayland_surface_role_get_surface (surface_role);
MetaWaylandSurfaceRoleClass *surface_role_class =
META_WAYLAND_SURFACE_ROLE_CLASS (meta_wayland_surface_role_dnd_parent_class);
meta_wayland_surface_queue_pending_state_frame_callbacks (surface, pending);
surface_role_class->commit (surface_role, pending);
}
static void

View File

@@ -862,19 +862,6 @@ init_pointer_constraint (struct wl_resource *resource,
return;
}
switch (lifetime)
{
case ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ONESHOT:
case ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_PERSISTENT:
break;
default:
wl_resource_post_error (resource,
WL_DISPLAY_ERROR_INVALID_OBJECT,
"Invalid constraint lifetime");
return;
}
constraint = meta_wayland_pointer_constraint_new (surface, seat,
region,
lifetime,

View File

@@ -175,22 +175,6 @@ meta_wayland_shell_surface_surface_commit (MetaWaylandSurfaceRole *surface_role
window->buffer_rect.height = cogl_texture_get_height (texture) * scale;
}
static void
meta_wayland_shell_surface_sync_actor_state (MetaWaylandActorSurface *actor_surface)
{
MetaWaylandSurfaceRole *surface_role =
META_WAYLAND_SURFACE_ROLE (actor_surface);
MetaWaylandSurface *surface =
meta_wayland_surface_role_get_surface (surface_role);
MetaWaylandActorSurfaceClass *actor_surface_class =
META_WAYLAND_ACTOR_SURFACE_CLASS (meta_wayland_shell_surface_parent_class);
MetaWaylandSurface *toplevel_surface;
toplevel_surface = meta_wayland_surface_get_toplevel (surface);
if (toplevel_surface && toplevel_surface->window)
actor_surface_class->sync_actor_state (actor_surface);
}
static void
meta_wayland_shell_surface_init (MetaWaylandShellSurface *role)
{
@@ -201,10 +185,6 @@ meta_wayland_shell_surface_class_init (MetaWaylandShellSurfaceClass *klass)
{
MetaWaylandSurfaceRoleClass *surface_role_class =
META_WAYLAND_SURFACE_ROLE_CLASS (klass);
MetaWaylandActorSurfaceClass *actor_surface_class =
META_WAYLAND_ACTOR_SURFACE_CLASS (klass);
surface_role_class->commit = meta_wayland_shell_surface_surface_commit;
actor_surface_class->sync_actor_state =
meta_wayland_shell_surface_sync_actor_state;
}

View File

@@ -199,11 +199,8 @@ meta_wayland_subsurface_sync_actor_state (MetaWaylandActorSurface *actor_surface
meta_wayland_surface_role_get_surface (surface_role);
MetaWaylandActorSurfaceClass *actor_surface_class =
META_WAYLAND_ACTOR_SURFACE_CLASS (meta_wayland_subsurface_parent_class);
MetaWaylandSurface *toplevel_surface;
toplevel_surface = meta_wayland_surface_get_toplevel (surface);
if (toplevel_surface && toplevel_surface->window)
actor_surface_class->sync_actor_state (actor_surface);
actor_surface_class->sync_actor_state (actor_surface);
sync_actor_subsurface_state (surface);
}

View File

@@ -647,20 +647,6 @@ xwayland_surface_get_toplevel (MetaWaylandSurfaceRole *surface_role)
return meta_wayland_surface_role_get_surface (surface_role);
}
static void
xwayland_surface_sync_actor_state (MetaWaylandActorSurface *actor_surface)
{
MetaWaylandSurfaceRole *surface_role =
META_WAYLAND_SURFACE_ROLE (actor_surface);
MetaWaylandSurface *surface =
meta_wayland_surface_role_get_surface (surface_role);
MetaWaylandActorSurfaceClass *actor_surface_class =
META_WAYLAND_ACTOR_SURFACE_CLASS (meta_wayland_surface_role_xwayland_parent_class);
if (surface->window)
actor_surface_class->sync_actor_state (actor_surface);
}
static void
meta_wayland_surface_role_xwayland_init (MetaWaylandSurfaceRoleXWayland *role)
{
@@ -671,15 +657,11 @@ meta_wayland_surface_role_xwayland_class_init (MetaWaylandSurfaceRoleXWaylandCla
{
MetaWaylandSurfaceRoleClass *surface_role_class =
META_WAYLAND_SURFACE_ROLE_CLASS (klass);
MetaWaylandActorSurfaceClass *actor_surface_class =
META_WAYLAND_ACTOR_SURFACE_CLASS (klass);
surface_role_class->assigned = xwayland_surface_assigned;
surface_role_class->commit = xwayland_surface_commit;
surface_role_class->get_toplevel = xwayland_surface_get_toplevel;
actor_surface_class->sync_actor_state = xwayland_surface_sync_actor_state;
xwayland_surface_signals[XWAYLAND_SURFACE_WINDOW_ASSOCIATED] =
g_signal_new ("window-associated",
G_TYPE_FROM_CLASS (klass),

View File

@@ -249,7 +249,7 @@ source_new_cb (GObject *object,
MetaSelection *selection = data->selection;
MetaSelectionType selection_type = data->selection_type;
MetaX11Display *x11_display = data->x11_display;
g_autoptr (GError) error = NULL;
GError *error = NULL;
source = meta_selection_source_x11_new_finish (res, &error);
if (source)
@@ -257,7 +257,7 @@ source_new_cb (GObject *object,
meta_selection_set_owner (selection, selection_type, source);
g_set_object (&x11_display->selection.owners[selection_type], source);
}
else if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
else
{
g_warning ("Could not create selection source for X11: %s",
error->message);

View File

@@ -1559,7 +1559,7 @@ meta_window_x11_update_struts (MetaWindow *window)
changed = (old_iter != NULL || new_iter != NULL);
/* Update appropriately */
g_slist_free_full (old_struts, g_free);
meta_free_gslist_and_elements (old_struts);
window->struts = new_struts;
return changed;
}