framebuffer: expose experimental cogl_get_draw_framebuffer
This renames the two internal functions _cogl_get_draw/read_buffer as cogl_get_draw_framebuffer and _cogl_get_read_framebuffer. The former is now also exposed as experimental API.
This commit is contained in:
parent
aa1e45267b
commit
0b45110302
@ -480,7 +480,7 @@ enable_gl_state (CoglDrawFlags flags,
|
|||||||
CoglAttribute **attributes,
|
CoglAttribute **attributes,
|
||||||
ValidateLayerState *state)
|
ValidateLayerState *state)
|
||||||
{
|
{
|
||||||
CoglFramebuffer *framebuffer = _cogl_get_draw_buffer ();
|
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
|
||||||
int i;
|
int i;
|
||||||
#ifdef MAY_HAVE_PROGRAMABLE_GL
|
#ifdef MAY_HAVE_PROGRAMABLE_GL
|
||||||
GLuint generic_index = 0;
|
GLuint generic_index = 0;
|
||||||
@ -1066,7 +1066,7 @@ flush_state (CoglDrawFlags flags,
|
|||||||
{
|
{
|
||||||
if (!(flags & COGL_DRAW_SKIP_JOURNAL_FLUSH))
|
if (!(flags & COGL_DRAW_SKIP_JOURNAL_FLUSH))
|
||||||
{
|
{
|
||||||
CoglFramebuffer *framebuffer = _cogl_get_draw_buffer ();
|
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
|
||||||
_cogl_journal_flush (framebuffer->journal, framebuffer);
|
_cogl_journal_flush (framebuffer->journal, framebuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1086,8 +1086,8 @@ flush_state (CoglDrawFlags flags,
|
|||||||
* stack can cause some drawing which would change the array
|
* stack can cause some drawing which would change the array
|
||||||
* pointers. */
|
* pointers. */
|
||||||
if (!(flags & COGL_DRAW_SKIP_FRAMEBUFFER_FLUSH))
|
if (!(flags & COGL_DRAW_SKIP_FRAMEBUFFER_FLUSH))
|
||||||
_cogl_framebuffer_flush_state (_cogl_get_draw_buffer (),
|
_cogl_framebuffer_flush_state (cogl_get_draw_framebuffer (),
|
||||||
_cogl_get_read_buffer (),
|
_cogl_get_read_framebuffer (),
|
||||||
0);
|
0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ set_clip_plane (GLint plane_num,
|
|||||||
GLdouble plane[4];
|
GLdouble plane[4];
|
||||||
#endif
|
#endif
|
||||||
GLfloat angle;
|
GLfloat angle;
|
||||||
CoglFramebuffer *framebuffer = _cogl_get_draw_buffer ();
|
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
|
||||||
CoglMatrixStack *modelview_stack =
|
CoglMatrixStack *modelview_stack =
|
||||||
_cogl_framebuffer_get_modelview_stack (framebuffer);
|
_cogl_framebuffer_get_modelview_stack (framebuffer);
|
||||||
CoglMatrixStack *projection_stack =
|
CoglMatrixStack *projection_stack =
|
||||||
@ -131,7 +131,7 @@ set_clip_planes (float x_1,
|
|||||||
float x_2,
|
float x_2,
|
||||||
float y_2)
|
float y_2)
|
||||||
{
|
{
|
||||||
CoglFramebuffer *framebuffer = _cogl_get_draw_buffer ();
|
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
|
||||||
CoglMatrixStack *modelview_stack =
|
CoglMatrixStack *modelview_stack =
|
||||||
_cogl_framebuffer_get_modelview_stack (framebuffer);
|
_cogl_framebuffer_get_modelview_stack (framebuffer);
|
||||||
CoglMatrix modelview_matrix;
|
CoglMatrix modelview_matrix;
|
||||||
@ -192,7 +192,7 @@ add_stencil_clip_rectangle (float x_1,
|
|||||||
float y_2,
|
float y_2,
|
||||||
gboolean first)
|
gboolean first)
|
||||||
{
|
{
|
||||||
CoglFramebuffer *framebuffer = _cogl_get_draw_buffer ();
|
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
|
||||||
CoglMatrixStack *modelview_stack =
|
CoglMatrixStack *modelview_stack =
|
||||||
_cogl_framebuffer_get_modelview_stack (framebuffer);
|
_cogl_framebuffer_get_modelview_stack (framebuffer);
|
||||||
CoglMatrixStack *projection_stack =
|
CoglMatrixStack *projection_stack =
|
||||||
@ -598,7 +598,7 @@ _cogl_clip_stack_flush (CoglClipStack *stack)
|
|||||||
ctx->current_clip_stack = _cogl_clip_stack_ref (stack);
|
ctx->current_clip_stack = _cogl_clip_stack_ref (stack);
|
||||||
|
|
||||||
modelview_stack =
|
modelview_stack =
|
||||||
_cogl_framebuffer_get_modelview_stack (_cogl_get_draw_buffer ());
|
_cogl_framebuffer_get_modelview_stack (cogl_get_draw_framebuffer ());
|
||||||
|
|
||||||
has_clip_planes = cogl_features_available (COGL_FEATURE_FOUR_CLIP_PLANES);
|
has_clip_planes = cogl_features_available (COGL_FEATURE_FOUR_CLIP_PLANES);
|
||||||
|
|
||||||
@ -629,7 +629,7 @@ _cogl_clip_stack_flush (CoglClipStack *stack)
|
|||||||
scissor_x0 = scissor_y0 = scissor_x1 = scissor_y1 = scissor_y_start = 0;
|
scissor_x0 = scissor_y0 = scissor_x1 = scissor_y1 = scissor_y_start = 0;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CoglFramebuffer *framebuffer = _cogl_get_draw_buffer ();
|
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
|
||||||
|
|
||||||
/* We store the entry coordinates in Cogl coordinate space
|
/* We store the entry coordinates in Cogl coordinate space
|
||||||
* but OpenGL requires the window origin to be the bottom
|
* but OpenGL requires the window origin to be the bottom
|
||||||
|
@ -51,7 +51,7 @@ cogl_clip_push_window_rectangle (int x_offset,
|
|||||||
|
|
||||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||||
|
|
||||||
framebuffer = _cogl_get_draw_buffer ();
|
framebuffer = cogl_get_draw_framebuffer ();
|
||||||
clip_state = _cogl_framebuffer_get_clip_state (framebuffer);
|
clip_state = _cogl_framebuffer_get_clip_state (framebuffer);
|
||||||
|
|
||||||
clip_state->stacks->data =
|
clip_state->stacks->data =
|
||||||
@ -82,7 +82,7 @@ cogl_clip_push_rectangle (float x_1,
|
|||||||
|
|
||||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||||
|
|
||||||
framebuffer = _cogl_get_draw_buffer ();
|
framebuffer = cogl_get_draw_framebuffer ();
|
||||||
clip_state = _cogl_framebuffer_get_clip_state (framebuffer);
|
clip_state = _cogl_framebuffer_get_clip_state (framebuffer);
|
||||||
|
|
||||||
cogl_get_modelview_matrix (&modelview_matrix);
|
cogl_get_modelview_matrix (&modelview_matrix);
|
||||||
@ -139,7 +139,7 @@ cogl_clip_pop (void)
|
|||||||
|
|
||||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||||
|
|
||||||
framebuffer = _cogl_get_draw_buffer ();
|
framebuffer = cogl_get_draw_framebuffer ();
|
||||||
clip_state = _cogl_framebuffer_get_clip_state (framebuffer);
|
clip_state = _cogl_framebuffer_get_clip_state (framebuffer);
|
||||||
|
|
||||||
_cogl_clip_pop_real (clip_state);
|
_cogl_clip_pop_real (clip_state);
|
||||||
@ -157,7 +157,7 @@ _cogl_clip_state_flush (CoglClipState *clip_state)
|
|||||||
void
|
void
|
||||||
cogl_clip_ensure (void)
|
cogl_clip_ensure (void)
|
||||||
{
|
{
|
||||||
CoglFramebuffer *framebuffer = _cogl_get_draw_buffer ();
|
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
|
||||||
CoglClipState *clip_state;
|
CoglClipState *clip_state;
|
||||||
|
|
||||||
clip_state = _cogl_framebuffer_get_clip_state (framebuffer);
|
clip_state = _cogl_framebuffer_get_clip_state (framebuffer);
|
||||||
@ -183,7 +183,7 @@ cogl_clip_stack_save (void)
|
|||||||
|
|
||||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||||
|
|
||||||
framebuffer = _cogl_get_draw_buffer ();
|
framebuffer = cogl_get_draw_framebuffer ();
|
||||||
clip_state = _cogl_framebuffer_get_clip_state (framebuffer);
|
clip_state = _cogl_framebuffer_get_clip_state (framebuffer);
|
||||||
|
|
||||||
_cogl_clip_stack_save_real (clip_state);
|
_cogl_clip_stack_save_real (clip_state);
|
||||||
@ -213,7 +213,7 @@ cogl_clip_stack_restore (void)
|
|||||||
|
|
||||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||||
|
|
||||||
framebuffer = _cogl_get_draw_buffer ();
|
framebuffer = cogl_get_draw_framebuffer ();
|
||||||
clip_state = _cogl_framebuffer_get_clip_state (framebuffer);
|
clip_state = _cogl_framebuffer_get_clip_state (framebuffer);
|
||||||
|
|
||||||
_cogl_clip_stack_restore_real (clip_state);
|
_cogl_clip_stack_restore_real (clip_state);
|
||||||
|
@ -241,10 +241,7 @@ CoglHandle
|
|||||||
_cogl_onscreen_new (void);
|
_cogl_onscreen_new (void);
|
||||||
|
|
||||||
CoglFramebuffer *
|
CoglFramebuffer *
|
||||||
_cogl_get_draw_buffer (void);
|
_cogl_get_read_framebuffer (void);
|
||||||
|
|
||||||
CoglFramebuffer *
|
|
||||||
_cogl_get_read_buffer (void);
|
|
||||||
|
|
||||||
GSList *
|
GSList *
|
||||||
_cogl_create_framebuffer_stack (void);
|
_cogl_create_framebuffer_stack (void);
|
||||||
|
@ -513,7 +513,7 @@ _cogl_framebuffer_set_viewport (CoglFramebuffer *framebuffer,
|
|||||||
framebuffer->viewport_width = width;
|
framebuffer->viewport_width = width;
|
||||||
framebuffer->viewport_height = height;
|
framebuffer->viewport_height = height;
|
||||||
|
|
||||||
if (framebuffer->context && _cogl_get_draw_buffer () == framebuffer)
|
if (framebuffer->context && cogl_get_draw_framebuffer () == framebuffer)
|
||||||
framebuffer->context->dirty_gl_viewport = TRUE;
|
framebuffer->context->dirty_gl_viewport = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1105,8 +1105,8 @@ _cogl_set_framebuffers (CoglFramebuffer *draw_buffer,
|
|||||||
g_return_if_fail (_cogl_is_framebuffer (draw_buffer));
|
g_return_if_fail (_cogl_is_framebuffer (draw_buffer));
|
||||||
g_return_if_fail (_cogl_is_framebuffer (read_buffer));
|
g_return_if_fail (_cogl_is_framebuffer (read_buffer));
|
||||||
|
|
||||||
current_draw_buffer = _cogl_get_draw_buffer ();
|
current_draw_buffer = cogl_get_draw_framebuffer ();
|
||||||
current_read_buffer = _cogl_get_read_buffer ();
|
current_read_buffer = _cogl_get_read_framebuffer ();
|
||||||
|
|
||||||
if (current_draw_buffer != draw_buffer ||
|
if (current_draw_buffer != draw_buffer ||
|
||||||
current_read_buffer != read_buffer)
|
current_read_buffer != read_buffer)
|
||||||
@ -1147,7 +1147,7 @@ cogl_set_draw_buffer (CoglBufferTarget target, CoglHandle handle)
|
|||||||
}
|
}
|
||||||
|
|
||||||
CoglFramebuffer *
|
CoglFramebuffer *
|
||||||
_cogl_get_draw_buffer (void)
|
cogl_get_draw_framebuffer (void)
|
||||||
{
|
{
|
||||||
CoglFramebufferStackEntry *entry;
|
CoglFramebufferStackEntry *entry;
|
||||||
|
|
||||||
@ -1161,7 +1161,7 @@ _cogl_get_draw_buffer (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
CoglFramebuffer *
|
CoglFramebuffer *
|
||||||
_cogl_get_read_buffer (void)
|
_cogl_get_read_framebuffer (void)
|
||||||
{
|
{
|
||||||
CoglFramebufferStackEntry *entry;
|
CoglFramebufferStackEntry *entry;
|
||||||
|
|
||||||
@ -1192,8 +1192,8 @@ _cogl_push_framebuffers (CoglFramebuffer *draw_buffer,
|
|||||||
|
|
||||||
/* Copy the top of the stack so that when we call cogl_set_framebuffer
|
/* Copy the top of the stack so that when we call cogl_set_framebuffer
|
||||||
it will still know what the old framebuffer was */
|
it will still know what the old framebuffer was */
|
||||||
old_draw_buffer = cogl_object_ref (_cogl_get_draw_buffer ());
|
old_draw_buffer = cogl_object_ref (cogl_get_draw_framebuffer ());
|
||||||
old_read_buffer = cogl_object_ref (_cogl_get_read_buffer ());
|
old_read_buffer = cogl_object_ref (_cogl_get_read_framebuffer ());
|
||||||
ctx->framebuffer_stack =
|
ctx->framebuffer_stack =
|
||||||
g_slist_prepend (ctx->framebuffer_stack,
|
g_slist_prepend (ctx->framebuffer_stack,
|
||||||
create_stack_entry (old_draw_buffer,
|
create_stack_entry (old_draw_buffer,
|
||||||
@ -1212,7 +1212,7 @@ cogl_push_framebuffer (CoglFramebuffer *buffer)
|
|||||||
void
|
void
|
||||||
cogl_push_draw_buffer (void)
|
cogl_push_draw_buffer (void)
|
||||||
{
|
{
|
||||||
cogl_push_framebuffer (_cogl_get_draw_buffer ());
|
cogl_push_framebuffer (cogl_get_draw_framebuffer ());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -1455,8 +1455,8 @@ _cogl_blit_framebuffer (unsigned int src_x,
|
|||||||
CoglFramebuffer *read_buffer;
|
CoglFramebuffer *read_buffer;
|
||||||
CoglContext *ctx;
|
CoglContext *ctx;
|
||||||
|
|
||||||
draw_buffer = _cogl_get_draw_buffer ();
|
draw_buffer = cogl_get_draw_framebuffer ();
|
||||||
read_buffer = _cogl_get_read_buffer ();
|
read_buffer = _cogl_get_read_framebuffer ();
|
||||||
ctx = draw_buffer->context;
|
ctx = draw_buffer->context;
|
||||||
|
|
||||||
g_return_if_fail (cogl_features_available (COGL_FEATURE_OFFSCREEN_BLIT));
|
g_return_if_fail (cogl_features_available (COGL_FEATURE_OFFSCREEN_BLIT));
|
||||||
@ -1470,8 +1470,8 @@ _cogl_blit_framebuffer (unsigned int src_x,
|
|||||||
|
|
||||||
/* Make sure the current framebuffers are bound. We explicitly avoid
|
/* Make sure the current framebuffers are bound. We explicitly avoid
|
||||||
flushing the clip state so we can bind our own empty state */
|
flushing the clip state so we can bind our own empty state */
|
||||||
_cogl_framebuffer_flush_state (_cogl_get_draw_buffer (),
|
_cogl_framebuffer_flush_state (cogl_get_draw_framebuffer (),
|
||||||
_cogl_get_read_buffer (),
|
_cogl_get_read_framebuffer (),
|
||||||
COGL_FRAMEBUFFER_FLUSH_SKIP_CLIP_STATE);
|
COGL_FRAMEBUFFER_FLUSH_SKIP_CLIP_STATE);
|
||||||
|
|
||||||
/* Flush any empty clip stack because glBlitFramebuffer is affected
|
/* Flush any empty clip stack because glBlitFramebuffer is affected
|
||||||
|
@ -1519,7 +1519,7 @@ _cogl_journal_log_quad (CoglJournal *journal,
|
|||||||
|
|
||||||
entry->pipeline = _cogl_pipeline_journal_ref (source);
|
entry->pipeline = _cogl_pipeline_journal_ref (source);
|
||||||
|
|
||||||
clip_stack = _cogl_framebuffer_get_clip_stack (_cogl_get_draw_buffer ());
|
clip_stack = _cogl_framebuffer_get_clip_stack (cogl_get_draw_framebuffer ());
|
||||||
entry->clip_stack = _cogl_clip_stack_ref (clip_stack);
|
entry->clip_stack = _cogl_clip_stack_ref (clip_stack);
|
||||||
|
|
||||||
if (G_UNLIKELY (source != pipeline))
|
if (G_UNLIKELY (source != pipeline))
|
||||||
@ -1529,7 +1529,7 @@ _cogl_journal_log_quad (CoglJournal *journal,
|
|||||||
|
|
||||||
_cogl_pipeline_foreach_layer_internal (pipeline,
|
_cogl_pipeline_foreach_layer_internal (pipeline,
|
||||||
add_framebuffer_deps_cb,
|
add_framebuffer_deps_cb,
|
||||||
_cogl_get_draw_buffer ());
|
cogl_get_draw_framebuffer ());
|
||||||
|
|
||||||
/* XXX: It doesn't feel very nice that in this case we just assume
|
/* XXX: It doesn't feel very nice that in this case we just assume
|
||||||
* that the journal is associated with the current framebuffer. I
|
* that the journal is associated with the current framebuffer. I
|
||||||
@ -1537,7 +1537,7 @@ _cogl_journal_log_quad (CoglJournal *journal,
|
|||||||
* the reason we don't have that currently is that it would
|
* the reason we don't have that currently is that it would
|
||||||
* introduce a circular reference. */
|
* introduce a circular reference. */
|
||||||
if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_DISABLE_BATCHING)))
|
if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_DISABLE_BATCHING)))
|
||||||
_cogl_framebuffer_flush_journal (_cogl_get_draw_buffer ());
|
_cogl_framebuffer_flush_journal (cogl_get_draw_framebuffer ());
|
||||||
|
|
||||||
COGL_TIMER_STOP (_cogl_uprof_context, log_timer);
|
COGL_TIMER_STOP (_cogl_uprof_context, log_timer);
|
||||||
}
|
}
|
||||||
@ -1588,7 +1588,7 @@ entry_to_screen_polygon (const CoglJournalEntry *entry,
|
|||||||
4 /* n_points */);
|
4 /* n_points */);
|
||||||
|
|
||||||
projection_stack =
|
projection_stack =
|
||||||
_cogl_framebuffer_get_projection_stack (_cogl_get_draw_buffer ());
|
_cogl_framebuffer_get_projection_stack (cogl_get_draw_framebuffer ());
|
||||||
_cogl_matrix_stack_get (projection_stack, &projection);
|
_cogl_matrix_stack_get (projection_stack, &projection);
|
||||||
|
|
||||||
cogl_matrix_project_points (&projection,
|
cogl_matrix_project_points (&projection,
|
||||||
@ -1600,7 +1600,7 @@ entry_to_screen_polygon (const CoglJournalEntry *entry,
|
|||||||
poly, /* points_out */
|
poly, /* points_out */
|
||||||
4 /* n_points */);
|
4 /* n_points */);
|
||||||
|
|
||||||
_cogl_framebuffer_get_viewport4fv (_cogl_get_draw_buffer (),
|
_cogl_framebuffer_get_viewport4fv (cogl_get_draw_framebuffer (),
|
||||||
viewport);
|
viewport);
|
||||||
|
|
||||||
/* Scale from OpenGL normalized device coordinates (ranging from -1 to 1)
|
/* Scale from OpenGL normalized device coordinates (ranging from -1 to 1)
|
||||||
|
@ -434,7 +434,7 @@ _cogl_matrix_stack_prepare_for_flush (CoglMatrixStack *stack,
|
|||||||
* always render upside down to offscreen buffers.
|
* always render upside down to offscreen buffers.
|
||||||
*/
|
*/
|
||||||
if (mode == COGL_MATRIX_PROJECTION &&
|
if (mode == COGL_MATRIX_PROJECTION &&
|
||||||
cogl_is_offscreen (_cogl_get_draw_buffer ()))
|
cogl_is_offscreen (cogl_get_draw_framebuffer ()))
|
||||||
{
|
{
|
||||||
CoglMatrix flipped_projection;
|
CoglMatrix flipped_projection;
|
||||||
CoglMatrix *projection =
|
CoglMatrix *projection =
|
||||||
|
@ -78,7 +78,7 @@ log_quad_sub_textures_cb (CoglHandle texture_handle,
|
|||||||
void *user_data)
|
void *user_data)
|
||||||
{
|
{
|
||||||
TextureSlicedQuadState *state = user_data;
|
TextureSlicedQuadState *state = user_data;
|
||||||
CoglFramebuffer *framebuffer = _cogl_get_draw_buffer ();
|
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
|
||||||
CoglHandle texture_override;
|
CoglHandle texture_override;
|
||||||
float quad_coords[4];
|
float quad_coords[4];
|
||||||
|
|
||||||
@ -542,7 +542,7 @@ _cogl_multitexture_quad_single_primitive (const float *position,
|
|||||||
if (state.override_pipeline)
|
if (state.override_pipeline)
|
||||||
pipeline = state.override_pipeline;
|
pipeline = state.override_pipeline;
|
||||||
|
|
||||||
framebuffer = _cogl_get_draw_buffer ();
|
framebuffer = cogl_get_draw_framebuffer ();
|
||||||
_cogl_journal_log_quad (framebuffer->journal,
|
_cogl_journal_log_quad (framebuffer->journal,
|
||||||
position,
|
position,
|
||||||
pipeline,
|
pipeline,
|
||||||
|
@ -459,8 +459,8 @@ _cogl_texture_2d_copy_from_framebuffer (CoglHandle handle,
|
|||||||
|
|
||||||
/* Make sure the current framebuffers are bound. We explicitly avoid
|
/* Make sure the current framebuffers are bound. We explicitly avoid
|
||||||
flushing the clip state so we can bind our own empty state */
|
flushing the clip state so we can bind our own empty state */
|
||||||
_cogl_framebuffer_flush_state (_cogl_get_draw_buffer (),
|
_cogl_framebuffer_flush_state (cogl_get_draw_framebuffer (),
|
||||||
_cogl_get_read_buffer (),
|
_cogl_get_read_framebuffer (),
|
||||||
0);
|
0);
|
||||||
|
|
||||||
_cogl_bind_gl_texture_transient (GL_TEXTURE_2D,
|
_cogl_bind_gl_texture_transient (GL_TEXTURE_2D,
|
||||||
|
@ -1048,7 +1048,7 @@ _cogl_texture_draw_and_read (CoglHandle handle,
|
|||||||
|
|
||||||
bpp = _cogl_get_format_bpp (COGL_PIXEL_FORMAT_RGBA_8888);
|
bpp = _cogl_get_format_bpp (COGL_PIXEL_FORMAT_RGBA_8888);
|
||||||
|
|
||||||
framebuffer = _cogl_get_draw_buffer ();
|
framebuffer = cogl_get_draw_framebuffer ();
|
||||||
/* Viewport needs to have some size and be inside the window for this */
|
/* Viewport needs to have some size and be inside the window for this */
|
||||||
_cogl_framebuffer_get_viewport4fv (framebuffer, viewport);
|
_cogl_framebuffer_get_viewport4fv (framebuffer, viewport);
|
||||||
if (viewport[0] < 0 || viewport[1] < 0 ||
|
if (viewport[0] < 0 || viewport[1] < 0 ||
|
||||||
|
46
cogl/cogl.c
46
cogl/cogl.c
@ -151,7 +151,7 @@ cogl_check_extension (const char *name, const char *ext)
|
|||||||
void
|
void
|
||||||
cogl_clear (const CoglColor *color, unsigned long buffers)
|
cogl_clear (const CoglColor *color, unsigned long buffers)
|
||||||
{
|
{
|
||||||
_cogl_framebuffer_clear (_cogl_get_draw_buffer (), buffers, color);
|
_cogl_framebuffer_clear (cogl_get_draw_framebuffer (), buffers, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -282,7 +282,7 @@ cogl_set_backface_culling_enabled (gboolean setting)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
/* Currently the journal can't track changes to backface culling state... */
|
/* Currently the journal can't track changes to backface culling state... */
|
||||||
_cogl_framebuffer_flush_journal (_cogl_get_draw_buffer ());
|
_cogl_framebuffer_flush_journal (cogl_get_draw_framebuffer ());
|
||||||
|
|
||||||
ctx->enable_backface_culling = setting;
|
ctx->enable_backface_culling = setting;
|
||||||
}
|
}
|
||||||
@ -311,7 +311,7 @@ _cogl_flush_face_winding (void)
|
|||||||
* all offscreen rendering is done upside down resulting in reversed winding
|
* all offscreen rendering is done upside down resulting in reversed winding
|
||||||
* for all triangles.
|
* for all triangles.
|
||||||
*/
|
*/
|
||||||
if (cogl_is_offscreen (_cogl_get_draw_buffer ()))
|
if (cogl_is_offscreen (cogl_get_draw_framebuffer ()))
|
||||||
winding = COGL_FRONT_WINDING_CLOCKWISE;
|
winding = COGL_FRONT_WINDING_CLOCKWISE;
|
||||||
else
|
else
|
||||||
winding = COGL_FRONT_WINDING_COUNTER_CLOCKWISE;
|
winding = COGL_FRONT_WINDING_COUNTER_CLOCKWISE;
|
||||||
@ -360,7 +360,7 @@ cogl_set_viewport (int x,
|
|||||||
|
|
||||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||||
|
|
||||||
framebuffer = _cogl_get_draw_buffer ();
|
framebuffer = cogl_get_draw_framebuffer ();
|
||||||
|
|
||||||
_cogl_framebuffer_set_viewport (framebuffer,
|
_cogl_framebuffer_set_viewport (framebuffer,
|
||||||
x,
|
x,
|
||||||
@ -413,7 +413,7 @@ cogl_get_viewport (float viewport[4])
|
|||||||
|
|
||||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||||
|
|
||||||
framebuffer = _cogl_get_draw_buffer ();
|
framebuffer = cogl_get_draw_framebuffer ();
|
||||||
_cogl_framebuffer_get_viewport4fv (framebuffer, viewport);
|
_cogl_framebuffer_get_viewport4fv (framebuffer, viewport);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -425,7 +425,7 @@ cogl_get_bitmasks (int *red,
|
|||||||
{
|
{
|
||||||
CoglFramebuffer *framebuffer;
|
CoglFramebuffer *framebuffer;
|
||||||
|
|
||||||
framebuffer = _cogl_get_draw_buffer ();
|
framebuffer = cogl_get_draw_framebuffer ();
|
||||||
|
|
||||||
if (red)
|
if (red)
|
||||||
*red = _cogl_framebuffer_get_red_bits (framebuffer);
|
*red = _cogl_framebuffer_get_red_bits (framebuffer);
|
||||||
@ -492,7 +492,7 @@ _cogl_read_pixels_with_rowstride (int x,
|
|||||||
guint8 *pixels,
|
guint8 *pixels,
|
||||||
int rowstride)
|
int rowstride)
|
||||||
{
|
{
|
||||||
CoglFramebuffer *framebuffer = _cogl_get_read_buffer ();
|
CoglFramebuffer *framebuffer = _cogl_get_read_framebuffer ();
|
||||||
int framebuffer_height;
|
int framebuffer_height;
|
||||||
int bpp;
|
int bpp;
|
||||||
CoglBitmap *bmp;
|
CoglBitmap *bmp;
|
||||||
@ -532,7 +532,7 @@ _cogl_read_pixels_with_rowstride (int x,
|
|||||||
*/
|
*/
|
||||||
cogl_flush ();
|
cogl_flush ();
|
||||||
|
|
||||||
_cogl_framebuffer_flush_state (_cogl_get_draw_buffer (),
|
_cogl_framebuffer_flush_state (cogl_get_draw_framebuffer (),
|
||||||
framebuffer,
|
framebuffer,
|
||||||
0);
|
0);
|
||||||
|
|
||||||
@ -703,8 +703,8 @@ cogl_begin_gl (void)
|
|||||||
* NB: _cogl_framebuffer_flush_state may disrupt various state (such
|
* NB: _cogl_framebuffer_flush_state may disrupt various state (such
|
||||||
* as the pipeline state) when flushing the clip stack, so should
|
* as the pipeline state) when flushing the clip stack, so should
|
||||||
* always be done first when preparing to draw. */
|
* always be done first when preparing to draw. */
|
||||||
_cogl_framebuffer_flush_state (_cogl_get_draw_buffer (),
|
_cogl_framebuffer_flush_state (cogl_get_draw_framebuffer (),
|
||||||
_cogl_get_read_buffer (),
|
_cogl_get_read_framebuffer (),
|
||||||
0);
|
0);
|
||||||
|
|
||||||
/* Setup the state for the current pipeline */
|
/* Setup the state for the current pipeline */
|
||||||
@ -761,7 +761,7 @@ void
|
|||||||
cogl_push_matrix (void)
|
cogl_push_matrix (void)
|
||||||
{
|
{
|
||||||
CoglMatrixStack *modelview_stack =
|
CoglMatrixStack *modelview_stack =
|
||||||
_cogl_framebuffer_get_modelview_stack (_cogl_get_draw_buffer ());
|
_cogl_framebuffer_get_modelview_stack (cogl_get_draw_framebuffer ());
|
||||||
_cogl_matrix_stack_push (modelview_stack);
|
_cogl_matrix_stack_push (modelview_stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -769,7 +769,7 @@ void
|
|||||||
cogl_pop_matrix (void)
|
cogl_pop_matrix (void)
|
||||||
{
|
{
|
||||||
CoglMatrixStack *modelview_stack =
|
CoglMatrixStack *modelview_stack =
|
||||||
_cogl_framebuffer_get_modelview_stack (_cogl_get_draw_buffer ());
|
_cogl_framebuffer_get_modelview_stack (cogl_get_draw_framebuffer ());
|
||||||
_cogl_matrix_stack_pop (modelview_stack);
|
_cogl_matrix_stack_pop (modelview_stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -777,7 +777,7 @@ void
|
|||||||
cogl_scale (float x, float y, float z)
|
cogl_scale (float x, float y, float z)
|
||||||
{
|
{
|
||||||
CoglMatrixStack *modelview_stack =
|
CoglMatrixStack *modelview_stack =
|
||||||
_cogl_framebuffer_get_modelview_stack (_cogl_get_draw_buffer ());
|
_cogl_framebuffer_get_modelview_stack (cogl_get_draw_framebuffer ());
|
||||||
_cogl_matrix_stack_scale (modelview_stack, x, y, z);
|
_cogl_matrix_stack_scale (modelview_stack, x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -785,7 +785,7 @@ void
|
|||||||
cogl_translate (float x, float y, float z)
|
cogl_translate (float x, float y, float z)
|
||||||
{
|
{
|
||||||
CoglMatrixStack *modelview_stack =
|
CoglMatrixStack *modelview_stack =
|
||||||
_cogl_framebuffer_get_modelview_stack (_cogl_get_draw_buffer ());
|
_cogl_framebuffer_get_modelview_stack (cogl_get_draw_framebuffer ());
|
||||||
_cogl_matrix_stack_translate (modelview_stack, x, y, z);
|
_cogl_matrix_stack_translate (modelview_stack, x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -793,7 +793,7 @@ void
|
|||||||
cogl_rotate (float angle, float x, float y, float z)
|
cogl_rotate (float angle, float x, float y, float z)
|
||||||
{
|
{
|
||||||
CoglMatrixStack *modelview_stack =
|
CoglMatrixStack *modelview_stack =
|
||||||
_cogl_framebuffer_get_modelview_stack (_cogl_get_draw_buffer ());
|
_cogl_framebuffer_get_modelview_stack (cogl_get_draw_framebuffer ());
|
||||||
_cogl_matrix_stack_rotate (modelview_stack, angle, x, y, z);
|
_cogl_matrix_stack_rotate (modelview_stack, angle, x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -801,7 +801,7 @@ void
|
|||||||
cogl_transform (const CoglMatrix *matrix)
|
cogl_transform (const CoglMatrix *matrix)
|
||||||
{
|
{
|
||||||
CoglMatrixStack *modelview_stack =
|
CoglMatrixStack *modelview_stack =
|
||||||
_cogl_framebuffer_get_modelview_stack (_cogl_get_draw_buffer ());
|
_cogl_framebuffer_get_modelview_stack (cogl_get_draw_framebuffer ());
|
||||||
_cogl_matrix_stack_multiply (modelview_stack, matrix);
|
_cogl_matrix_stack_multiply (modelview_stack, matrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -830,7 +830,7 @@ cogl_frustum (float left,
|
|||||||
float z_far)
|
float z_far)
|
||||||
{
|
{
|
||||||
CoglMatrixStack *projection_stack =
|
CoglMatrixStack *projection_stack =
|
||||||
_cogl_framebuffer_get_projection_stack (_cogl_get_draw_buffer ());
|
_cogl_framebuffer_get_projection_stack (cogl_get_draw_framebuffer ());
|
||||||
|
|
||||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||||
|
|
||||||
@ -855,7 +855,7 @@ cogl_ortho (float left,
|
|||||||
{
|
{
|
||||||
CoglMatrix ortho;
|
CoglMatrix ortho;
|
||||||
CoglMatrixStack *projection_stack =
|
CoglMatrixStack *projection_stack =
|
||||||
_cogl_framebuffer_get_projection_stack (_cogl_get_draw_buffer ());
|
_cogl_framebuffer_get_projection_stack (cogl_get_draw_framebuffer ());
|
||||||
|
|
||||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||||
|
|
||||||
@ -868,7 +868,7 @@ void
|
|||||||
cogl_get_modelview_matrix (CoglMatrix *matrix)
|
cogl_get_modelview_matrix (CoglMatrix *matrix)
|
||||||
{
|
{
|
||||||
CoglMatrixStack *modelview_stack =
|
CoglMatrixStack *modelview_stack =
|
||||||
_cogl_framebuffer_get_modelview_stack (_cogl_get_draw_buffer ());
|
_cogl_framebuffer_get_modelview_stack (cogl_get_draw_framebuffer ());
|
||||||
_cogl_matrix_stack_get (modelview_stack, matrix);
|
_cogl_matrix_stack_get (modelview_stack, matrix);
|
||||||
_COGL_MATRIX_DEBUG_PRINT (matrix);
|
_COGL_MATRIX_DEBUG_PRINT (matrix);
|
||||||
}
|
}
|
||||||
@ -877,7 +877,7 @@ void
|
|||||||
cogl_set_modelview_matrix (CoglMatrix *matrix)
|
cogl_set_modelview_matrix (CoglMatrix *matrix)
|
||||||
{
|
{
|
||||||
CoglMatrixStack *modelview_stack =
|
CoglMatrixStack *modelview_stack =
|
||||||
_cogl_framebuffer_get_modelview_stack (_cogl_get_draw_buffer ());
|
_cogl_framebuffer_get_modelview_stack (cogl_get_draw_framebuffer ());
|
||||||
_cogl_matrix_stack_set (modelview_stack, matrix);
|
_cogl_matrix_stack_set (modelview_stack, matrix);
|
||||||
_COGL_MATRIX_DEBUG_PRINT (matrix);
|
_COGL_MATRIX_DEBUG_PRINT (matrix);
|
||||||
}
|
}
|
||||||
@ -886,7 +886,7 @@ void
|
|||||||
cogl_get_projection_matrix (CoglMatrix *matrix)
|
cogl_get_projection_matrix (CoglMatrix *matrix)
|
||||||
{
|
{
|
||||||
CoglMatrixStack *projection_stack =
|
CoglMatrixStack *projection_stack =
|
||||||
_cogl_framebuffer_get_projection_stack (_cogl_get_draw_buffer ());
|
_cogl_framebuffer_get_projection_stack (cogl_get_draw_framebuffer ());
|
||||||
_cogl_matrix_stack_get (projection_stack, matrix);
|
_cogl_matrix_stack_get (projection_stack, matrix);
|
||||||
_COGL_MATRIX_DEBUG_PRINT (matrix);
|
_COGL_MATRIX_DEBUG_PRINT (matrix);
|
||||||
}
|
}
|
||||||
@ -895,7 +895,7 @@ void
|
|||||||
cogl_set_projection_matrix (CoglMatrix *matrix)
|
cogl_set_projection_matrix (CoglMatrix *matrix)
|
||||||
{
|
{
|
||||||
CoglMatrixStack *projection_stack =
|
CoglMatrixStack *projection_stack =
|
||||||
_cogl_framebuffer_get_projection_stack (_cogl_get_draw_buffer ());
|
_cogl_framebuffer_get_projection_stack (cogl_get_draw_framebuffer ());
|
||||||
_cogl_matrix_stack_set (projection_stack, matrix);
|
_cogl_matrix_stack_set (projection_stack, matrix);
|
||||||
|
|
||||||
/* FIXME: Update the inverse projection matrix!! Presumably use
|
/* FIXME: Update the inverse projection matrix!! Presumably use
|
||||||
@ -908,7 +908,7 @@ _cogl_get_clip_state (void)
|
|||||||
{
|
{
|
||||||
CoglFramebuffer *framebuffer;
|
CoglFramebuffer *framebuffer;
|
||||||
|
|
||||||
framebuffer = _cogl_get_draw_buffer ();
|
framebuffer = cogl_get_draw_framebuffer ();
|
||||||
return _cogl_framebuffer_get_clip_state (framebuffer);
|
return _cogl_framebuffer_get_clip_state (framebuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1280,8 +1280,11 @@ _cogl_driver_error_quark (void);
|
|||||||
void
|
void
|
||||||
_cogl_onscreen_clutter_backend_set_size (int width, int height);
|
_cogl_onscreen_clutter_backend_set_size (int width, int height);
|
||||||
|
|
||||||
|
#ifdef COGL_ENABLE_EXPERIMENTAL_API
|
||||||
|
#define cogl_get_draw_framebuffer cogl_get_draw_framebuffer_EXP
|
||||||
CoglFramebuffer *
|
CoglFramebuffer *
|
||||||
_cogl_get_draw_buffer (void);
|
cogl_get_draw_framebuffer (void);
|
||||||
|
#endif
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ cogl2_clip_push_from_path (CoglPath *path)
|
|||||||
CoglClipState *clip_state;
|
CoglClipState *clip_state;
|
||||||
CoglMatrix modelview_matrix;
|
CoglMatrix modelview_matrix;
|
||||||
|
|
||||||
framebuffer = _cogl_get_draw_buffer ();
|
framebuffer = cogl_get_draw_framebuffer ();
|
||||||
clip_state = _cogl_framebuffer_get_clip_state (framebuffer);
|
clip_state = _cogl_framebuffer_get_clip_state (framebuffer);
|
||||||
|
|
||||||
cogl_get_modelview_matrix (&modelview_matrix);
|
cogl_get_modelview_matrix (&modelview_matrix);
|
||||||
|
@ -360,7 +360,7 @@ _cogl_add_path_to_stencil_buffer (CoglPath *path,
|
|||||||
gboolean need_clear)
|
gboolean need_clear)
|
||||||
{
|
{
|
||||||
CoglPathData *data = path->data;
|
CoglPathData *data = path->data;
|
||||||
CoglFramebuffer *framebuffer = _cogl_get_draw_buffer ();
|
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
|
||||||
CoglMatrixStack *modelview_stack =
|
CoglMatrixStack *modelview_stack =
|
||||||
_cogl_framebuffer_get_modelview_stack (framebuffer);
|
_cogl_framebuffer_get_modelview_stack (framebuffer);
|
||||||
CoglMatrixStack *projection_stack =
|
CoglMatrixStack *projection_stack =
|
||||||
@ -484,7 +484,7 @@ cogl2_path_fill (CoglPath *path)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
framebuffer = _cogl_get_draw_buffer ();
|
framebuffer = cogl_get_draw_framebuffer ();
|
||||||
|
|
||||||
_cogl_framebuffer_flush_journal (framebuffer);
|
_cogl_framebuffer_flush_journal (framebuffer);
|
||||||
|
|
||||||
@ -492,7 +492,7 @@ cogl2_path_fill (CoglPath *path)
|
|||||||
* as the pipeline state) when flushing the clip stack, so should
|
* as the pipeline state) when flushing the clip stack, so should
|
||||||
* always be done first when preparing to draw. */
|
* always be done first when preparing to draw. */
|
||||||
_cogl_framebuffer_flush_state (framebuffer,
|
_cogl_framebuffer_flush_state (framebuffer,
|
||||||
_cogl_get_read_buffer (),
|
_cogl_get_read_framebuffer (),
|
||||||
0);
|
0);
|
||||||
|
|
||||||
_cogl_path_fill_nodes (path);
|
_cogl_path_fill_nodes (path);
|
||||||
|
Loading…
Reference in New Issue
Block a user