Revert "cogl: Replace deprecated Cogl API"

This reverts commit 6dd9da05c7.

Windowing system features we need are not mapped on cogl_has_feature().

Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
This commit is contained in:
Emmanuele Bassi 2013-07-04 16:12:27 +01:00
parent 52e0ec92b7
commit 1f37798b4c

View File

@ -395,7 +395,6 @@ static void
clutter_stage_cogl_redraw (ClutterStageWindow *stage_window) clutter_stage_cogl_redraw (ClutterStageWindow *stage_window)
{ {
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window); ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
ClutterBackend *backend = clutter_get_default_backend ();
gboolean may_use_clipped_redraw; gboolean may_use_clipped_redraw;
gboolean use_clipped_redraw; gboolean use_clipped_redraw;
gboolean can_blit_sub_buffer; gboolean can_blit_sub_buffer;
@ -420,18 +419,17 @@ clutter_stage_cogl_redraw (ClutterStageWindow *stage_window)
"The time spent in blit_sub_buffer", "The time spent in blit_sub_buffer",
0 /* no application private data */); 0 /* no application private data */);
wrapper = CLUTTER_ACTOR (stage_cogl->wrapper);
if (!stage_cogl->onscreen) if (!stage_cogl->onscreen)
return; return;
CLUTTER_TIMER_START (_clutter_uprof_context, painting_timer); CLUTTER_TIMER_START (_clutter_uprof_context, painting_timer);
wrapper = CLUTTER_ACTOR (stage_cogl->wrapper); can_blit_sub_buffer =
cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_SWAP_REGION);
can_blit_sub_buffer = cogl_has_feature (backend->cogl_context, has_buffer_age = cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_BUFFER_AGE);
COGL_WINSYS_FEATURE_SWAP_REGION);
has_buffer_age = cogl_has_feature (backend->cogl_context,
COGL_WINSYS_FEATURE_BUFFER_AGE);
may_use_clipped_redraw = FALSE; may_use_clipped_redraw = FALSE;
if (_clutter_stage_window_can_clip_redraws (stage_window) && if (_clutter_stage_window_can_clip_redraws (stage_window) &&
@ -515,8 +513,6 @@ clutter_stage_cogl_redraw (ClutterStageWindow *stage_window)
if (use_clipped_redraw) if (use_clipped_redraw)
{ {
CoglFramebuffer *fb = COGL_FRAMEBUFFER (stage_cogl->onscreen);
CLUTTER_NOTE (CLIPPING, CLUTTER_NOTE (CLIPPING,
"Stage clip pushed: x=%d, y=%d, width=%d, height=%d\n", "Stage clip pushed: x=%d, y=%d, width=%d, height=%d\n",
clip_region->x, clip_region->x,
@ -526,14 +522,13 @@ clutter_stage_cogl_redraw (ClutterStageWindow *stage_window)
stage_cogl->using_clipped_redraw = TRUE; stage_cogl->using_clipped_redraw = TRUE;
cogl_framebuffer_push_scissor_clip (fb, cogl_clip_push_window_rectangle (clip_region->x,
clip_region->x, clip_region->y,
clip_region->y, clip_region->width,
clip_region->width, clip_region->height);
clip_region->height); _clutter_stage_do_paint (CLUTTER_STAGE (wrapper),
_clutter_stage_do_paint (CLUTTER_STAGE (wrapper), clip_region); clip_region);
cogl_clip_pop ();
cogl_framebuffer_pop_clip (fb);
stage_cogl->using_clipped_redraw = FALSE; stage_cogl->using_clipped_redraw = FALSE;
} }
@ -678,23 +673,20 @@ static void
clutter_stage_cogl_get_dirty_pixel (ClutterStageWindow *stage_window, clutter_stage_cogl_get_dirty_pixel (ClutterStageWindow *stage_window,
int *x, int *y) int *x, int *y)
{ {
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window); ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
ClutterBackend *backend = clutter_get_default_backend (); gboolean has_buffer_age = cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_BUFFER_AGE);
gboolean has_buffer_age; if ((stage_cogl->damage_history == NULL && has_buffer_age) || !has_buffer_age)
{
has_buffer_age = cogl_has_feature (backend->cogl_context, COGL_WINSYS_FEATURE_BUFFER_AGE); *x = 0;
if ((stage_cogl->damage_history == NULL && has_buffer_age) || !has_buffer_age) *y = 0;
{ }
*x = 0; else
*y = 0; {
} cairo_rectangle_int_t *rect;
else rect = (cairo_rectangle_int_t *) (stage_cogl->damage_history->data);
{ *x = rect->x;
cairo_rectangle_int_t *rect; *y = rect->y;
rect = (cairo_rectangle_int_t *) (stage_cogl->damage_history->data); }
*x = rect->x;
*y = rect->y;
}
} }
static void static void