Compare commits

..

14 Commits

Author SHA1 Message Date
Georges Basile Stavracas Neto
d748dc273f clutter/stage: Cast the stage just when needed
If we use a variable, and the debug notes are disabled at
compile time, the variable becomes unused and we are warned.

Remove this variable and instead cast inline.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/502
2019-04-17 19:26:23 -03:00
Georges Basile Stavracas Neto
a9b642540c Add frame time chart
Add a chart at the bottom 10% of the screen where each
bar represents the time the frame took to be painted. The
red line represents the maximum time to draw. For example,
if you are on a 60Hz monitor, the red line means 16.6667
miliseconds.

This covers both layout time (green) and paint time (blue).

Enjoy.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/502
2019-04-17 19:26:23 -03:00
Georges Basile Stavracas Neto
6350efc28e clutter/stage: Add private getter to sync delay
It will be used by the frame chart to correctly place
the red bar. The math is essentially:

  ms_per_frame = (1 / refresh rate) * 1000 - sync delay

https://gitlab.gnome.org/GNOME/mutter/merge_requests/502
2019-04-17 17:42:35 -03:00
Georges Basile Stavracas Neto
f7321d235f Allow changing Clutter debug flags at runtime
This way, we can literally pop up the Looking Glass and
call:

 >>> Meta.add_clutter_debug_flags(Clutter.DebugFlag.FRAME_TIME, 0, 0)

And measure specific actions or events on GNOME Shell.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/502
2019-04-17 17:42:35 -03:00
Georges Basile Stavracas Neto
4904430083 clutter/stage: Account for frame times
Instead of accumulating frames, simply calculate and
debug-dump the time each frame takes to be drawn.

Because we're using Clutter's debug machinery, it is
structured and can be parsed by scripts.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/502
2019-04-17 17:42:35 -03:00
Georges Basile Stavracas Neto
290f48f29a Replace CLUTTER_SHOW_FPS by a proper debug flag
Instead of CLUTTER_SHOW_FPS=1, it should be passed now
CLUTTER_DEBUG=frame-time.

Also remove the legacy code related to the FPS counter.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/502
2019-04-17 17:42:32 -03:00
Robert Mader
22884b0b00 shaped-texture: Use draw_rectangle() for full paints
This reverts a change introduced in edfe5cc3 to use `paint_clipped_rectangle()`
instead of `cogl_framebuffer_draw_rectangle()` for full paints as it
contained logic necessary for viewport src-rects. This is not longer the case.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/504
2019-04-17 20:28:43 +00:00
Robert Mader
d2415da0d4 shaped-texture: Use CoglMatrix for viewport src-rect
This brings the viewport src-rect code in line with how we handle
transforms, by applying a `CoglMatrix` to the pipeline instead of
changing the paint logic.
It also fixes not-y-inverted textures in combination with
transforms.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/504
2019-04-17 20:28:43 +00:00
Robert Mader
96f7bf28f1 shaped-texture: Add checks to viewport reset functions
The set and reset functions are unconditionally called on every
commit. Add missings checks to the reset functions to bail out if
nothing changed.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/504
2019-04-17 20:28:42 +00:00
Robert Mader
db486ad897 cogl/texture-2d: Remove notes about COGL_FEATURE_ID_TEXTURE_NPOT
NPOT capabilities were made madatory in OpenGL 2.0 and GLES 2.0,
so let's stop encouraging developers to write new code with checks
for it.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/467
2019-04-17 20:14:59 +00:00
Adam Jackson
8180927de2 cogl: Bump minimum GLES version to 2.0
This is already effectively true because there is only a GLSL backend.
It also implies OES_texture_npot.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/489
2019-04-17 20:06:47 +00:00
Adam Jackson
191c31b0f0 cogl: Bump minimum GL version to 2.1
We already effectively require GLSL, because there's no fixed-function
backend anymore. OpenGL 2.0 drivers don't really exist in the wild, so
just go ahead and require 2.1 or better. 2.1 implies GLSL 1.20 or
better, so simplify that as well.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/489
2019-04-17 20:06:47 +00:00
Adam Jackson
a94841abf1 cogl: Remove color write masks from the framebuffer and pipeline API
The only thing using this is its own tests, and it's difficult to
imagine a real use for it.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/468
2019-04-17 19:57:14 +00:00
Adam Jackson
b624e94ab1 cogl: Remove viewport scissor workaround
This is effectively a revert of:

    commit 6cfc93f26f
    Author: Robert Bragg <robert@linux.intel.com>
    Date:   Tue Oct 2 11:44:00 2012 +0100

        clip-stack: workaround intel gen6 viewport clip bug

It's been over six years, if this bug is still present we should just
fix Mesa already.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/481
2019-04-17 19:48:03 +00:00
44 changed files with 511 additions and 992 deletions

11
NEWS
View File

@@ -1,14 +1,3 @@
3.32.2
======
* Disable mouse keys with Numlock on [Olivier; #530]
* Fix crash when restarting on X11 [Marco; #576]
* Fix mapping of touchscreens that don't report dimensions [Carlos; #581]
* Fix spurious idle signals that prevent session unblank [Jonas; !543]
* Misc. bug fixes and cleanups [Olivier, Marco, Carlos; !552, !557, #586]
Contributors:
Jonas Ådahl, Olivier Fourdan, Carlos Garnacho, Marco Trevisan (Treviño)
3.32.1
======
* Fix fallback app menu on wayland [Florian; #493]

View File

@@ -6,46 +6,6 @@
G_BEGIN_DECLS
typedef enum
{
CLUTTER_DEBUG_MISC = 1 << 0,
CLUTTER_DEBUG_ACTOR = 1 << 1,
CLUTTER_DEBUG_TEXTURE = 1 << 2,
CLUTTER_DEBUG_EVENT = 1 << 3,
CLUTTER_DEBUG_PAINT = 1 << 4,
CLUTTER_DEBUG_PANGO = 1 << 5,
CLUTTER_DEBUG_BACKEND = 1 << 6,
CLUTTER_DEBUG_SCHEDULER = 1 << 7,
CLUTTER_DEBUG_SCRIPT = 1 << 8,
CLUTTER_DEBUG_SHADER = 1 << 9,
CLUTTER_DEBUG_MULTISTAGE = 1 << 10,
CLUTTER_DEBUG_ANIMATION = 1 << 11,
CLUTTER_DEBUG_LAYOUT = 1 << 12,
CLUTTER_DEBUG_PICK = 1 << 13,
CLUTTER_DEBUG_EVENTLOOP = 1 << 14,
CLUTTER_DEBUG_CLIPPING = 1 << 15,
CLUTTER_DEBUG_OOB_TRANSFORMS = 1 << 16
} ClutterDebugFlag;
typedef enum
{
CLUTTER_DEBUG_NOP_PICKING = 1 << 0,
CLUTTER_DEBUG_DUMP_PICK_BUFFERS = 1 << 1
} ClutterPickDebugFlag;
typedef enum
{
CLUTTER_DEBUG_DISABLE_SWAP_EVENTS = 1 << 0,
CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS = 1 << 1,
CLUTTER_DEBUG_REDRAWS = 1 << 2,
CLUTTER_DEBUG_PAINT_VOLUMES = 1 << 3,
CLUTTER_DEBUG_DISABLE_CULLING = 1 << 4,
CLUTTER_DEBUG_DISABLE_OFFSCREEN_REDIRECT = 1 << 5,
CLUTTER_DEBUG_CONTINUOUS_REDRAW = 1 << 6,
CLUTTER_DEBUG_PAINT_DEFORM_TILES = 1 << 7,
CLUTTER_DEBUG_PAINT_DAMAGE_REGION = 1 << 8,
} ClutterDrawDebugFlag;
#ifdef CLUTTER_ENABLE_DEBUG
#define CLUTTER_HAS_DEBUG(type) ((clutter_debug_flags & CLUTTER_DEBUG_##type) != FALSE)

View File

@@ -89,7 +89,6 @@ static GCallback clutter_threads_unlock = NULL;
/* command line options */
static gboolean clutter_is_initialized = FALSE;
static gboolean clutter_show_fps = FALSE;
static gboolean clutter_fatal_warnings = FALSE;
static gboolean clutter_disable_mipmap_text = FALSE;
static gboolean clutter_use_fuzzy_picking = FALSE;
@@ -125,6 +124,7 @@ static const GDebugKey clutter_debug_keys[] = {
{ "layout", CLUTTER_DEBUG_LAYOUT },
{ "clipping", CLUTTER_DEBUG_CLIPPING },
{ "oob-transforms", CLUTTER_DEBUG_OOB_TRANSFORMS },
{ "frame-time", CLUTTER_DEBUG_FRAME_TIME },
};
#endif /* CLUTTER_ENABLE_DEBUG */
@@ -143,6 +143,7 @@ static const GDebugKey clutter_paint_debug_keys[] = {
{ "continuous-redraw", CLUTTER_DEBUG_CONTINUOUS_REDRAW },
{ "paint-deform-tiles", CLUTTER_DEBUG_PAINT_DEFORM_TILES },
{ "damage-region", CLUTTER_DEBUG_PAINT_DAMAGE_REGION },
{ "frame-time", CLUTTER_DEBUG_PAINT_FRAME_TIME },
};
static void
@@ -204,16 +205,6 @@ clutter_config_read_from_key_file (GKeyFile *keyfile)
g_free (str_value);
bool_value =
g_key_file_get_boolean (keyfile, ENVIRONMENT_GROUP,
"ShowFps",
&key_error);
if (key_error != NULL)
g_clear_error (&key_error);
else
clutter_show_fps = bool_value;
bool_value =
g_key_file_get_boolean (keyfile, ENVIRONMENT_GROUP,
"DisableMipmappedText",
@@ -382,36 +373,6 @@ clutter_config_read (void)
g_free (config_path);
}
/**
* clutter_get_show_fps:
*
* Returns whether Clutter should print out the frames per second on the
* console. You can enable this setting either using the
* <literal>CLUTTER_SHOW_FPS</literal> environment variable or passing
* the <literal>--clutter-show-fps</literal> command line argument. *
*
* Return value: %TRUE if Clutter should show the FPS.
*
* Since: 0.4
*
* Deprecated: 1.10: This function does not do anything. Use the environment
* variable or the configuration file to determine whether Clutter should
* print out the FPS counter on the console.
*/
gboolean
clutter_get_show_fps (void)
{
return FALSE;
}
gboolean
_clutter_context_get_show_fps (void)
{
ClutterMainContext *context = _clutter_context_get_default ();
return context->show_fps;
}
/**
* clutter_get_accessibility_enabled:
*
@@ -1370,8 +1331,6 @@ clutter_init_real (GError **error)
}
static GOptionEntry clutter_args[] = {
{ "clutter-show-fps", 0, 0, G_OPTION_ARG_NONE, &clutter_show_fps,
N_("Show frames per second"), NULL },
{ "clutter-default-fps", 0, 0, G_OPTION_ARG_INT, &clutter_default_fps,
N_("Default frame rate"), "FPS" },
{ "g-fatal-warnings", 0, 0, G_OPTION_ARG_NONE, &clutter_fatal_warnings,
@@ -1450,10 +1409,6 @@ pre_parse_hook (GOptionContext *context,
env_string = NULL;
}
env_string = g_getenv ("CLUTTER_SHOW_FPS");
if (env_string)
clutter_show_fps = TRUE;
env_string = g_getenv ("CLUTTER_DEFAULT_FPS");
if (env_string)
{
@@ -1502,7 +1457,6 @@ post_parse_hook (GOptionContext *context,
}
clutter_context->frame_rate = clutter_default_fps;
clutter_context->show_fps = clutter_show_fps;
clutter_context->options_parsed = TRUE;
/* If not asked to defer display setup, call clutter_init_real(),
@@ -3604,6 +3558,36 @@ clutter_check_windowing_backend (const char *backend_type)
return FALSE;
}
/**
* clutter_add_debug_flags: (skip)
*
* Adds the debug flags passed to the list of debug flags.
*/
void
clutter_add_debug_flags (ClutterDebugFlag debug_flags,
ClutterDrawDebugFlag draw_flags,
ClutterPickDebugFlag pick_flags)
{
clutter_debug_flags |= debug_flags;
clutter_paint_debug_flags |= draw_flags;
clutter_pick_debug_flags |= pick_flags;
}
/**
* clutter_remove_debug_flags: (skip)
*
* Removes the debug flags passed from the list of debug flags.
*/
void
clutter_remove_debug_flags (ClutterDebugFlag debug_flags,
ClutterDrawDebugFlag draw_flags,
ClutterPickDebugFlag pick_flags)
{
clutter_debug_flags &= ~debug_flags;
clutter_paint_debug_flags &= ~draw_flags;
clutter_pick_debug_flags &= ~pick_flags;
}
void
_clutter_set_sync_to_vblank (gboolean sync_to_vblank)
{

View File

@@ -34,6 +34,49 @@
G_BEGIN_DECLS
typedef enum
{
CLUTTER_DEBUG_MISC = 1 << 0,
CLUTTER_DEBUG_ACTOR = 1 << 1,
CLUTTER_DEBUG_TEXTURE = 1 << 2,
CLUTTER_DEBUG_EVENT = 1 << 3,
CLUTTER_DEBUG_PAINT = 1 << 4,
CLUTTER_DEBUG_PANGO = 1 << 5,
CLUTTER_DEBUG_BACKEND = 1 << 6,
CLUTTER_DEBUG_SCHEDULER = 1 << 7,
CLUTTER_DEBUG_SCRIPT = 1 << 8,
CLUTTER_DEBUG_SHADER = 1 << 9,
CLUTTER_DEBUG_MULTISTAGE = 1 << 10,
CLUTTER_DEBUG_ANIMATION = 1 << 11,
CLUTTER_DEBUG_LAYOUT = 1 << 12,
CLUTTER_DEBUG_PICK = 1 << 13,
CLUTTER_DEBUG_EVENTLOOP = 1 << 14,
CLUTTER_DEBUG_CLIPPING = 1 << 15,
CLUTTER_DEBUG_OOB_TRANSFORMS = 1 << 16,
CLUTTER_DEBUG_FRAME_TIME = 1 << 17,
} ClutterDebugFlag;
typedef enum
{
CLUTTER_DEBUG_NOP_PICKING = 1 << 0,
CLUTTER_DEBUG_DUMP_PICK_BUFFERS = 1 << 1
} ClutterPickDebugFlag;
typedef enum
{
CLUTTER_DEBUG_DISABLE_SWAP_EVENTS = 1 << 0,
CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS = 1 << 1,
CLUTTER_DEBUG_REDRAWS = 1 << 2,
CLUTTER_DEBUG_PAINT_VOLUMES = 1 << 3,
CLUTTER_DEBUG_DISABLE_CULLING = 1 << 4,
CLUTTER_DEBUG_DISABLE_OFFSCREEN_REDIRECT = 1 << 5,
CLUTTER_DEBUG_CONTINUOUS_REDRAW = 1 << 6,
CLUTTER_DEBUG_PAINT_DEFORM_TILES = 1 << 7,
CLUTTER_DEBUG_PAINT_DAMAGE_REGION = 1 << 8,
CLUTTER_DEBUG_PAINT_FRAME_TIME = 1 << 9,
} ClutterDrawDebugFlag;
/**
* CLUTTER_INIT_ERROR:
*
@@ -174,6 +217,15 @@ guint clutter_get_default_frame_rate (void);
CLUTTER_EXPORT
gboolean clutter_check_windowing_backend (const char *backend_type);
CLUTTER_EXPORT
void clutter_add_debug_flags (ClutterDebugFlag debug_flags,
ClutterDrawDebugFlag draw_flags,
ClutterPickDebugFlag pick_flags);
CLUTTER_EXPORT
void clutter_remove_debug_flags (ClutterDebugFlag debug_flags,
ClutterDrawDebugFlag draw_flags,
ClutterPickDebugFlag pick_flags);
G_END_DECLS

View File

@@ -176,7 +176,6 @@ struct _ClutterMainContext
guint motion_events_per_actor : 1;
guint defer_display_setup : 1;
guint options_parsed : 1;
guint show_fps : 1;
};
/* shared between clutter-main.c and clutter-frame-source.c */
@@ -202,7 +201,6 @@ void _clutter_context_push_shader_stack (Clutter
ClutterActor * _clutter_context_pop_shader_stack (ClutterActor *actor);
ClutterActor * _clutter_context_peek_shader_stack (void);
gboolean _clutter_context_get_motion_events_enabled (void);
gboolean _clutter_context_get_show_fps (void);
gboolean _clutter_feature_init (GError **error);

View File

@@ -134,6 +134,12 @@ void _clutter_stage_presented (ClutterStage *stag
GList * _clutter_stage_peek_stage_views (ClutterStage *stage);
int clutter_stage_get_sync_delay (ClutterStage *stage);
void clutter_stage_get_frame_times (ClutterStage *stage,
double *paint_time,
double *layout_time);
G_END_DECLS
#endif /* __CLUTTER_STAGE_PRIVATE_H__ */

View File

@@ -133,9 +133,6 @@ struct _ClutterStagePrivate
gint sync_delay;
GTimer *fps_timer;
gint32 timer_n_frames;
ClutterIDPool *pick_id_pool;
#ifdef CLUTTER_ENABLE_DEBUG
@@ -149,6 +146,9 @@ struct _ClutterStagePrivate
int update_freeze_count;
double last_layout_time;
double last_paint_time;
guint relayout_pending : 1;
guint redraw_pending : 1;
guint is_fullscreen : 1;
@@ -1074,11 +1074,15 @@ _clutter_stage_maybe_relayout (ClutterActor *actor)
/* avoid reentrancy */
if (!CLUTTER_ACTOR_IN_RELAYOUT (stage))
{
int64_t start, end;
priv->relayout_pending = FALSE;
priv->stage_was_relayout = TRUE;
CLUTTER_NOTE (ACTOR, "Recomputing layout");
start = g_get_monotonic_time ();
CLUTTER_SET_PRIVATE_FLAGS (stage, CLUTTER_IN_RELAYOUT);
natural_width = natural_height = 0;
@@ -1099,14 +1103,20 @@ _clutter_stage_maybe_relayout (ClutterActor *actor)
&box, CLUTTER_ALLOCATION_NONE);
CLUTTER_UNSET_PRIVATE_FLAGS (stage, CLUTTER_IN_RELAYOUT);
end = g_get_monotonic_time ();
priv->last_layout_time = (end - start) / 1000.0;
CLUTTER_NOTE (FRAME_TIME, "LAYOUT: %lf", priv->last_layout_time);
}
}
static void
clutter_stage_do_redraw (ClutterStage *stage)
{
ClutterActor *actor = CLUTTER_ACTOR (stage);
ClutterStagePrivate *priv = stage->priv;
int64_t start;
int64_t end;
if (CLUTTER_ACTOR_IN_DESTRUCTION (stage))
return;
@@ -1115,34 +1125,20 @@ clutter_stage_do_redraw (ClutterStage *stage)
return;
CLUTTER_NOTE (PAINT, "Redraw started for stage '%s'[%p]",
_clutter_actor_get_debug_name (actor),
_clutter_actor_get_debug_name (CLUTTER_ACTOR (stage)),
stage);
if (_clutter_context_get_show_fps ())
{
if (priv->fps_timer == NULL)
priv->fps_timer = g_timer_new ();
}
start = g_get_monotonic_time ();
_clutter_stage_window_redraw (priv->impl);
if (_clutter_context_get_show_fps ())
{
priv->timer_n_frames += 1;
end = g_get_monotonic_time ();
if (g_timer_elapsed (priv->fps_timer, NULL) >= 1.0)
{
g_print ("*** FPS for %s: %i ***\n",
_clutter_actor_get_debug_name (actor),
priv->timer_n_frames);
priv->timer_n_frames = 0;
g_timer_start (priv->fps_timer);
}
}
priv->last_paint_time = (end - start) / 1000.0;
CLUTTER_NOTE (FRAME_TIME, "PAINT: %lf", priv->last_paint_time);
CLUTTER_NOTE (PAINT, "Redraw finished for stage '%s'[%p]",
_clutter_actor_get_debug_name (actor),
_clutter_actor_get_debug_name (CLUTTER_ACTOR (stage)),
stage);
}
@@ -1886,9 +1882,6 @@ clutter_stage_finalize (GObject *object)
_clutter_id_pool_free (priv->pick_id_pool);
if (priv->fps_timer != NULL)
g_timer_destroy (priv->fps_timer);
if (priv->paint_notify != NULL)
priv->paint_notify (priv->paint_data);
@@ -4728,6 +4721,14 @@ clutter_stage_set_sync_delay (ClutterStage *stage,
stage->priv->sync_delay = sync_delay;
}
int
clutter_stage_get_sync_delay (ClutterStage *stage)
{
g_return_val_if_fail (CLUTTER_IS_STAGE (stage), -1);
return stage->priv->sync_delay;
}
/**
* clutter_stage_skip_sync_delay:
* @stage: a #ClutterStage
@@ -5097,3 +5098,12 @@ _clutter_stage_get_max_view_scale_factor_for_rect (ClutterStage *stage,
*view_scale = scale;
return TRUE;
}
void
clutter_stage_get_frame_times (ClutterStage *stage,
double *paint_time,
double *layout_time)
{
*paint_time = stage->priv->last_paint_time;
*layout_time = stage->priv->last_layout_time;
}

View File

@@ -405,6 +405,215 @@ paint_damage_region (ClutterStageWindow *stage_window,
cogl_framebuffer_pop_matrix (framebuffer);
}
#define CHART_COLUMN_WIDTH 6 //px
#define THRESHOLD_LINE_HEIGHT 2 //px
#define MAX_FRAME_TIME_INFO_ENTRIES 1000
typedef struct
{
double layout_time;
double paint_time;
} FrameTimeInfo;
static void
get_frame_time_chart_region (ClutterStageWindow *stage_window,
ClutterStageView *view,
cairo_rectangle_int_t *region)
{
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
cairo_rectangle_int_t painted_region;
cairo_rectangle_int_t layout;
double refresh_rate_bar_height;
double ms_per_frame;
float green_line_y;
int sync_delay;
int n_points;
int i;
clutter_stage_view_get_layout (view, &layout);
painted_region = (cairo_rectangle_int_t) {
.x = layout.x,
.y = layout.y + layout.height,
.width = layout.width,
.height = 0,
};
n_points = layout.width / CHART_COLUMN_WIDTH;
/* Chart */
sync_delay = clutter_stage_get_sync_delay (stage_cogl->wrapper);
ms_per_frame = 1000.0 / stage_cogl->refresh_rate - sync_delay;
refresh_rate_bar_height = layout.height * 0.1;
for (i = 0; i < MIN (stage_cogl->frame_times->len, n_points); i++)
{
int element = stage_cogl->frame_times->len - i - 1;
FrameTimeInfo *info = &g_array_index (stage_cogl->frame_times, FrameTimeInfo, element);
double layout_bar_height;
double paint_bar_height;
/* Layout time section */
layout_bar_height =
info->layout_time / ms_per_frame * refresh_rate_bar_height;
/* Paint time section */
paint_bar_height =
info->paint_time / ms_per_frame * refresh_rate_bar_height;
painted_region.height = MAX (painted_region.height,
paint_bar_height + layout_bar_height);
}
/* Green line (16.667ms) */
green_line_y = layout.height * 0.9;
painted_region.height = MAX (painted_region.height, green_line_y);
/* Update the swap region rectangle */
painted_region.y -= MIN (layout.height, painted_region.height);
_clutter_util_rectangle_union (region, &painted_region, region);
}
static void
paint_frame_time_chart (ClutterStageWindow *stage_window,
ClutterStageView *view)
{
CoglFramebuffer *framebuffer = clutter_stage_view_get_onscreen (view);
CoglContext *ctx = cogl_framebuffer_get_context (framebuffer);
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
ClutterActor *actor = CLUTTER_ACTOR (stage_cogl->wrapper);
cairo_rectangle_int_t layout;
static CoglPipeline *threshold_pipeline = NULL;
static CoglPipeline *paint_time_pipeline = NULL;
static CoglPipeline *layout_time_pipeline = NULL;
CoglMatrix modelview;
double refresh_rate_bar_height;
double ms_per_frame;
float green_line_y;
int sync_delay;
int n_points;
int i;
if (G_UNLIKELY (paint_time_pipeline == NULL))
{
paint_time_pipeline = cogl_pipeline_new (ctx);
cogl_pipeline_set_color4ub (paint_time_pipeline, 0x00, 0x00, 0x60, 0xa0);
}
if (G_UNLIKELY (layout_time_pipeline == NULL))
{
layout_time_pipeline = cogl_pipeline_new (ctx);
cogl_pipeline_set_color4ub (layout_time_pipeline, 0x00, 0x60, 0x00, 0xa0);
}
if (G_UNLIKELY (threshold_pipeline == NULL))
{
threshold_pipeline = cogl_pipeline_new (ctx);
cogl_pipeline_set_color4ub (threshold_pipeline, 0x40, 0x00, 0x00, 0x80);
}
cogl_framebuffer_push_matrix (framebuffer);
cogl_matrix_init_identity (&modelview);
_clutter_actor_apply_modelview_transform (actor, &modelview);
cogl_framebuffer_set_modelview_matrix (framebuffer, &modelview);
clutter_stage_view_get_layout (view, &layout);
n_points = layout.width / CHART_COLUMN_WIDTH;
/* Chart */
sync_delay = clutter_stage_get_sync_delay (stage_cogl->wrapper);
ms_per_frame = 1000.0 / stage_cogl->refresh_rate - sync_delay;
refresh_rate_bar_height = layout.height * 0.1;
for (i = 0; i < MIN (stage_cogl->frame_times->len, n_points); i++)
{
int element = stage_cogl->frame_times->len - i - 1;
FrameTimeInfo *info = &g_array_index (stage_cogl->frame_times, FrameTimeInfo, element);
double x_1 = layout.width - (i + 1) * CHART_COLUMN_WIDTH;
double x_2 = layout.width - i * CHART_COLUMN_WIDTH;
double layout_bar_height;
double paint_bar_height;
/* Layout time section */
layout_bar_height =
info->layout_time / ms_per_frame * refresh_rate_bar_height;
cogl_framebuffer_draw_rectangle (framebuffer,
layout_time_pipeline,
x_1,
layout.height - layout_bar_height,
x_2,
layout.height);
/* Paint time section */
paint_bar_height =
info->paint_time / ms_per_frame * refresh_rate_bar_height;
cogl_framebuffer_draw_rectangle (framebuffer,
paint_time_pipeline,
x_1,
layout.height - paint_bar_height - layout_bar_height,
x_2,
layout.height - layout_bar_height);
}
/* Green line (16.667ms) */
green_line_y = layout.height * 0.9;
cogl_framebuffer_draw_rectangle (framebuffer,
threshold_pipeline,
0.0f,
green_line_y,
layout.width,
green_line_y + THRESHOLD_LINE_HEIGHT);
cogl_framebuffer_pop_matrix (framebuffer);
}
static inline void
append_frame_time_info (ClutterStageCogl *stage_cogl)
{
FrameTimeInfo previous_frame_info;
if (G_LIKELY (!(clutter_paint_debug_flags & CLUTTER_DEBUG_PAINT_FRAME_TIME)))
return;
if (G_UNLIKELY (stage_cogl->frame_times == NULL))
stage_cogl->frame_times = g_array_sized_new (FALSE, TRUE,
sizeof (FrameTimeInfo),
MAX_FRAME_TIME_INFO_ENTRIES);
clutter_stage_get_frame_times (stage_cogl->wrapper,
&previous_frame_info.paint_time,
&previous_frame_info.layout_time);
g_array_append_val (stage_cogl->frame_times, previous_frame_info);
if (stage_cogl->frame_times->len > MAX_FRAME_TIME_INFO_ENTRIES)
g_array_remove_range (stage_cogl->frame_times, 0,
stage_cogl->frame_times->len - MAX_FRAME_TIME_INFO_ENTRIES);
}
static inline void
maybe_paint_frame_times (ClutterStageWindow *stage_window,
ClutterStageView *view)
{
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
if (G_UNLIKELY ((clutter_paint_debug_flags & CLUTTER_DEBUG_PAINT_FRAME_TIME)))
{
paint_frame_time_chart (stage_window, view);
stage_cogl->painting_frame_chart = TRUE;
}
else if (stage_cogl->painting_frame_chart)
{
g_array_free (stage_cogl->frame_times, TRUE);
stage_cogl->frame_times = NULL;
stage_cogl->painting_frame_chart = FALSE;
}
}
static gboolean
swap_framebuffer (ClutterStageWindow *stage_window,
ClutterStageView *view,
@@ -672,6 +881,9 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
fb_clip_region = (cairo_rectangle_int_t) { 0 };
}
if (G_UNLIKELY ((clutter_paint_debug_flags & CLUTTER_DEBUG_PAINT_FRAME_TIME)))
get_frame_time_chart_region (stage_window, view, &fb_clip_region);
if (may_use_clipped_redraw &&
G_LIKELY (!(clutter_paint_debug_flags & CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS)))
use_clipped_redraw = TRUE;
@@ -827,6 +1039,9 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
else
paint_stage (stage_cogl, view, &view_rect);
}
maybe_paint_frame_times (stage_window, view);
cogl_pop_framebuffer ();
if (may_use_clipped_redraw &&
@@ -931,6 +1146,8 @@ clutter_stage_cogl_redraw (ClutterStageWindow *stage_window)
gboolean swap_event = FALSE;
GList *l;
append_frame_time_info (stage_cogl);
for (l = _clutter_stage_window_get_views (stage_window); l; l = l->next)
{
ClutterStageView *view = l->data;

View File

@@ -66,6 +66,9 @@ struct _ClutterStageCogl
/* TRUE if the current paint cycle has a clipped redraw. In that
case bounding_redraw_clip specifies the the bounds. */
guint using_clipped_redraw : 1;
gboolean painting_frame_chart;
GArray *frame_times;
};
struct _ClutterStageCoglClass

View File

@@ -77,9 +77,6 @@ gulong clutter_get_timestamp (void);
CLUTTER_DEPRECATED
gboolean clutter_get_debug_enabled (void);
CLUTTER_DEPRECATED
gboolean clutter_get_show_fps (void);
G_END_DECLS
#endif /* __CLUTTER_MAIN_DEPRECATED_H__ */

View File

@@ -855,14 +855,6 @@ emulate_pointer_motion (ClutterInputDeviceEvdev *device,
clutter_virtual_input_device_notify_relative_motion (device->mousekeys_virtual_device,
time_us, dx_motion, dy_motion);
}
static gboolean
is_numlock_active (ClutterInputDeviceEvdev *device)
{
ClutterSeatEvdev *seat = device->seat;
return xkb_state_mod_name_is_active (seat->xkb,
"Mod2",
XKB_STATE_MODS_LOCKED);
}
static void
enable_mousekeys (ClutterInputDeviceEvdev *device)
@@ -1021,10 +1013,6 @@ handle_mousekeys_press (ClutterEvent *event,
if (!(event->key.flags & CLUTTER_EVENT_FLAG_SYNTHETIC))
stop_mousekeys_move (device);
/* Do not handle mousekeys if NumLock is ON */
if (is_numlock_active (device))
return FALSE;
/* Button selection */
switch (event->key.keyval)
{
@@ -1096,10 +1084,6 @@ static gboolean
handle_mousekeys_release (ClutterEvent *event,
ClutterInputDeviceEvdev *device)
{
/* Do not handle mousekeys if NumLock is ON */
if (is_numlock_active (device))
return FALSE;
switch (event->key.keyval)
{
case XKB_KEY_KP_0:

View File

@@ -54,7 +54,6 @@
#include "clutter-main.h"
#include "clutter-private.h"
#include "clutter-settings-private.h"
#include "clutter-xkb-a11y-x11.h"
G_DEFINE_TYPE (ClutterBackendX11, clutter_backend_x11, CLUTTER_TYPE_BACKEND)
@@ -277,20 +276,6 @@ clutter_backend_x11_create_device_manager (ClutterBackendX11 *backend_x11)
_clutter_backend_add_event_translator (backend, translator);
}
static void
on_keymap_state_change (ClutterKeymapX11 *keymap_x11,
gpointer data)
{
ClutterDeviceManager *device_manager = CLUTTER_DEVICE_MANAGER (data);
ClutterKbdA11ySettings kbd_a11y_settings;
/* On keymaps state change, just reapply the current settings, it'll
* take care of enabling/disabling mousekeys based on NumLock state.
*/
clutter_device_manager_get_kbd_a11y_settings (device_manager, &kbd_a11y_settings);
clutter_device_manager_x11_apply_kbd_a11y_settings (device_manager, &kbd_a11y_settings);
}
static void
clutter_backend_x11_create_keymap (ClutterBackendX11 *backend_x11)
{
@@ -307,11 +292,6 @@ clutter_backend_x11_create_keymap (ClutterBackendX11 *backend_x11)
backend = CLUTTER_BACKEND (backend_x11);
translator = CLUTTER_EVENT_TRANSLATOR (backend_x11->keymap);
_clutter_backend_add_event_translator (backend, translator);
g_signal_connect (backend_x11->keymap,
"state-changed",
G_CALLBACK (on_keymap_state_change),
backend->device_manager);
}
}

View File

@@ -241,13 +241,8 @@ clutter_device_manager_x11_apply_kbd_a11y_settings (ClutterDeviceManager *devi
}
/* mouse keys */
if (clutter_keymap_get_num_lock_state (CLUTTER_KEYMAP (backend_x11->keymap)))
{
/* Disable mousekeys when NumLock is ON */
desc->ctrls->enabled_ctrls &= ~(XkbMouseKeysMask | XkbMouseKeysAccelMask);
}
else if (set_xkb_ctrl (desc, kbd_a11y_settings->controls,
CLUTTER_A11Y_MOUSE_KEYS_ENABLED, XkbMouseKeysMask | XkbMouseKeysAccelMask))
if (set_xkb_ctrl (desc, kbd_a11y_settings->controls,
CLUTTER_A11Y_MOUSE_KEYS_ENABLED, XkbMouseKeysMask | XkbMouseKeysAccelMask))
{
gint mk_max_speed;
gint mk_accel_time;

View File

@@ -103,9 +103,6 @@ struct _CoglContext
unsigned long private_features
[COGL_FLAGS_N_LONGS_FOR_SIZE (COGL_N_PRIVATE_FEATURES)];
gboolean needs_viewport_scissor_workaround;
CoglFramebuffer *viewport_scissor_workaround_framebuffer;
CoglPipeline *default_pipeline;
CoglPipelineLayer *default_layer_0;
CoglPipelineLayer *default_layer_n;
@@ -269,7 +266,6 @@ struct _CoglContext
GLuint current_gl_program;
gboolean current_gl_dither_enabled;
CoglColorMask current_gl_color_mask;
GLenum current_gl_draw_buffer;
/* Clipping */

View File

@@ -265,22 +265,6 @@ cogl_context_new (CoglDisplay *display,
/* Initialise the driver specific state */
_cogl_init_feature_overrides (context);
/* XXX: ONGOING BUG: Intel viewport scissor
*
* Intel gen6 drivers don't currently correctly handle offset
* viewports, since primitives aren't clipped within the bounds of
* the viewport. To workaround this we push our own clip for the
* viewport that will use scissoring to ensure we clip as expected.
*
* TODO: file a bug upstream!
*/
if (context->gpu.driver_package == COGL_GPU_INFO_DRIVER_PACKAGE_MESA &&
context->gpu.architecture == COGL_GPU_INFO_ARCHITECTURE_SANDYBRIDGE &&
!getenv ("COGL_DISABLE_INTEL_VIEWPORT_SCISSORT_WORKAROUND"))
context->needs_viewport_scissor_workaround = TRUE;
else
context->needs_viewport_scissor_workaround = FALSE;
context->sampler_cache = _cogl_sampler_cache_new (context);
_cogl_pipeline_init_default_pipeline ();
@@ -366,7 +350,6 @@ cogl_context_new (CoglDisplay *display,
context->current_gl_program = 0;
context->current_gl_dither_enabled = TRUE;
context->current_gl_color_mask = COGL_COLOR_MASK_ALL;
context->gl_blend_enable_cache = FALSE;

View File

@@ -83,11 +83,10 @@ typedef enum _CoglFramebufferStateIndex
COGL_FRAMEBUFFER_STATE_INDEX_DITHER = 3,
COGL_FRAMEBUFFER_STATE_INDEX_MODELVIEW = 4,
COGL_FRAMEBUFFER_STATE_INDEX_PROJECTION = 5,
COGL_FRAMEBUFFER_STATE_INDEX_COLOR_MASK = 6,
COGL_FRAMEBUFFER_STATE_INDEX_FRONT_FACE_WINDING = 7,
COGL_FRAMEBUFFER_STATE_INDEX_DEPTH_WRITE = 8,
COGL_FRAMEBUFFER_STATE_INDEX_STEREO_MODE = 9,
COGL_FRAMEBUFFER_STATE_INDEX_MAX = 10
COGL_FRAMEBUFFER_STATE_INDEX_FRONT_FACE_WINDING = 6,
COGL_FRAMEBUFFER_STATE_INDEX_DEPTH_WRITE = 7,
COGL_FRAMEBUFFER_STATE_INDEX_STEREO_MODE = 8,
COGL_FRAMEBUFFER_STATE_INDEX_MAX = 9
} CoglFramebufferStateIndex;
typedef enum _CoglFramebufferState
@@ -98,10 +97,9 @@ typedef enum _CoglFramebufferState
COGL_FRAMEBUFFER_STATE_DITHER = 1<<3,
COGL_FRAMEBUFFER_STATE_MODELVIEW = 1<<4,
COGL_FRAMEBUFFER_STATE_PROJECTION = 1<<5,
COGL_FRAMEBUFFER_STATE_COLOR_MASK = 1<<6,
COGL_FRAMEBUFFER_STATE_FRONT_FACE_WINDING = 1<<7,
COGL_FRAMEBUFFER_STATE_DEPTH_WRITE = 1<<8,
COGL_FRAMEBUFFER_STATE_STEREO_MODE = 1<<9
COGL_FRAMEBUFFER_STATE_FRONT_FACE_WINDING = 1<<6,
COGL_FRAMEBUFFER_STATE_DEPTH_WRITE = 1<<7,
COGL_FRAMEBUFFER_STATE_STEREO_MODE = 1<<8
} CoglFramebufferState;
#define COGL_FRAMEBUFFER_STATE_ALL ((1<<COGL_FRAMEBUFFER_STATE_INDEX_MAX) - 1)
@@ -155,7 +153,6 @@ struct _CoglFramebuffer
gboolean dither_enabled;
gboolean depth_writing_enabled;
CoglColorMask color_mask;
CoglStereoMode stereo_mode;
/* We journal the textured rectangles we want to submit to OpenGL so

View File

@@ -123,8 +123,6 @@ _cogl_framebuffer_init (CoglFramebuffer *framebuffer,
framebuffer->dirty_bitmasks = TRUE;
framebuffer->color_mask = COGL_COLOR_MASK_ALL;
framebuffer->samples_per_pixel = 0;
framebuffer->clip_stack = NULL;
@@ -191,9 +189,6 @@ _cogl_framebuffer_free (CoglFramebuffer *framebuffer)
cogl_object_unref (framebuffer->journal);
if (ctx->viewport_scissor_workaround_framebuffer == framebuffer)
ctx->viewport_scissor_workaround_framebuffer = NULL;
ctx->framebuffers = g_list_remove (ctx->framebuffers, framebuffer);
if (ctx->current_draw_buffer == framebuffer)
@@ -260,13 +255,11 @@ cogl_framebuffer_clear4f (CoglFramebuffer *framebuffer,
float blue,
float alpha)
{
CoglContext *ctx = framebuffer->context;
CoglClipStack *clip_stack = _cogl_framebuffer_get_clip_stack (framebuffer);
int scissor_x0;
int scissor_y0;
int scissor_x1;
int scissor_y1;
gboolean saved_viewport_scissor_workaround;
if (!framebuffer->depth_buffer_clear_needed &&
(buffers & COGL_BUFFER_BIT_DEPTH))
@@ -361,31 +354,6 @@ cogl_framebuffer_clear4f (CoglFramebuffer *framebuffer,
_cogl_framebuffer_flush_journal (framebuffer);
/* XXX: ONGOING BUG: Intel viewport scissor
*
* The semantics of cogl_framebuffer_clear() are that it should not
* be affected by the current viewport and so if we are currently
* applying a workaround for viewport scissoring we need to
* temporarily disable the workaround before clearing so any
* special scissoring for the workaround will be removed first.
*
* Note: we only need to disable the workaround if the current
* viewport doesn't match the framebuffer's size since otherwise
* the workaround wont affect clearing anyway.
*/
if (ctx->needs_viewport_scissor_workaround &&
(framebuffer->viewport_x != 0 ||
framebuffer->viewport_y != 0 ||
framebuffer->viewport_width != framebuffer->width ||
framebuffer->viewport_height != framebuffer->height))
{
saved_viewport_scissor_workaround = TRUE;
ctx->needs_viewport_scissor_workaround = FALSE;
ctx->current_draw_buffer_changes |= COGL_FRAMEBUFFER_STATE_CLIP;
}
else
saved_viewport_scissor_workaround = FALSE;
/* NB: _cogl_framebuffer_flush_state may disrupt various state (such
* as the pipeline state) when flushing the clip stack, so should
* always be done first when preparing to draw. */
@@ -395,16 +363,6 @@ cogl_framebuffer_clear4f (CoglFramebuffer *framebuffer,
_cogl_framebuffer_clear_without_flush4f (framebuffer, buffers,
red, green, blue, alpha);
/* XXX: ONGOING BUG: Intel viewport scissor
*
* See comment about temporarily disabling this workaround above
*/
if (saved_viewport_scissor_workaround)
{
ctx->needs_viewport_scissor_workaround = TRUE;
ctx->current_draw_buffer_changes |= COGL_FRAMEBUFFER_STATE_CLIP;
}
/* This is a debugging variable used to visually display the quad
* batches from the journal. It is reset here to increase the
* chances of getting the same colours for each frame during an
@@ -552,12 +510,7 @@ cogl_framebuffer_set_viewport (CoglFramebuffer *framebuffer,
framebuffer->viewport_age++;
if (context->current_draw_buffer == framebuffer)
{
context->current_draw_buffer_changes |= COGL_FRAMEBUFFER_STATE_VIEWPORT;
if (context->needs_viewport_scissor_workaround)
context->current_draw_buffer_changes |= COGL_FRAMEBUFFER_STATE_CLIP;
}
context->current_draw_buffer_changes |= COGL_FRAMEBUFFER_STATE_VIEWPORT;
}
float
@@ -831,27 +784,7 @@ _cogl_framebuffer_compare_viewport_state (CoglFramebuffer *a,
/* NB: we render upside down to offscreen framebuffers and that
* can affect how we setup the GL viewport... */
a->type != b->type)
{
unsigned long differences = COGL_FRAMEBUFFER_STATE_VIEWPORT;
CoglContext *context = a->context;
/* XXX: ONGOING BUG: Intel viewport scissor
*
* Intel gen6 drivers don't currently correctly handle offset
* viewports, since primitives aren't clipped within the bounds of
* the viewport. To workaround this we push our own clip for the
* viewport that will use scissoring to ensure we clip as expected.
*
* This workaround implies that a change in viewport state is
* effectively also a change in the clipping state.
*
* TODO: file a bug upstream!
*/
if (G_UNLIKELY (context->needs_viewport_scissor_workaround))
differences |= COGL_FRAMEBUFFER_STATE_CLIP;
return differences;
}
return COGL_FRAMEBUFFER_STATE_VIEWPORT;
else
return 0;
}
@@ -894,17 +827,6 @@ _cogl_framebuffer_compare_projection_state (CoglFramebuffer *a,
return COGL_FRAMEBUFFER_STATE_PROJECTION;
}
static unsigned long
_cogl_framebuffer_compare_color_mask_state (CoglFramebuffer *a,
CoglFramebuffer *b)
{
if (cogl_framebuffer_get_color_mask (a) !=
cogl_framebuffer_get_color_mask (b))
return COGL_FRAMEBUFFER_STATE_COLOR_MASK;
else
return 0;
}
static unsigned long
_cogl_framebuffer_compare_front_face_winding_state (CoglFramebuffer *a,
CoglFramebuffer *b)
@@ -971,10 +893,6 @@ _cogl_framebuffer_compare (CoglFramebuffer *a,
differences |=
_cogl_framebuffer_compare_projection_state (a, b);
break;
case COGL_FRAMEBUFFER_STATE_INDEX_COLOR_MASK:
differences |=
_cogl_framebuffer_compare_color_mask_state (a, b);
break;
case COGL_FRAMEBUFFER_STATE_INDEX_FRONT_FACE_WINDING:
differences |=
_cogl_framebuffer_compare_front_face_winding_state (a, b);
@@ -1080,29 +998,6 @@ cogl_framebuffer_get_is_stereo (CoglFramebuffer *framebuffer)
return framebuffer->config.stereo_enabled;
}
CoglColorMask
cogl_framebuffer_get_color_mask (CoglFramebuffer *framebuffer)
{
return framebuffer->color_mask;
}
void
cogl_framebuffer_set_color_mask (CoglFramebuffer *framebuffer,
CoglColorMask color_mask)
{
if (framebuffer->color_mask == color_mask)
return;
/* XXX: Currently color mask changes don't go through the journal */
_cogl_framebuffer_flush_journal (framebuffer);
framebuffer->color_mask = color_mask;
if (framebuffer->context->current_draw_buffer == framebuffer)
framebuffer->context->current_draw_buffer_changes |=
COGL_FRAMEBUFFER_STATE_COLOR_MASK;
}
CoglStereoMode
cogl_framebuffer_get_stereo_mode (CoglFramebuffer *framebuffer)
{

View File

@@ -816,38 +816,6 @@ void
cogl_framebuffer_set_depth_write_enabled (CoglFramebuffer *framebuffer,
gboolean depth_write_enabled);
/**
* cogl_framebuffer_get_color_mask:
* @framebuffer: a pointer to a #CoglFramebuffer
*
* Gets the current #CoglColorMask of which channels would be written to the
* current framebuffer. Each bit set in the mask means that the
* corresponding color would be written.
*
* Returns: A #CoglColorMask
* Since: 1.8
* Stability: unstable
*/
CoglColorMask
cogl_framebuffer_get_color_mask (CoglFramebuffer *framebuffer);
/**
* cogl_framebuffer_set_color_mask:
* @framebuffer: a pointer to a #CoglFramebuffer
* @color_mask: A #CoglColorMask of which color channels to write to
* the current framebuffer.
*
* Defines a bit mask of which color channels should be written to the
* given @framebuffer. If a bit is set in @color_mask that means that
* color will be written.
*
* Since: 1.8
* Stability: unstable
*/
void
cogl_framebuffer_set_color_mask (CoglFramebuffer *framebuffer,
CoglColorMask color_mask);
/**
* cogl_framebuffer_get_stereo_mode:
* @framebuffer: a pointer to a #CoglFramebuffer

View File

@@ -87,7 +87,6 @@ typedef enum
COGL_PIPELINE_STATE_NON_ZERO_POINT_SIZE_INDEX,
COGL_PIPELINE_STATE_POINT_SIZE_INDEX,
COGL_PIPELINE_STATE_PER_VERTEX_POINT_SIZE_INDEX,
COGL_PIPELINE_STATE_LOGIC_OPS_INDEX,
COGL_PIPELINE_STATE_CULL_FACE_INDEX,
COGL_PIPELINE_STATE_UNIFORMS_INDEX,
COGL_PIPELINE_STATE_VERTEX_SNIPPETS_INDEX,
@@ -140,8 +139,6 @@ typedef enum _CoglPipelineState
1L<<COGL_PIPELINE_STATE_POINT_SIZE_INDEX,
COGL_PIPELINE_STATE_PER_VERTEX_POINT_SIZE =
1L<<COGL_PIPELINE_STATE_PER_VERTEX_POINT_SIZE_INDEX,
COGL_PIPELINE_STATE_LOGIC_OPS =
1L<<COGL_PIPELINE_STATE_LOGIC_OPS_INDEX,
COGL_PIPELINE_STATE_CULL_FACE =
1L<<COGL_PIPELINE_STATE_CULL_FACE_INDEX,
COGL_PIPELINE_STATE_UNIFORMS =
@@ -188,7 +185,6 @@ typedef enum _CoglPipelineState
COGL_PIPELINE_STATE_NON_ZERO_POINT_SIZE | \
COGL_PIPELINE_STATE_POINT_SIZE | \
COGL_PIPELINE_STATE_PER_VERTEX_POINT_SIZE | \
COGL_PIPELINE_STATE_LOGIC_OPS | \
COGL_PIPELINE_STATE_CULL_FACE | \
COGL_PIPELINE_STATE_UNIFORMS | \
COGL_PIPELINE_STATE_VERTEX_SNIPPETS | \
@@ -200,7 +196,6 @@ typedef enum _CoglPipelineState
COGL_PIPELINE_STATE_BLEND | \
COGL_PIPELINE_STATE_DEPTH | \
COGL_PIPELINE_STATE_FOG | \
COGL_PIPELINE_STATE_LOGIC_OPS | \
COGL_PIPELINE_STATE_CULL_FACE | \
COGL_PIPELINE_STATE_UNIFORMS | \
COGL_PIPELINE_STATE_VERTEX_SNIPPETS | \
@@ -265,11 +260,6 @@ typedef struct
float z_far;
} CoglPipelineFogState;
typedef struct
{
CoglColorMask color_mask;
} CoglPipelineLogicOpsState;
typedef struct
{
CoglPipelineCullFaceMode mode;
@@ -301,7 +291,6 @@ typedef struct
float point_size;
unsigned int non_zero_point_size : 1;
unsigned int per_vertex_point_size : 1;
CoglPipelineLogicOpsState logic_ops_state;
CoglPipelineCullFaceState cull_face_state;
CoglPipelineUniformsState uniforms_state;
CoglPipelineSnippetList vertex_snippets;

View File

@@ -218,16 +218,6 @@ _cogl_pipeline_per_vertex_point_size_equal (CoglPipeline *authority0,
authority1->big_state->per_vertex_point_size);
}
gboolean
_cogl_pipeline_logic_ops_state_equal (CoglPipeline *authority0,
CoglPipeline *authority1)
{
CoglPipelineLogicOpsState *logic_ops_state0 = &authority0->big_state->logic_ops_state;
CoglPipelineLogicOpsState *logic_ops_state1 = &authority1->big_state->logic_ops_state;
return logic_ops_state0->color_mask == logic_ops_state1->color_mask;
}
gboolean
_cogl_pipeline_cull_face_state_equal (CoglPipeline *authority0,
CoglPipeline *authority1)
@@ -1203,49 +1193,6 @@ cogl_pipeline_get_depth_state (CoglPipeline *pipeline,
*state = authority->big_state->depth_state;
}
CoglColorMask
cogl_pipeline_get_color_mask (CoglPipeline *pipeline)
{
CoglPipeline *authority;
_COGL_RETURN_VAL_IF_FAIL (cogl_is_pipeline (pipeline), 0);
authority =
_cogl_pipeline_get_authority (pipeline, COGL_PIPELINE_STATE_LOGIC_OPS);
return authority->big_state->logic_ops_state.color_mask;
}
void
cogl_pipeline_set_color_mask (CoglPipeline *pipeline,
CoglColorMask color_mask)
{
CoglPipelineState state = COGL_PIPELINE_STATE_LOGIC_OPS;
CoglPipeline *authority;
CoglPipelineLogicOpsState *logic_ops_state;
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
authority = _cogl_pipeline_get_authority (pipeline, state);
logic_ops_state = &authority->big_state->logic_ops_state;
if (logic_ops_state->color_mask == color_mask)
return;
/* - Flush journal primitives referencing the current state.
* - Make sure the pipeline has no dependants so it may be modified.
* - If the pipeline isn't currently an authority for the state being
* changed, then initialize that state from the current authority.
*/
_cogl_pipeline_pre_change_notify (pipeline, state, NULL, FALSE);
logic_ops_state = &pipeline->big_state->logic_ops_state;
logic_ops_state->color_mask = color_mask;
_cogl_pipeline_update_authority (pipeline, authority, state,
_cogl_pipeline_logic_ops_state_equal);
}
void
_cogl_pipeline_set_fog_state (CoglPipeline *pipeline,
const CoglPipelineFogState *fog_state)
@@ -1951,15 +1898,6 @@ _cogl_pipeline_hash_per_vertex_point_size_state (CoglPipeline *authority,
sizeof (per_vertex_point_size));
}
void
_cogl_pipeline_hash_logic_ops_state (CoglPipeline *authority,
CoglPipelineHashState *state)
{
CoglPipelineLogicOpsState *logic_ops_state = &authority->big_state->logic_ops_state;
state->hash = _cogl_util_one_at_a_time_hash (state->hash, &logic_ops_state->color_mask,
sizeof (CoglColorMask));
}
void
_cogl_pipeline_hash_cull_face_state (CoglPipeline *authority,
CoglPipelineHashState *state)

View File

@@ -571,38 +571,6 @@ cogl_pipeline_set_per_vertex_point_size (CoglPipeline *pipeline,
gboolean
cogl_pipeline_get_per_vertex_point_size (CoglPipeline *pipeline);
/**
* cogl_pipeline_get_color_mask:
* @pipeline: a #CoglPipeline object.
*
* Gets the current #CoglColorMask of which channels would be written to the
* current framebuffer. Each bit set in the mask means that the
* corresponding color would be written.
*
* Returns: A #CoglColorMask
* Since: 1.8
* Stability: unstable
*/
CoglColorMask
cogl_pipeline_get_color_mask (CoglPipeline *pipeline);
/**
* cogl_pipeline_set_color_mask:
* @pipeline: a #CoglPipeline object.
* @color_mask: A #CoglColorMask of which color channels to write to
* the current framebuffer.
*
* Defines a bit mask of which color channels should be written to the
* current framebuffer. If a bit is set in @color_mask that means that
* color will be written.
*
* Since: 1.8
* Stability: unstable
*/
void
cogl_pipeline_set_color_mask (CoglPipeline *pipeline,
CoglColorMask color_mask);
/**
* cogl_pipeline_get_user_program:
* @pipeline: a #CoglPipeline object.

View File

@@ -99,7 +99,6 @@ _cogl_pipeline_init_default_pipeline (void)
CoglPipelineLightingState *lighting_state = &big_state->lighting_state;
CoglPipelineAlphaFuncState *alpha_state = &big_state->alpha_state;
CoglPipelineBlendState *blend_state = &big_state->blend_state;
CoglPipelineLogicOpsState *logic_ops_state = &big_state->logic_ops_state;
CoglPipelineCullFaceState *cull_face_state = &big_state->cull_face_state;
CoglPipelineUniformsState *uniforms_state = &big_state->uniforms_state;
@@ -189,8 +188,6 @@ _cogl_pipeline_init_default_pipeline (void)
big_state->point_size = 0.0f;
logic_ops_state->color_mask = COGL_COLOR_MASK_ALL;
cull_face_state->mode = COGL_PIPELINE_CULL_FACE_MODE_NONE;
cull_face_state->front_winding = COGL_WINDING_COUNTER_CLOCKWISE;
@@ -1030,13 +1027,6 @@ _cogl_pipeline_copy_differences (CoglPipeline *dest,
if (differences & COGL_PIPELINE_STATE_PER_VERTEX_POINT_SIZE)
big_state->per_vertex_point_size = src->big_state->per_vertex_point_size;
if (differences & COGL_PIPELINE_STATE_LOGIC_OPS)
{
memcpy (&big_state->logic_ops_state,
&src->big_state->logic_ops_state,
sizeof (CoglPipelineLogicOpsState));
}
if (differences & COGL_PIPELINE_STATE_CULL_FACE)
{
memcpy (&big_state->cull_face_state,
@@ -1150,13 +1140,6 @@ _cogl_pipeline_init_multi_property_sparse_state (CoglPipeline *pipeline,
sizeof (CoglPipelineFogState));
break;
}
case COGL_PIPELINE_STATE_LOGIC_OPS:
{
memcpy (&pipeline->big_state->logic_ops_state,
&authority->big_state->logic_ops_state,
sizeof (CoglPipelineLogicOpsState));
break;
}
case COGL_PIPELINE_STATE_CULL_FACE:
{
memcpy (&pipeline->big_state->cull_face_state,
@@ -2323,11 +2306,6 @@ _cogl_pipeline_equal (CoglPipeline *pipeline0,
authorities1[bit]))
goto done;
break;
case COGL_PIPELINE_STATE_LOGIC_OPS_INDEX:
if (!_cogl_pipeline_logic_ops_state_equal (authorities0[bit],
authorities1[bit]))
goto done;
break;
case COGL_PIPELINE_STATE_USER_SHADER_INDEX:
if (!_cogl_pipeline_user_shader_equal (authorities0[bit],
authorities1[bit]))
@@ -2776,8 +2754,6 @@ _cogl_pipeline_init_state_hash_functions (void)
_cogl_pipeline_hash_point_size_state;
state_hash_functions[COGL_PIPELINE_STATE_PER_VERTEX_POINT_SIZE_INDEX] =
_cogl_pipeline_hash_per_vertex_point_size_state;
state_hash_functions[COGL_PIPELINE_STATE_LOGIC_OPS_INDEX] =
_cogl_pipeline_hash_logic_ops_state;
state_hash_functions[COGL_PIPELINE_STATE_UNIFORMS_INDEX] =
_cogl_pipeline_hash_uniforms_state;
state_hash_functions[COGL_PIPELINE_STATE_VERTEX_SNIPPETS_INDEX] =
@@ -2787,7 +2763,7 @@ _cogl_pipeline_init_state_hash_functions (void)
{
/* So we get a big error if we forget to update this code! */
_COGL_STATIC_ASSERT (COGL_PIPELINE_STATE_SPARSE_COUNT == 18,
_COGL_STATIC_ASSERT (COGL_PIPELINE_STATE_SPARSE_COUNT == 17,
"Make sure to install a hash function for "
"newly added pipeline state and update assert "
"in _cogl_pipeline_init_state_hash_functions");

View File

@@ -55,11 +55,6 @@ G_BEGIN_DECLS
* made up of multiple 2D textures, or atlas textures where Cogl must
* internally modify user texture coordinates before they can be used
* by the GPU.
*
* You should be aware that many GPUs only support power of two sizes
* for #CoglTexture2D textures. You can check support for non power of
* two textures by checking for the %COGL_FEATURE_ID_TEXTURE_NPOT feature
* via cogl_has_feature().
*/
typedef struct _CoglTexture2D CoglTexture2D;
@@ -105,11 +100,6 @@ cogl_is_texture_2d (void *object);
* using cogl_texture_set_components() and
* cogl_texture_set_premultiplied().
*
* <note>Many GPUs only support power of two sizes for #CoglTexture2D
* textures. You can check support for non power of two textures by
* checking for the %COGL_FEATURE_ID_TEXTURE_NPOT feature via
* cogl_has_feature().</note>
*
* Returns: (transfer full): A new #CoglTexture2D object with no storage yet allocated.
*
* Since: 2.0
@@ -138,11 +128,6 @@ cogl_texture_2d_new_with_size (CoglContext *ctx,
* using cogl_texture_set_components() and
* cogl_texture_set_premultiplied().
*
* <note>Many GPUs only support power of two sizes for #CoglTexture2D
* textures. You can check support for non power of two textures by
* checking for the %COGL_FEATURE_ID_TEXTURE_NPOT feature via
* cogl_has_feature().</note>
*
* Return value: (transfer full): A newly created #CoglTexture2D or %NULL on failure
* and @error will be updated.
*
@@ -179,11 +164,6 @@ cogl_texture_2d_new_from_file (CoglContext *ctx,
* cogl_texture_2d_new_with_size() and then upload data using
* cogl_texture_set_data()</note>
*
* <note>Many GPUs only support power of two sizes for #CoglTexture2D
* textures. You can check support for non power of two textures by
* checking for the %COGL_FEATURE_ID_TEXTURE_NPOT feature via
* cogl_has_feature().</note>
*
* Returns: (transfer full): A newly allocated #CoglTexture2D, or if
* the size is not supported (because it is too large or a
* non-power-of-two size that the hardware doesn't support)
@@ -218,11 +198,6 @@ cogl_texture_2d_new_from_data (CoglContext *ctx,
* using cogl_texture_set_components() and
* cogl_texture_set_premultiplied().
*
* <note>Many GPUs only support power of two sizes for #CoglTexture2D
* textures. You can check support for non power of two textures by
* checking for the %COGL_FEATURE_ID_TEXTURE_NPOT feature via
* cogl_has_feature().</note>
*
* Returns: (transfer full): A newly allocated #CoglTexture2D
*
* Since: 2.0

View File

@@ -773,32 +773,6 @@ typedef enum _CoglWinsysFeature
COGL_WINSYS_FEATURE_N_FEATURES
} CoglWinsysFeature;
/**
* CoglColorMask:
* @COGL_COLOR_MASK_NONE: None of the color channels are masked
* @COGL_COLOR_MASK_RED: Masks the red color channel
* @COGL_COLOR_MASK_GREEN: Masks the green color channel
* @COGL_COLOR_MASK_BLUE: Masks the blue color channel
* @COGL_COLOR_MASK_ALPHA: Masks the alpha color channel
* @COGL_COLOR_MASK_ALL: All of the color channels are masked
*
* Defines a bit mask of color channels. This can be used with
* cogl_pipeline_set_color_mask() for example to define which color
* channels should be written to the current framebuffer when
* drawing something.
*/
typedef enum
{
COGL_COLOR_MASK_NONE = 0,
COGL_COLOR_MASK_RED = 1L<<0,
COGL_COLOR_MASK_GREEN = 1L<<1,
COGL_COLOR_MASK_BLUE = 1L<<2,
COGL_COLOR_MASK_ALPHA = 1L<<3,
/* XXX: glib-mkenums is a perl script that can't cope if we split
* this onto multiple lines! *sigh* */
COGL_COLOR_MASK_ALL = (COGL_COLOR_MASK_RED | COGL_COLOR_MASK_GREEN | COGL_COLOR_MASK_BLUE | COGL_COLOR_MASK_ALPHA)
} CoglColorMask;
/**
* CoglWinding:
* @COGL_WINDING_CLOCKWISE: Vertices are in a clockwise order

View File

@@ -132,7 +132,6 @@ cogl_color_init_from_hsl
cogl_color_init_from_4f
cogl_color_init_from_4fv
cogl_color_init_from_4ub
cogl_color_mask_get_type
cogl_color_new
cogl_color_premultiply
cogl_color_set_alpha
@@ -254,7 +253,6 @@ cogl_framebuffer_frustum
cogl_framebuffer_get_alpha_bits
cogl_framebuffer_get_blue_bits
cogl_framebuffer_get_color_format
cogl_framebuffer_get_color_mask
cogl_framebuffer_get_context
cogl_framebuffer_get_depth_bits
cogl_framebuffer_get_depth_texture
@@ -297,7 +295,6 @@ cogl_framebuffer_rotate_quaternion
#endif
cogl_framebuffer_scale
cogl_framebuffer_set_color_mask
cogl_framebuffer_set_depth_texture_enabled
cogl_framebuffer_set_depth_write_enabled
cogl_framebuffer_set_dither_enabled
@@ -620,7 +617,6 @@ cogl_pipeline_get_alpha_test_function
cogl_pipeline_get_alpha_test_reference
cogl_pipeline_get_ambient
cogl_pipeline_get_color
cogl_pipeline_get_color_mask
cogl_pipeline_get_cull_face_mode
cogl_pipeline_get_depth_state
cogl_pipeline_get_diffuse
@@ -650,7 +646,6 @@ cogl_pipeline_set_ambient_and_diffuse
cogl_pipeline_set_blend
cogl_pipeline_set_blend_constant
cogl_pipeline_set_color
cogl_pipeline_set_color_mask
cogl_pipeline_set_color4f
cogl_pipeline_set_color4ub
cogl_pipeline_set_cull_face_mode

View File

@@ -435,12 +435,7 @@ _cogl_clip_stack_gl_flush (CoglClipStack *stack,
anything */
if (ctx->current_clip_stack_valid)
{
if (ctx->current_clip_stack == stack &&
(ctx->needs_viewport_scissor_workaround == FALSE ||
(framebuffer->viewport_age ==
framebuffer->viewport_age_for_scissor_workaround &&
ctx->viewport_scissor_workaround_framebuffer ==
framebuffer)))
if (ctx->current_clip_stack == stack)
return;
_cogl_clip_stack_unref (ctx->current_clip_stack);
@@ -457,10 +452,8 @@ _cogl_clip_stack_gl_flush (CoglClipStack *stack,
GE( ctx, glDisable (GL_STENCIL_TEST) );
/* If the stack is empty then there's nothing else to do
*
* See comment below about ctx->needs_viewport_scissor_workaround
*/
if (stack == NULL && !ctx->needs_viewport_scissor_workaround)
if (stack == NULL)
{
COGL_NOTE (CLIPPING, "Flushed empty clip stack");
@@ -477,31 +470,6 @@ _cogl_clip_stack_gl_flush (CoglClipStack *stack,
&scissor_x0, &scissor_y0,
&scissor_x1, &scissor_y1);
/* XXX: ONGOING BUG: Intel viewport scissor
*
* Intel gen6 drivers don't correctly handle offset viewports, since
* primitives aren't clipped within the bounds of the viewport. To
* workaround this we push our own clip for the viewport that will
* use scissoring to ensure we clip as expected.
*
* TODO: file a bug upstream!
*/
if (ctx->needs_viewport_scissor_workaround)
{
_cogl_util_scissor_intersect (framebuffer->viewport_x,
framebuffer->viewport_y,
framebuffer->viewport_x +
framebuffer->viewport_width,
framebuffer->viewport_y +
framebuffer->viewport_height,
&scissor_x0, &scissor_y0,
&scissor_x1, &scissor_y1);
framebuffer->viewport_age_for_scissor_workaround =
framebuffer->viewport_age;
ctx->viewport_scissor_workaround_framebuffer =
framebuffer;
}
/* Enable scissoring as soon as possible */
if (scissor_x0 >= scissor_x1 || scissor_y0 >= scissor_y1)
scissor_x0 = scissor_y0 = scissor_x1 = scissor_y1 = scissor_y_start = 0;

View File

@@ -195,20 +195,6 @@ _cogl_framebuffer_gl_flush_projection_state (CoglFramebuffer *framebuffer)
projection_entry);
}
static void
_cogl_framebuffer_gl_flush_color_mask_state (CoglFramebuffer *framebuffer)
{
CoglContext *context = framebuffer->context;
/* The color mask state is really owned by a CoglPipeline so to
* ensure the color mask is updated the next time we draw something
* we need to make sure the logic ops for the pipeline are
* re-flushed... */
context->current_pipeline_changes_since_flush |=
COGL_PIPELINE_STATE_LOGIC_OPS;
context->current_pipeline_age--;
}
static void
_cogl_framebuffer_gl_flush_front_face_winding_state (CoglFramebuffer *framebuffer)
{
@@ -437,9 +423,6 @@ _cogl_framebuffer_gl_flush_state (CoglFramebuffer *draw_buffer,
case COGL_FRAMEBUFFER_STATE_INDEX_PROJECTION:
_cogl_framebuffer_gl_flush_projection_state (draw_buffer);
break;
case COGL_FRAMEBUFFER_STATE_INDEX_COLOR_MASK:
_cogl_framebuffer_gl_flush_color_mask_state (draw_buffer);
break;
case COGL_FRAMEBUFFER_STATE_INDEX_FRONT_FACE_WINDING:
_cogl_framebuffer_gl_flush_front_face_winding_state (draw_buffer);
break;
@@ -968,20 +951,6 @@ _cogl_framebuffer_gl_clear (CoglFramebuffer *framebuffer,
{
GE( ctx, glClearColor (red, green, blue, alpha) );
gl_buffers |= GL_COLOR_BUFFER_BIT;
if (ctx->current_gl_color_mask != framebuffer->color_mask)
{
CoglColorMask color_mask = framebuffer->color_mask;
GE( ctx, glColorMask (!!(color_mask & COGL_COLOR_MASK_RED),
!!(color_mask & COGL_COLOR_MASK_GREEN),
!!(color_mask & COGL_COLOR_MASK_BLUE),
!!(color_mask & COGL_COLOR_MASK_ALPHA)));
ctx->current_gl_color_mask = color_mask;
/* Make sure the ColorMask is updated when the next primitive is drawn */
ctx->current_pipeline_changes_since_flush |=
COGL_PIPELINE_STATE_LOGIC_OPS;
ctx->current_pipeline_age--;
}
}
if (buffers & COGL_BUFFER_BIT_DEPTH)

View File

@@ -581,23 +581,6 @@ _cogl_pipeline_flush_color_blend_alpha_depth_state (
flush_depth_state (ctx, depth_state);
}
if (pipelines_difference & COGL_PIPELINE_STATE_LOGIC_OPS)
{
CoglPipeline *authority =
_cogl_pipeline_get_authority (pipeline, COGL_PIPELINE_STATE_LOGIC_OPS);
CoglPipelineLogicOpsState *logic_ops_state = &authority->big_state->logic_ops_state;
CoglColorMask color_mask = logic_ops_state->color_mask;
if (ctx->current_draw_buffer)
color_mask &= ctx->current_draw_buffer->color_mask;
GE (ctx, glColorMask (!!(color_mask & COGL_COLOR_MASK_RED),
!!(color_mask & COGL_COLOR_MASK_GREEN),
!!(color_mask & COGL_COLOR_MASK_BLUE),
!!(color_mask & COGL_COLOR_MASK_ALPHA)));
ctx->current_gl_color_mask = color_mask;
}
if (pipelines_difference & COGL_PIPELINE_STATE_CULL_FACE)
{
CoglPipeline *authority =

View File

@@ -317,31 +317,13 @@ check_gl_version (CoglContext *ctx,
return FALSE;
}
/* GL 1.3 supports all of the required functionality in core */
if (COGL_CHECK_GL_VERSION (major, minor, 1, 3))
return TRUE;
/* OpenGL 1.2 is only supported if we have the multitexturing
extension */
if (!_cogl_check_extension ("GL_ARB_multitexture", gl_extensions))
/* We require GLSL 1.20, which is implied by OpenGL 2.1. */
if (!COGL_CHECK_GL_VERSION (major, minor, 2, 1))
{
_cogl_set_error (error,
COGL_DRIVER_ERROR,
COGL_DRIVER_ERROR_INVALID_VERSION,
"The OpenGL driver is missing "
"the GL_ARB_multitexture extension");
return FALSE;
}
/* OpenGL 1.2 is required */
if (!COGL_CHECK_GL_VERSION (major, minor, 1, 2))
{
_cogl_set_error (error,
COGL_DRIVER_ERROR,
COGL_DRIVER_ERROR_INVALID_VERSION,
"The OpenGL version of your driver (%i.%i) "
"is not compatible with Cogl",
major, minor);
COGL_DRIVER_ERROR,
COGL_DRIVER_ERROR_INVALID_VERSION,
"OpenGL 2.1 or better is required");
return FALSE;
}
@@ -356,6 +338,7 @@ _cogl_driver_update_features (CoglContext *ctx,
unsigned long private_features
[COGL_FLAGS_N_LONGS_FOR_SIZE (COGL_N_PRIVATE_FEATURES)] = { 0 };
char **gl_extensions;
const char *glsl_version;
int gl_major = 0, gl_minor = 0;
int i;
@@ -403,23 +386,13 @@ _cogl_driver_update_features (CoglContext *ctx,
_cogl_gpu_info_init (ctx, &ctx->gpu);
ctx->glsl_major = 1;
ctx->glsl_minor = 1;
ctx->glsl_minor = 2;
ctx->glsl_version_to_use = 120;
if (COGL_CHECK_GL_VERSION (gl_major, gl_minor, 2, 0))
{
const char *glsl_version =
(char *)ctx->glGetString (GL_SHADING_LANGUAGE_VERSION);
_cogl_gl_util_parse_gl_version (glsl_version,
&ctx->glsl_major,
&ctx->glsl_minor);
}
if (COGL_CHECK_GL_VERSION (ctx->glsl_major, ctx->glsl_minor, 1, 2))
/* We want to use version 120 if it is available so that the
* gl_PointCoord can be used. */
ctx->glsl_version_to_use = 120;
else
ctx->glsl_version_to_use = 110;
glsl_version = (char *)ctx->glGetString (GL_SHADING_LANGUAGE_VERSION);
_cogl_gl_util_parse_gl_version (glsl_version,
&ctx->glsl_major,
&ctx->glsl_minor);
flags = (COGL_FEATURE_TEXTURE_READ_PIXELS
| COGL_FEATURE_UNSIGNED_INT_INDICES
@@ -427,30 +400,21 @@ _cogl_driver_update_features (CoglContext *ctx,
COGL_FLAGS_SET (ctx->features,
COGL_FEATURE_ID_UNSIGNED_INT_INDICES, TRUE);
COGL_FLAGS_SET (ctx->features, COGL_FEATURE_ID_DEPTH_RANGE, TRUE);
if (COGL_CHECK_GL_VERSION (gl_major, gl_minor, 1, 4))
COGL_FLAGS_SET (ctx->features, COGL_FEATURE_ID_MIRRORED_REPEAT, TRUE);
COGL_FLAGS_SET (ctx->features, COGL_FEATURE_ID_MIRRORED_REPEAT, TRUE);
_cogl_feature_check_ext_functions (ctx,
gl_major,
gl_minor,
gl_extensions);
if (COGL_CHECK_GL_VERSION (gl_major, gl_minor, 2, 0) ||
_cogl_check_extension ("GL_ARB_texture_non_power_of_two", gl_extensions))
{
flags |= COGL_FEATURE_TEXTURE_NPOT
| COGL_FEATURE_TEXTURE_NPOT_BASIC
| COGL_FEATURE_TEXTURE_NPOT_MIPMAP
| COGL_FEATURE_TEXTURE_NPOT_REPEAT;
COGL_FLAGS_SET (ctx->features, COGL_FEATURE_ID_TEXTURE_NPOT, TRUE);
COGL_FLAGS_SET (ctx->features,
COGL_FEATURE_ID_TEXTURE_NPOT_BASIC, TRUE);
COGL_FLAGS_SET (ctx->features,
COGL_FEATURE_ID_TEXTURE_NPOT_MIPMAP, TRUE);
COGL_FLAGS_SET (ctx->features,
COGL_FEATURE_ID_TEXTURE_NPOT_REPEAT, TRUE);
}
flags |= COGL_FEATURE_TEXTURE_NPOT
| COGL_FEATURE_TEXTURE_NPOT_BASIC
| COGL_FEATURE_TEXTURE_NPOT_MIPMAP
| COGL_FEATURE_TEXTURE_NPOT_REPEAT;
COGL_FLAGS_SET (ctx->features, COGL_FEATURE_ID_TEXTURE_NPOT, TRUE);
COGL_FLAGS_SET (ctx->features, COGL_FEATURE_ID_TEXTURE_NPOT_BASIC, TRUE);
COGL_FLAGS_SET (ctx->features, COGL_FEATURE_ID_TEXTURE_NPOT_MIPMAP, TRUE);
COGL_FLAGS_SET (ctx->features, COGL_FEATURE_ID_TEXTURE_NPOT_REPEAT, TRUE);
if (_cogl_check_extension ("GL_MESA_pack_invert", gl_extensions))
COGL_FLAGS_SET (private_features,
@@ -483,64 +447,15 @@ _cogl_driver_update_features (CoglContext *ctx,
COGL_FLAGS_SET (ctx->features, COGL_FEATURE_ID_DEPTH_TEXTURE, TRUE);
}
if (COGL_CHECK_GL_VERSION (gl_major, gl_minor, 2, 1) ||
_cogl_check_extension ("GL_EXT_pixel_buffer_object", gl_extensions))
COGL_FLAGS_SET (private_features, COGL_PRIVATE_FEATURE_PBOS, TRUE);
COGL_FLAGS_SET (private_features, COGL_PRIVATE_FEATURE_PBOS, TRUE);
COGL_FLAGS_SET (private_features,
COGL_PRIVATE_FEATURE_BLEND_CONSTANT, TRUE);
if (COGL_CHECK_GL_VERSION (gl_major, gl_minor, 1, 4) ||
_cogl_check_extension ("GL_EXT_blend_color", gl_extensions))
COGL_FLAGS_SET (private_features,
COGL_PRIVATE_FEATURE_BLEND_CONSTANT, TRUE);
flags |= COGL_FEATURE_SHADERS_GLSL;
COGL_FLAGS_SET (ctx->features, COGL_FEATURE_ID_GLSL, TRUE);
if (ctx->glCreateProgram)
{
flags |= COGL_FEATURE_SHADERS_GLSL;
COGL_FLAGS_SET (ctx->features, COGL_FEATURE_ID_GLSL, TRUE);
}
else
{
/* If all of the old GLSL extensions are available then we can fake
* the GL 2.0 GLSL support by diverting to the old function names */
if (ctx->glCreateProgramObject && /* GL_ARB_shader_objects */
ctx->glVertexAttribPointer && /* GL_ARB_vertex_shader */
_cogl_check_extension ("GL_ARB_fragment_shader", gl_extensions))
{
ctx->glCreateShader = ctx->glCreateShaderObject;
ctx->glCreateProgram = ctx->glCreateProgramObject;
ctx->glDeleteShader = ctx->glDeleteObject;
ctx->glDeleteProgram = ctx->glDeleteObject;
ctx->glAttachShader = ctx->glAttachObject;
ctx->glUseProgram = ctx->glUseProgramObject;
ctx->glGetProgramInfoLog = ctx->glGetInfoLog;
ctx->glGetShaderInfoLog = ctx->glGetInfoLog;
ctx->glGetShaderiv = ctx->glGetObjectParameteriv;
ctx->glGetProgramiv = ctx->glGetObjectParameteriv;
ctx->glDetachShader = ctx->glDetachObject;
ctx->glGetAttachedShaders = ctx->glGetAttachedObjects;
/* FIXME: there doesn't seem to be an equivalent for glIsShader
* and glIsProgram. This doesn't matter for now because Cogl
* doesn't use these but if we add support for simulating a
* GLES2 context on top of regular GL then we'll need to do
* something here */
flags |= COGL_FEATURE_SHADERS_GLSL;
COGL_FLAGS_SET (ctx->features, COGL_FEATURE_ID_GLSL, TRUE);
}
}
if ((COGL_CHECK_GL_VERSION (gl_major, gl_minor, 2, 0) ||
_cogl_check_extension ("GL_ARB_point_sprite", gl_extensions)) &&
/* If GLSL is supported then we only enable point sprite support
* too if we have glsl >= 1.2 otherwise we don't have the
* gl_PointCoord builtin which we depend on in the glsl backend.
*/
(!COGL_FLAGS_GET (ctx->features, COGL_FEATURE_ID_GLSL) ||
COGL_CHECK_GL_VERSION (ctx->glsl_major, ctx->glsl_minor, 1, 2)))
{
flags |= COGL_FEATURE_POINT_SPRITE;
COGL_FLAGS_SET (ctx->features, COGL_FEATURE_ID_POINT_SPRITE, TRUE);
}
flags |= COGL_FEATURE_POINT_SPRITE;
COGL_FLAGS_SET (ctx->features, COGL_FEATURE_ID_POINT_SPRITE, TRUE);
if (ctx->glGenBuffers)
{
@@ -584,17 +499,9 @@ _cogl_driver_update_features (CoglContext *ctx,
COGL_FLAGS_SET (private_features,
COGL_PRIVATE_FEATURE_TEXTURE_SWIZZLE, TRUE);
/* The per-vertex point size is only available via GLSL with the
* gl_PointSize builtin. This is only available in GL 2.0 (not the
* GLSL extensions) */
if (COGL_CHECK_GL_VERSION (gl_major, gl_minor, 2, 0))
{
COGL_FLAGS_SET (ctx->features,
COGL_FEATURE_ID_PER_VERTEX_POINT_SIZE,
TRUE);
COGL_FLAGS_SET (private_features,
COGL_PRIVATE_FEATURE_ENABLE_PROGRAM_POINT_SIZE, TRUE);
}
COGL_FLAGS_SET (ctx->features, COGL_FEATURE_ID_PER_VERTEX_POINT_SIZE, TRUE);
COGL_FLAGS_SET (private_features,
COGL_PRIVATE_FEATURE_ENABLE_PROGRAM_POINT_SIZE, TRUE);
if (ctx->driver == COGL_DRIVER_GL)
{

View File

@@ -33,6 +33,7 @@
#include <string.h>
#include "cogl-context-private.h"
#include "cogl-error-private.h"
#include "cogl-feature-private.h"
#include "cogl-renderer-private.h"
#include "cogl-private.h"
@@ -287,6 +288,15 @@ _cogl_driver_update_features (CoglContext *context,
gl_minor = 1;
}
if (!COGL_CHECK_GL_VERSION (gl_major, gl_minor, 2, 0))
{
_cogl_set_error (error,
COGL_DRIVER_ERROR,
COGL_DRIVER_ERROR_INVALID_VERSION,
"OpenGL ES 2.0 or better is required");
return FALSE;
}
_cogl_feature_check_ext_functions (context,
gl_major,
gl_minor,
@@ -314,7 +324,6 @@ _cogl_driver_update_features (CoglContext *context,
COGL_FLAGS_SET (private_features, COGL_PRIVATE_FEATURE_ANY_GL, TRUE);
COGL_FLAGS_SET (private_features, COGL_PRIVATE_FEATURE_ALPHA_TEXTURES, TRUE);
/* Both GLES 1.1 and GLES 2.0 support point sprites in core */
flags |= COGL_FEATURE_POINT_SPRITE;
COGL_FLAGS_SET (context->features, COGL_FEATURE_ID_POINT_SPRITE, TRUE);
@@ -341,30 +350,17 @@ _cogl_driver_update_features (CoglContext *context,
COGL_FLAGS_SET (context->features, COGL_FEATURE_ID_DEPTH_TEXTURE, TRUE);
}
if (_cogl_check_extension ("GL_OES_texture_npot", gl_extensions))
{
flags |= (COGL_FEATURE_TEXTURE_NPOT |
COGL_FEATURE_TEXTURE_NPOT_BASIC |
COGL_FEATURE_TEXTURE_NPOT_MIPMAP |
COGL_FEATURE_TEXTURE_NPOT_REPEAT);
COGL_FLAGS_SET (context->features,
COGL_FEATURE_ID_TEXTURE_NPOT, TRUE);
COGL_FLAGS_SET (context->features,
COGL_FEATURE_ID_TEXTURE_NPOT_BASIC, TRUE);
COGL_FLAGS_SET (context->features,
COGL_FEATURE_ID_TEXTURE_NPOT_MIPMAP, TRUE);
COGL_FLAGS_SET (context->features,
COGL_FEATURE_ID_TEXTURE_NPOT_REPEAT, TRUE);
}
else if (_cogl_check_extension ("GL_IMG_texture_npot", gl_extensions))
{
flags |= (COGL_FEATURE_TEXTURE_NPOT_BASIC |
COGL_FEATURE_TEXTURE_NPOT_MIPMAP);
COGL_FLAGS_SET (context->features,
COGL_FEATURE_ID_TEXTURE_NPOT_BASIC, TRUE);
COGL_FLAGS_SET (context->features,
COGL_FEATURE_ID_TEXTURE_NPOT_MIPMAP, TRUE);
}
flags |= (COGL_FEATURE_TEXTURE_NPOT |
COGL_FEATURE_TEXTURE_NPOT_BASIC |
COGL_FEATURE_TEXTURE_NPOT_MIPMAP |
COGL_FEATURE_TEXTURE_NPOT_REPEAT);
COGL_FLAGS_SET (context->features, COGL_FEATURE_ID_TEXTURE_NPOT, TRUE);
COGL_FLAGS_SET (context->features,
COGL_FEATURE_ID_TEXTURE_NPOT_BASIC, TRUE);
COGL_FLAGS_SET (context->features,
COGL_FEATURE_ID_TEXTURE_NPOT_MIPMAP, TRUE);
COGL_FLAGS_SET (context->features,
COGL_FEATURE_ID_TEXTURE_NPOT_REPEAT, TRUE);
if (context->glTexImage3D)
{

View File

@@ -5,7 +5,6 @@ cogl_test_conformance_sources = [
'test-blend.c',
'test-depth-test.c',
'test-color-hsl.c',
'test-color-mask.c',
'test-backface-culling.c',
'test-just-vertex-shader.c',
'test-pipeline-user-matrix.c',

View File

@@ -1,111 +0,0 @@
#include <cogl/cogl.h>
#include "test-declarations.h"
#include "test-utils.h"
#define TEX_SIZE 128
#define NUM_FBOS 3
typedef struct _TestState
{
int width;
int height;
CoglTexture *tex[NUM_FBOS];
CoglFramebuffer *fbo[NUM_FBOS];
} TestState;
static void
paint (TestState *state)
{
CoglColor bg;
int i;
cogl_set_source_color4ub (255, 255, 255, 255);
/* We push the third framebuffer first so that later we can switch
back to it by popping to test that that works */
cogl_push_framebuffer (state->fbo[2]);
cogl_push_framebuffer (state->fbo[0]);
cogl_rectangle (-1.0, -1.0, 1.0, 1.0);
cogl_pop_framebuffer ();
cogl_push_framebuffer (state->fbo[1]);
cogl_rectangle (-1.0, -1.0, 1.0, 1.0);
cogl_pop_framebuffer ();
/* We should now be back on the third framebuffer */
cogl_rectangle (-1.0, -1.0, 1.0, 1.0);
cogl_pop_framebuffer ();
cogl_color_init_from_4ub (&bg, 128, 128, 128, 255);
cogl_clear (&bg, COGL_BUFFER_BIT_COLOR | COGL_BUFFER_BIT_DEPTH);
/* Render all of the textures to the screen */
for (i = 0; i < NUM_FBOS; i++)
{
CoglPipeline *pipeline = cogl_pipeline_new (test_ctx);
cogl_pipeline_set_layer_texture (pipeline, 0, state->tex[i]);
cogl_framebuffer_draw_rectangle (test_fb, pipeline,
2.0f / NUM_FBOS * i - 1.0f, -1.0f,
2.0f / NUM_FBOS * (i + 1) - 1.0f, 1.0f);
cogl_object_unref (pipeline);
}
/* Verify all of the fbos drew the right color */
for (i = 0; i < NUM_FBOS; i++)
{
uint8_t expected_colors[NUM_FBOS][4] =
{ { 0xff, 0x00, 0x00, 0xff },
{ 0x00, 0xff, 0x00, 0xff },
{ 0x00, 0x00, 0xff, 0xff } };
test_utils_check_pixel_rgb (test_fb,
state->width * (i + 0.5f) / NUM_FBOS,
state->height / 2,
expected_colors[i][0],
expected_colors[i][1],
expected_colors[i][2]);
}
}
void
test_color_mask (void)
{
TestState state;
int i;
state.width = cogl_framebuffer_get_width (test_fb);
state.height = cogl_framebuffer_get_height (test_fb);
for (i = 0; i < NUM_FBOS; i++)
{
state.tex[i] = test_utils_texture_new_with_size (test_ctx, 128, 128,
TEST_UTILS_TEXTURE_NO_ATLAS,
COGL_TEXTURE_COMPONENTS_RGB);
state.fbo[i] = cogl_offscreen_new_with_texture (state.tex[i]);
/* Clear the texture color bits */
cogl_framebuffer_clear4f (state.fbo[i],
COGL_BUFFER_BIT_COLOR, 0, 0, 0, 1);
cogl_framebuffer_set_color_mask (state.fbo[i],
i == 0 ? COGL_COLOR_MASK_RED :
i == 1 ? COGL_COLOR_MASK_GREEN :
COGL_COLOR_MASK_BLUE);
}
/* XXX: we have to push/pop a framebuffer since this test currently
* uses the legacy cogl_rectangle() api. */
cogl_push_framebuffer (test_fb);
paint (&state);
cogl_pop_framebuffer ();
if (cogl_test_verbose ())
g_print ("OK\n");
}

View File

@@ -60,7 +60,6 @@ main (int argc, char **argv)
ADD_TEST (test_path, 0, 0);
ADD_TEST (test_path_clip, 0, 0);
ADD_TEST (test_depth_test, 0, 0);
ADD_TEST (test_color_mask, 0, 0);
ADD_TEST (test_backface_culling, 0, TEST_REQUIREMENT_NPOT);
ADD_TEST (test_layer_remove, 0, 0);

View File

@@ -8,7 +8,6 @@ void test_premult (void);
void test_path (void);
void test_path_clip (void);
void test_depth_test (void);
void test_color_mask (void);
void test_backface_culling (void);
void test_layer_remove (void);
void test_sparse_pipeline (void);

View File

@@ -1,5 +1,5 @@
project('mutter', 'c',
version: '3.32.2',
version: '3.32.1',
meson_version: '>= 0.48.0',
license: 'GPLv2+'
)

View File

@@ -316,18 +316,11 @@ idle_monitor_dispatch_timeout (GSource *source,
gpointer user_data)
{
MetaIdleMonitorWatch *watch = (MetaIdleMonitorWatch *) user_data;
int64_t now;
int64_t ready_time;
now = g_source_get_time (source);
ready_time = g_source_get_ready_time (source);
if (ready_time > now)
return G_SOURCE_CONTINUE;
_meta_idle_monitor_watch_fire (watch);
g_source_set_ready_time (watch->timeout_source, -1);
return G_SOURCE_CONTINUE;
return TRUE;
}
static GSourceFuncs idle_monitor_source_funcs = {

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

@@ -1216,7 +1216,7 @@ load_keyboard_a11y_settings (MetaInputSettings *input_settings,
ClutterInputDevice *device)
{
MetaInputSettingsPrivate *priv = meta_input_settings_get_instance_private (input_settings);
ClutterKbdA11ySettings kbd_a11y_settings = { 0 };
ClutterKbdA11ySettings kbd_a11y_settings;
ClutterInputDevice *core_keyboard;
guint i;

View File

@@ -18,9 +18,6 @@ struct _MetaCompositor
guint pre_paint_func_id;
guint post_paint_func_id;
guint stage_presented_id;
guint stage_after_paint_id;
gint64 server_time_query_time;
gint64 server_time_offset;

View File

@@ -92,10 +92,6 @@ on_presented (ClutterStage *stage,
ClutterFrameInfo *frame_info,
MetaCompositor *compositor);
static void
on_top_window_actor_destroyed (MetaWindowActor *window_actor,
MetaCompositor *compositor);
static gboolean
is_modal (MetaDisplay *display)
{
@@ -135,31 +131,9 @@ meta_switch_workspace_completed (MetaCompositor *compositor)
void
meta_compositor_destroy (MetaCompositor *compositor)
{
g_signal_handler_disconnect (compositor->stage,
compositor->stage_after_paint_id);
g_signal_handler_disconnect (compositor->stage,
compositor->stage_presented_id);
compositor->stage_after_paint_id = 0;
compositor->stage_presented_id = 0;
compositor->stage = NULL;
clutter_threads_remove_repaint_func (compositor->pre_paint_func_id);
clutter_threads_remove_repaint_func (compositor->post_paint_func_id);
if (compositor->top_window_actor)
{
g_signal_handlers_disconnect_by_func (compositor->top_window_actor,
on_top_window_actor_destroyed,
compositor);
compositor->top_window_actor = NULL;
}
g_clear_pointer (&compositor->window_group, clutter_actor_destroy);
g_clear_pointer (&compositor->top_window_group, clutter_actor_destroy);
g_clear_pointer (&compositor->feedback_group, clutter_actor_destroy);
g_clear_pointer (&compositor->windows, g_list_free);
if (compositor->have_x11_sync_object)
meta_sync_ring_destroy ();
}
@@ -529,10 +503,9 @@ meta_compositor_manage (MetaCompositor *compositor)
compositor->stage = meta_backend_get_stage (backend);
compositor->stage_presented_id =
g_signal_connect (compositor->stage, "presented",
G_CALLBACK (on_presented),
compositor);
g_signal_connect (compositor->stage, "presented",
G_CALLBACK (on_presented),
compositor);
/* We use connect_after() here to accomodate code in GNOME Shell that,
* when benchmarking drawing performance, connects to ::after-paint
@@ -542,9 +515,8 @@ meta_compositor_manage (MetaCompositor *compositor)
* connections to ::after-paint, connect() vs. connect_after() doesn't
* matter.
*/
compositor->stage_after_paint_id =
g_signal_connect_after (compositor->stage, "after-paint",
G_CALLBACK (after_stage_paint), compositor);
g_signal_connect_after (CLUTTER_STAGE (compositor->stage), "after-paint",
G_CALLBACK (after_stage_paint), compositor);
clutter_stage_set_sync_delay (CLUTTER_STAGE (compositor->stage), META_SYNC_DELAY);

View File

@@ -316,6 +316,7 @@ get_base_pipeline (MetaShapedTexture *stex,
CoglContext *ctx)
{
CoglPipeline *pipeline;
CoglMatrix matrix;
if (stex->base_pipeline)
return stex->base_pipeline;
@@ -329,11 +330,11 @@ get_base_pipeline (MetaShapedTexture *stex,
COGL_PIPELINE_WRAP_MODE_CLAMP_TO_EDGE);
cogl_pipeline_set_layer_wrap_mode_t (pipeline, 1,
COGL_PIPELINE_WRAP_MODE_CLAMP_TO_EDGE);
cogl_matrix_init_identity (&matrix);
if (!stex->is_y_inverted)
{
CoglMatrix matrix;
cogl_matrix_init_identity (&matrix);
cogl_matrix_scale (&matrix, 1, -1, 1);
cogl_matrix_translate (&matrix, 0, -1, 0);
cogl_pipeline_set_layer_matrix (pipeline, 0, &matrix);
@@ -341,10 +342,9 @@ get_base_pipeline (MetaShapedTexture *stex,
if (stex->transform != META_MONITOR_TRANSFORM_NORMAL)
{
CoglMatrix matrix;
CoglEuler euler;
cogl_matrix_init_translation (&matrix, 0.5, 0.5, 0.0);
cogl_matrix_translate (&matrix, 0.5, 0.5, 0.0);
switch (stex->transform)
{
case META_MONITOR_TRANSFORM_90:
@@ -373,11 +373,45 @@ get_base_pipeline (MetaShapedTexture *stex,
}
cogl_matrix_rotate_euler (&matrix, &euler);
cogl_matrix_translate (&matrix, -0.5, -0.5, 0.0);
cogl_pipeline_set_layer_matrix (pipeline, 0, &matrix);
cogl_pipeline_set_layer_matrix (pipeline, 1, &matrix);
}
if (stex->has_viewport_src_rect)
{
ClutterActor *actor = CLUTTER_ACTOR (stex);
double tex_scale;
clutter_actor_get_scale (actor, &tex_scale, NULL);
if (meta_monitor_transform_is_rotated (stex->transform))
{
cogl_matrix_scale (&matrix,
stex->viewport_src_rect.size.width /
(stex->tex_height * tex_scale),
stex->viewport_src_rect.size.height /
(stex->tex_width * tex_scale),
1);
}
else
{
cogl_matrix_scale (&matrix,
stex->viewport_src_rect.size.width /
(stex->tex_width * tex_scale),
stex->viewport_src_rect.size.height /
(stex->tex_height * tex_scale),
1);
}
cogl_matrix_translate (&matrix,
stex->viewport_src_rect.origin.x /
stex->viewport_src_rect.size.width,
stex->viewport_src_rect.origin.y /
stex->viewport_src_rect.size.height,
0);
}
cogl_pipeline_set_layer_matrix (pipeline, 0, &matrix);
cogl_pipeline_set_layer_matrix (pipeline, 1, &matrix);
if (stex->snippet)
cogl_pipeline_add_layer_snippet (pipeline, 0, stex->snippet);
@@ -453,48 +487,10 @@ paint_clipped_rectangle (MetaShapedTexture *stex,
alloc_width = alloc->x2 - alloc->x1;
alloc_height = alloc->y2 - alloc->y1;
if (stex->has_viewport_src_rect)
{
double tex_scale;
float src_x;
float src_y;
float src_width;
float src_height;
clutter_actor_get_scale (CLUTTER_ACTOR (stex), &tex_scale, NULL);
src_x = stex->viewport_src_rect.origin.x / tex_scale;
src_y = stex->viewport_src_rect.origin.y / tex_scale;
src_width = stex->viewport_src_rect.size.width / tex_scale;
src_height = stex->viewport_src_rect.size.height / tex_scale;
coords[0] = rect->x * src_width / alloc_width + src_x;
coords[1] = rect->y * src_height / alloc_height + src_y;
coords[2] = rect->width * src_width / alloc_width + coords[0];
coords[3] = rect->height * src_height / alloc_height + coords[1];
if (meta_monitor_transform_is_rotated (stex->transform))
{
coords[0] /= stex->tex_height;
coords[1] /= stex->tex_width;
coords[2] /= stex->tex_height;
coords[3] /= stex->tex_width;
}
else
{
coords[0] /= stex->tex_width;
coords[1] /= stex->tex_height;
coords[2] /= stex->tex_width;
coords[3] /= stex->tex_height;
}
}
else
{
coords[0] = rect->x / alloc_width;
coords[1] = rect->y / alloc_height;
coords[2] = (rect->x + rect->width) / alloc_width;
coords[3] = (rect->y + rect->height) / alloc_height;
}
coords[0] = rect->x / alloc_width;
coords[1] = rect->y / alloc_height;
coords[2] = (rect->x + rect->width) / alloc_width;
coords[3] = (rect->y + rect->height) / alloc_height;
coords[4] = coords[0];
coords[5] = coords[1];
@@ -761,11 +757,10 @@ do_paint (MetaShapedTexture *stex,
else
{
/* 3) blended_tex_region is NULL. Do a full paint. */
paint_clipped_rectangle (stex,
fb,
blended_pipeline,
&tex_rect,
&alloc);
cogl_framebuffer_draw_rectangle (fb, blended_pipeline,
0, 0,
alloc.x2 - alloc.x1,
alloc.y2 - alloc.y1);
}
}
@@ -1207,6 +1202,7 @@ meta_shaped_texture_set_viewport_src_rect (MetaShapedTexture *stex,
{
stex->has_viewport_src_rect = TRUE;
stex->viewport_src_rect = *src_rect;
meta_shaped_texture_reset_pipelines (stex);
invalidate_size (stex);
}
}
@@ -1214,7 +1210,11 @@ meta_shaped_texture_set_viewport_src_rect (MetaShapedTexture *stex,
void
meta_shaped_texture_reset_viewport_src_rect (MetaShapedTexture *stex)
{
if (!stex->has_viewport_src_rect)
return;
stex->has_viewport_src_rect = FALSE;
meta_shaped_texture_reset_pipelines (stex);
invalidate_size (stex);
}
@@ -1237,6 +1237,9 @@ meta_shaped_texture_set_viewport_dst_size (MetaShapedTexture *stex,
void
meta_shaped_texture_reset_viewport_dst_size (MetaShapedTexture *stex)
{
if (!stex->has_viewport_dst_size)
return;
stex->has_viewport_dst_size = FALSE;
invalidate_size (stex);
}

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

@@ -1012,5 +1012,22 @@ meta_generate_random_id (GRand *rand,
return id;
}
void
meta_add_clutter_debug_flags (ClutterDebugFlag debug_flags,
ClutterDrawDebugFlag draw_flags,
ClutterPickDebugFlag pick_flags)
{
clutter_add_debug_flags (debug_flags, draw_flags, pick_flags);
}
void
meta_remove_clutter_debug_flags (ClutterDebugFlag debug_flags,
ClutterDrawDebugFlag draw_flags,
ClutterPickDebugFlag pick_flags)
{
clutter_remove_debug_flags (debug_flags, draw_flags, pick_flags);
}
/* eof util.c */

View File

@@ -226,4 +226,14 @@ typedef enum
META_EXPORT
MetaLocaleDirection meta_get_locale_direction (void);
META_EXPORT
void meta_add_clutter_debug_flags (ClutterDebugFlag debug_flags,
ClutterDrawDebugFlag draw_flags,
ClutterPickDebugFlag pick_flags);
META_EXPORT
void meta_remove_clutter_debug_flags (ClutterDebugFlag debug_flags,
ClutterDrawDebugFlag draw_flags,
ClutterPickDebugFlag pick_flags);
#endif /* META_UTIL_H */