mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 11:32:04 +00:00
Add -Wmissing-declarations to maintainer flags and fix problems
This option to GCC makes it give a warning whenever a global function is defined without a declaration. This should catch cases were we've defined a function but forgot to put it in a header. In that case it is either only used within one file so we should make it static or we should declare it in a header. The following changes where made to fix problems: • Some functions were made static • cogl-path.h (the one containing the 1.0 API) was split into two files, one defining the functions and one defining the enums so that cogl-path.c can include the enum and function declarations from the 2.0 API as well as the function declarations from the 1.0 API. • cogl2-clip-state has been removed. This only had one experimental function called cogl_clip_push_from_path but as this is unstable we might as well remove it favour of the equivalent cogl_framebuffer_* API. • The GLX, SDL and WGL winsys's now have a private header to define their get_vtable function instead of directly declaring in the C file where it is called. • All places that were calling COGL_OBJECT_DEFINE need to have the cogl_is_whatever function declared so these have been added either as a public function or in a private header. • Some files that were not including the header containing their function declarations have been fixed to do so. • Any unused error quark functions have been removed. If we later want them we should add them back one by one and add a declaration for them in a header. • _cogl_is_framebuffer has been renamed to cogl_is_framebuffer and made a public function with a declaration in cogl-framebuffer.h • Similarly for CoglOnscreen. • cogl_vdraw_indexed_attributes is called cogl_framebuffer_vdraw_indexed_attributes in the header. The definition has been changed to match the header. • cogl_index_buffer_allocate has been removed. This had no declaration and I'm not sure what it's supposed to do. • CoglJournal has been changed to use the internal CoglObject macro so that it won't define an exported cogl_is_journal symbol. • The _cogl_blah_pointer_from_handle functions have been removed. CoglHandle isn't used much anymore anyway and in the few places where it is used I think it's safe to just use the implicit cast from void* to the right type. • The test-utils.h header for the conformance tests explicitly disables the -Wmissing-declaration option using a pragma because all of the tests declare their main function without a header. Any mistakes relating to missing declarations aren't really important for the tests. • cogl_quaternion_init_from_quaternion and init_from_matrix have been given declarations in cogl-quaternion.h Reviewed-by: Robert Bragg <robert@linux.intel.com>
This commit is contained in:
parent
f10ed2d1dc
commit
185630085c
@ -94,7 +94,7 @@ typedef struct
|
||||
float x1, y1, x2, y2;
|
||||
} CoglPangoRendererSliceCbData;
|
||||
|
||||
void
|
||||
static void
|
||||
cogl_pango_renderer_slice_cb (CoglTexture *texture,
|
||||
const float *slice_coords,
|
||||
const float *virtual_coords,
|
||||
|
@ -67,6 +67,7 @@ cogl_1_public_h = \
|
||||
$(srcdir)/cogl-offscreen.h \
|
||||
$(srcdir)/cogl-primitives.h \
|
||||
$(srcdir)/cogl-path.h \
|
||||
$(srcdir)/cogl-path-functions.h \
|
||||
$(srcdir)/cogl-shader.h \
|
||||
$(srcdir)/cogl-texture.h \
|
||||
$(srcdir)/cogl-types.h \
|
||||
@ -89,7 +90,6 @@ cogl_experimental_h = \
|
||||
$(srcdir)/cogl-pipeline-layer-state.h \
|
||||
$(srcdir)/cogl-snippet.h \
|
||||
$(srcdir)/cogl2-path.h \
|
||||
$(srcdir)/cogl2-clip-state.h \
|
||||
$(srcdir)/cogl-index-buffer.h \
|
||||
$(srcdir)/cogl-attribute-buffer.h \
|
||||
$(srcdir)/cogl-indices.h \
|
||||
@ -219,8 +219,6 @@ cogl_sources_c = \
|
||||
$(srcdir)/cogl-clip-state-private.h \
|
||||
$(srcdir)/cogl-clip-state.h \
|
||||
$(srcdir)/cogl-clip-state.c \
|
||||
$(srcdir)/cogl2-clip-state.h \
|
||||
$(srcdir)/cogl2-clip-state.c \
|
||||
$(srcdir)/cogl-feature-private.h \
|
||||
$(srcdir)/cogl-feature-private.c \
|
||||
$(srcdir)/cogl-fixed.c \
|
||||
@ -382,6 +380,7 @@ cogl_sources_c += \
|
||||
$(srcdir)/cogl-glx-renderer-private.h \
|
||||
$(srcdir)/cogl-glx-display-private.h \
|
||||
$(srcdir)/winsys/cogl-winsys-glx-feature-functions.h \
|
||||
$(srcdir)/winsys/cogl-winsys-glx-private.h \
|
||||
$(srcdir)/winsys/cogl-winsys-glx.c
|
||||
endif
|
||||
if SUPPORT_WGL
|
||||
@ -390,6 +389,7 @@ cogl_experimental_h += \
|
||||
|
||||
cogl_sources_c += \
|
||||
$(srcdir)/cogl-win32-renderer.c \
|
||||
$(srcdir)/winsys/cogl-winsys-wgl-private.h \
|
||||
$(srcdir)/winsys/cogl-winsys-wgl.c \
|
||||
$(srcdir)/winsys/cogl-winsys-wgl-feature-functions.h
|
||||
endif
|
||||
@ -435,6 +435,7 @@ cogl_sources_c += \
|
||||
endif
|
||||
if SUPPORT_SDL
|
||||
cogl_sources_c += \
|
||||
$(srcdir)/winsys/cogl-winsys-sdl-private.h \
|
||||
$(srcdir)/winsys/cogl-winsys-sdl.c
|
||||
endif
|
||||
|
||||
|
@ -74,4 +74,7 @@ void
|
||||
_cogl_atlas_texture_remove_reorganize_callback (GHookFunc callback,
|
||||
void *user_data);
|
||||
|
||||
gboolean
|
||||
_cogl_is_atlas_texture (void *object);
|
||||
|
||||
#endif /* __COGL_ATLAS_TEXTURE_H */
|
||||
|
@ -94,4 +94,7 @@ _cogl_atlas_remove_reorganize_callback (CoglAtlas *atlas,
|
||||
GHookFunc post_callback,
|
||||
void *user_data);
|
||||
|
||||
gboolean
|
||||
_cogl_is_atlas (void *object);
|
||||
|
||||
#endif /* __COGL_ATLAS_H */
|
||||
|
@ -950,6 +950,10 @@ struct _TestString
|
||||
CoglBlendStringContext context;
|
||||
};
|
||||
|
||||
/* FIXME: this should probably be moved to a unit test */
|
||||
int
|
||||
_cogl_blend_string_test (void);
|
||||
|
||||
int
|
||||
_cogl_blend_string_test (void)
|
||||
{
|
||||
|
@ -422,7 +422,7 @@ paint_primitive_silhouette (void *user_data)
|
||||
COGL_DRAW_SKIP_LEGACY_STATE);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
add_stencil_clip_primitive (CoglFramebuffer *framebuffer,
|
||||
CoglPrimitive *primitive,
|
||||
float bounds_x1,
|
||||
|
@ -38,12 +38,8 @@
|
||||
#include "cogl-journal-private.h"
|
||||
#include "cogl-util.h"
|
||||
#include "cogl-matrix-private.h"
|
||||
|
||||
#ifdef COGL_ENABLE_EXPERIMENTAL_2_0_API
|
||||
#include <cogl/cogl2-clip-state.h>
|
||||
#else
|
||||
#include <cogl/cogl-clip-state.h>
|
||||
#endif
|
||||
#include "cogl-clip-state.h"
|
||||
#include "cogl1-context.h"
|
||||
|
||||
void
|
||||
cogl_clip_push_window_rectangle (int x_offset,
|
||||
@ -92,7 +88,8 @@ void
|
||||
cogl_clip_push_from_path_preserve (void)
|
||||
{
|
||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||
cogl2_clip_push_from_path (ctx->current_path);
|
||||
cogl_framebuffer_push_path_clip (cogl_get_draw_framebuffer (),
|
||||
ctx->current_path);
|
||||
}
|
||||
|
||||
#undef cogl_clip_push_from_path
|
||||
@ -101,7 +98,7 @@ cogl_clip_push_from_path (void)
|
||||
{
|
||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||
|
||||
cogl2_clip_push_from_path (ctx->current_path);
|
||||
cogl_clip_push_from_path_preserve ();
|
||||
|
||||
cogl_object_unref (ctx->current_path);
|
||||
ctx->current_path = cogl2_path_new ();
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include "cogl-util.h"
|
||||
#include "cogl-color.h"
|
||||
#include "cogl-fixed.h"
|
||||
#include "cogl-color-private.h"
|
||||
|
||||
CoglColor *
|
||||
cogl_color_new (void)
|
||||
|
@ -29,6 +29,7 @@
|
||||
#endif
|
||||
|
||||
#include "cogl-debug.h"
|
||||
#include "cogl-config-private.h"
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
|
@ -30,6 +30,7 @@
|
||||
|
||||
#include "cogl-private.h"
|
||||
#include "cogl-debug.h"
|
||||
#include "cogl1-context.h"
|
||||
|
||||
/* XXX: If you add a debug option, please also add an option
|
||||
* definition to cogl-debug-options.h. This will enable us - for
|
||||
|
@ -42,12 +42,6 @@ static void _cogl_display_free (CoglDisplay *display);
|
||||
|
||||
COGL_OBJECT_DEFINE (Display, display);
|
||||
|
||||
GQuark
|
||||
cogl_display_error_quark (void)
|
||||
{
|
||||
return g_quark_from_static_string ("cogl-display-error-quark");
|
||||
}
|
||||
|
||||
static const CoglWinsysVtable *
|
||||
_cogl_display_get_winsys (CoglDisplay *display)
|
||||
{
|
||||
|
@ -189,6 +189,20 @@ cogl_wayland_display_set_compositor_display (CoglDisplay *display,
|
||||
struct wl_display *wayland_display);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* cogl_is_display:
|
||||
* @object: A #CoglObject pointer
|
||||
*
|
||||
* Gets whether the given object references a #CoglDisplay.
|
||||
*
|
||||
* Return value: %TRUE if the object references a #CoglDisplay
|
||||
* and %FALSE otherwise.
|
||||
* Since: 1.10
|
||||
* Stability: unstable
|
||||
*/
|
||||
gboolean
|
||||
cogl_is_display (void *object);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __COGL_DISPLAY_H__ */
|
||||
|
@ -142,7 +142,7 @@ cogl_framebuffer_error_quark (void)
|
||||
}
|
||||
|
||||
gboolean
|
||||
_cogl_is_framebuffer (void *object)
|
||||
cogl_is_framebuffer (void *object)
|
||||
{
|
||||
CoglObject *obj = object;
|
||||
|
||||
@ -1177,8 +1177,8 @@ _cogl_set_framebuffers (CoglFramebuffer *draw_buffer,
|
||||
CoglFramebuffer *current_draw_buffer;
|
||||
CoglFramebuffer *current_read_buffer;
|
||||
|
||||
_COGL_RETURN_IF_FAIL (_cogl_is_framebuffer (draw_buffer));
|
||||
_COGL_RETURN_IF_FAIL (_cogl_is_framebuffer (read_buffer));
|
||||
_COGL_RETURN_IF_FAIL (cogl_is_framebuffer (draw_buffer));
|
||||
_COGL_RETURN_IF_FAIL (cogl_is_framebuffer (read_buffer));
|
||||
|
||||
current_draw_buffer = cogl_get_draw_framebuffer ();
|
||||
current_read_buffer = _cogl_get_read_framebuffer ();
|
||||
@ -1244,8 +1244,8 @@ _cogl_push_framebuffers (CoglFramebuffer *draw_buffer,
|
||||
CoglContext *ctx;
|
||||
CoglFramebuffer *old_draw_buffer, *old_read_buffer;
|
||||
|
||||
_COGL_RETURN_IF_FAIL (_cogl_is_framebuffer (draw_buffer));
|
||||
_COGL_RETURN_IF_FAIL (_cogl_is_framebuffer (read_buffer));
|
||||
_COGL_RETURN_IF_FAIL (cogl_is_framebuffer (draw_buffer));
|
||||
_COGL_RETURN_IF_FAIL (cogl_is_framebuffer (read_buffer));
|
||||
|
||||
ctx = draw_buffer->context;
|
||||
_COGL_RETURN_IF_FAIL (ctx != NULL);
|
||||
@ -1956,7 +1956,7 @@ cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
|
||||
int height;
|
||||
|
||||
_COGL_RETURN_VAL_IF_FAIL (source == COGL_READ_PIXELS_COLOR_BUFFER, FALSE);
|
||||
_COGL_RETURN_VAL_IF_FAIL (_cogl_is_framebuffer (framebuffer), FALSE);
|
||||
_COGL_RETURN_VAL_IF_FAIL (cogl_is_framebuffer (framebuffer), FALSE);
|
||||
|
||||
ctx = cogl_framebuffer_get_context (framebuffer);
|
||||
|
||||
@ -3139,13 +3139,13 @@ cogl_framebuffer_draw_indexed_attributes (CoglFramebuffer *framebuffer,
|
||||
}
|
||||
|
||||
void
|
||||
cogl_vdraw_indexed_attributes (CoglFramebuffer *framebuffer,
|
||||
CoglPipeline *pipeline,
|
||||
CoglVerticesMode mode,
|
||||
int first_vertex,
|
||||
int n_vertices,
|
||||
CoglIndices *indices,
|
||||
...)
|
||||
cogl_framebuffer_vdraw_indexed_attributes (CoglFramebuffer *framebuffer,
|
||||
CoglPipeline *pipeline,
|
||||
CoglVerticesMode mode,
|
||||
int first_vertex,
|
||||
int n_vertices,
|
||||
CoglIndices *indices,
|
||||
...)
|
||||
{
|
||||
va_list ap;
|
||||
int n_attributes;
|
||||
|
@ -1311,6 +1311,20 @@ typedef enum { /*< prefix=COGL_FRAMEBUFFER_ERROR >*/
|
||||
COGL_FRAMEBUFFER_ERROR_ALLOCATE
|
||||
} CoglFramebufferError;
|
||||
|
||||
/**
|
||||
* cogl_is_framebuffer:
|
||||
* @object: A #CoglObject pointer
|
||||
*
|
||||
* Gets whether the given object references a #CoglFramebuffer.
|
||||
*
|
||||
* Return value: %TRUE if the object references a #CoglFramebuffer
|
||||
* and %FALSE otherwise.
|
||||
* Since: 1.10
|
||||
* Stability: unstable
|
||||
*/
|
||||
gboolean
|
||||
cogl_is_framebuffer (void *object);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __COGL_FRAMEBUFFER_H */
|
||||
|
@ -73,14 +73,6 @@ _cogl_index_buffer_free (CoglIndexBuffer *indices)
|
||||
g_slice_free (CoglIndexBuffer, indices);
|
||||
}
|
||||
|
||||
gboolean
|
||||
cogl_index_buffer_allocate (CoglIndexBuffer *indices,
|
||||
GError *error)
|
||||
{
|
||||
/* TODO */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* XXX: do we want a convenience function like this as an alternative
|
||||
* to using cogl_buffer_set_data? The advantage of this is that we can
|
||||
* track meta data such as the indices type and max_index_value for a
|
||||
|
@ -126,6 +126,20 @@ cogl_indices_set_offset (CoglIndices *indices,
|
||||
CoglIndices *
|
||||
cogl_get_rectangle_indices (CoglContext *context, int n_rectangles);
|
||||
|
||||
/**
|
||||
* cogl_is_indices:
|
||||
* @object: A #CoglObject pointer
|
||||
*
|
||||
* Gets whether the given object references a #CoglIndices.
|
||||
*
|
||||
* Return value: %TRUE if the object references a #CoglIndices
|
||||
* and %FALSE otherwise.
|
||||
* Since: 1.10
|
||||
* Stability: unstable
|
||||
*/
|
||||
gboolean
|
||||
cogl_is_indices (void *object);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __COGL_INDICES_H__ */
|
||||
|
@ -109,4 +109,7 @@ _cogl_journal_try_read_pixel (CoglJournal *journal,
|
||||
CoglBitmap *bitmap,
|
||||
gboolean *found_intersection);
|
||||
|
||||
gboolean
|
||||
_cogl_is_journal (void *object);
|
||||
|
||||
#endif /* __COGL_JOURNAL_PRIVATE_H */
|
||||
|
@ -123,7 +123,7 @@ typedef gboolean (*CoglJournalBatchTest) (CoglJournalEntry *entry0,
|
||||
|
||||
static void _cogl_journal_free (CoglJournal *journal);
|
||||
|
||||
COGL_OBJECT_DEFINE (Journal, journal);
|
||||
COGL_OBJECT_INTERNAL_DEFINE (Journal, journal);
|
||||
|
||||
static void
|
||||
_cogl_journal_free (CoglJournal *journal)
|
||||
|
@ -147,4 +147,7 @@ _cogl_matrix_stack_check_and_update_cache (CoglMatrixStack *stack,
|
||||
void
|
||||
_cogl_matrix_stack_destroy_cache (CoglMatrixStackCache *cache);
|
||||
|
||||
gboolean
|
||||
_cogl_is_matrix_stack (void *object);
|
||||
|
||||
#endif /* __COGL_MATRIX_STACK_H */
|
||||
|
@ -136,7 +136,7 @@ setup_padded_spans (CoglSpan *spans,
|
||||
* together callbacks corresponding to the same underlying slice
|
||||
* together.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
create_grid_and_repeat_cb (CoglTexture *slice_texture,
|
||||
const float *slice_texture_coords,
|
||||
const float *meta_coords,
|
||||
|
@ -182,12 +182,6 @@ _cogl_##type_name##_object_new (Cogl##TypeName *new_obj) \
|
||||
_cogl_object_##type_name##_inc (); \
|
||||
_COGL_OBJECT_DEBUG_NEW (TypeName, obj); \
|
||||
return new_obj; \
|
||||
} \
|
||||
\
|
||||
Cogl##TypeName * \
|
||||
_cogl_##type_name##_pointer_from_handle (CoglHandle handle) \
|
||||
{ \
|
||||
return handle; \
|
||||
}
|
||||
|
||||
#define COGL_OBJECT_DEFINE_WITH_CODE(TypeName, type_name, code) \
|
||||
|
@ -39,12 +39,6 @@ static void _cogl_onscreen_template_free (CoglOnscreenTemplate *onscreen_templat
|
||||
|
||||
COGL_OBJECT_DEFINE (OnscreenTemplate, onscreen_template);
|
||||
|
||||
GQuark
|
||||
cogl_onscreen_template_error_quark (void)
|
||||
{
|
||||
return g_quark_from_static_string ("cogl-onscreen-template-error-quark");
|
||||
}
|
||||
|
||||
static void
|
||||
_cogl_onscreen_template_free (CoglOnscreenTemplate *onscreen_template)
|
||||
{
|
||||
|
@ -88,6 +88,20 @@ cogl_onscreen_template_set_swap_throttled (
|
||||
CoglOnscreenTemplate *onscreen_template,
|
||||
gboolean throttled);
|
||||
|
||||
/**
|
||||
* cogl_is_onscreen_template:
|
||||
* @object: A #CoglObject pointer
|
||||
*
|
||||
* Gets whether the given object references a #CoglOnscreenTemplate.
|
||||
*
|
||||
* Return value: %TRUE if the object references a #CoglOnscreenTemplate
|
||||
* and %FALSE otherwise.
|
||||
* Since: 1.10
|
||||
* Stability: unstable
|
||||
*/
|
||||
gboolean
|
||||
cogl_is_onscreen_template (void *object);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __COGL_ONSCREEN_TEMPLATE_H__ */
|
||||
|
@ -35,9 +35,9 @@
|
||||
|
||||
static void _cogl_onscreen_free (CoglOnscreen *onscreen);
|
||||
|
||||
COGL_OBJECT_INTERNAL_DEFINE_WITH_CODE (Onscreen, onscreen,
|
||||
_cogl_onscreen_class.virt_unref =
|
||||
_cogl_framebuffer_unref);
|
||||
COGL_OBJECT_DEFINE_WITH_CODE (Onscreen, onscreen,
|
||||
_cogl_onscreen_class.virt_unref =
|
||||
_cogl_framebuffer_unref);
|
||||
|
||||
static void
|
||||
_cogl_onscreen_init_from_template (CoglOnscreen *onscreen,
|
||||
|
@ -380,6 +380,20 @@ void
|
||||
cogl_onscreen_remove_swap_buffers_callback (CoglOnscreen *onscreen,
|
||||
unsigned int id);
|
||||
|
||||
/**
|
||||
* cogl_is_onscreen:
|
||||
* @object: A #CoglObject pointer
|
||||
*
|
||||
* Gets whether the given object references a #CoglOnscreen.
|
||||
*
|
||||
* Return value: %TRUE if the object references a #CoglOnscreen
|
||||
* and %FALSE otherwise.
|
||||
* Since: 1.10
|
||||
* Stability: unstable
|
||||
*/
|
||||
gboolean
|
||||
cogl_is_onscreen (void *object);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __COGL_ONSCREEN_H */
|
||||
|
430
cogl/cogl-path-functions.h
Normal file
430
cogl/cogl-path-functions.h
Normal file
@ -0,0 +1,430 @@
|
||||
/*
|
||||
* Cogl
|
||||
*
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Copyright (C) 2008,2009,2012 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#if !defined(__COGL_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
||||
#error "Only <cogl/cogl.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#ifndef __COGL_PATH_FUNCTIONS_H__
|
||||
#define __COGL_PATH_FUNCTIONS_H__
|
||||
|
||||
/* The functions are declared separately because cogl-path.c needs to
|
||||
get the function declarations from the old 1.0 API without
|
||||
colliding with the enum declarations from the 2.0 API */
|
||||
|
||||
#include <cogl/cogl-types.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/**
|
||||
* cogl_is_path:
|
||||
* @handle: A CoglHandle
|
||||
*
|
||||
* Gets whether the given handle references an existing path object.
|
||||
*
|
||||
* Return value: %TRUE if the handle references a #CoglPath,
|
||||
* %FALSE otherwise
|
||||
*/
|
||||
gboolean
|
||||
cogl_is_path (CoglHandle handle);
|
||||
|
||||
/**
|
||||
* cogl_path_set_fill_rule:
|
||||
* @fill_rule: The new fill rule.
|
||||
*
|
||||
* Sets the fill rule of the current path to @fill_rule. This will
|
||||
* affect how the path is filled when cogl_path_fill() is later
|
||||
* called. Note that the fill rule state is attached to the path so
|
||||
* calling cogl_get_path() will preserve the fill rule and calling
|
||||
* cogl_path_new() will reset the fill rule back to the default.
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
void
|
||||
cogl_path_set_fill_rule (CoglPathFillRule fill_rule);
|
||||
|
||||
/**
|
||||
* cogl_path_get_fill_rule:
|
||||
*
|
||||
* Retrieves the fill rule set using cogl_path_set_fill_rule().
|
||||
*
|
||||
* Return value: the fill rule that is used for the current path.
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
CoglPathFillRule
|
||||
cogl_path_get_fill_rule (void);
|
||||
|
||||
/**
|
||||
* cogl_path_fill:
|
||||
*
|
||||
* Fills the interior of the constructed shape using the current
|
||||
* drawing color. The current path is then cleared. To use the path
|
||||
* again, call cogl_path_fill_preserve() instead.
|
||||
*
|
||||
* The interior of the shape is determined using the fill rule of the
|
||||
* path. See %CoglPathFillRule for details.
|
||||
**/
|
||||
void
|
||||
cogl_path_fill (void);
|
||||
|
||||
/**
|
||||
* cogl_path_fill_preserve:
|
||||
*
|
||||
* Fills the interior of the constructed shape using the current
|
||||
* drawing color and preserves the path to be used again. See
|
||||
* cogl_path_fill() for a description what is considered the interior
|
||||
* of the shape.
|
||||
*
|
||||
* Since: 1.0
|
||||
**/
|
||||
void
|
||||
cogl_path_fill_preserve (void);
|
||||
|
||||
/**
|
||||
* cogl_path_stroke:
|
||||
*
|
||||
* Strokes the constructed shape using the current drawing color and a
|
||||
* width of 1 pixel (regardless of the current transformation
|
||||
* matrix). To current path is then cleared. To use the path again,
|
||||
* call cogl_path_stroke_preserve() instead.
|
||||
**/
|
||||
void
|
||||
cogl_path_stroke (void);
|
||||
|
||||
/**
|
||||
* cogl_path_stroke_preserve:
|
||||
*
|
||||
* Strokes the constructed shape using the current drawing color and
|
||||
* preserves the path to be used again.
|
||||
*
|
||||
* Since: 1.0
|
||||
**/
|
||||
void
|
||||
cogl_path_stroke_preserve (void);
|
||||
|
||||
/**
|
||||
* cogl_path_new:
|
||||
*
|
||||
* Clears the current path and starts a new one. Creating a new path
|
||||
* also resets the fill rule to the default which is
|
||||
* %COGL_PATH_FILL_RULE_EVEN_ODD.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
void
|
||||
cogl_path_new (void);
|
||||
|
||||
/**
|
||||
* cogl_path_move_to:
|
||||
* @x: X coordinate of the pen location to move to.
|
||||
* @y: Y coordinate of the pen location to move to.
|
||||
*
|
||||
* Moves the pen to the given location. If there is an existing path
|
||||
* this will start a new disjoint subpath.
|
||||
**/
|
||||
void
|
||||
cogl_path_move_to (float x,
|
||||
float y);
|
||||
|
||||
|
||||
/**
|
||||
* cogl_path_rel_move_to:
|
||||
* @x: X offset from the current pen location to move the pen to.
|
||||
* @y: Y offset from the current pen location to move the pen to.
|
||||
*
|
||||
* Moves the pen to the given offset relative to the current pen
|
||||
* location. If there is an existing path this will start a new
|
||||
* disjoint subpath.
|
||||
**/
|
||||
void
|
||||
cogl_path_rel_move_to (float x,
|
||||
float y);
|
||||
|
||||
/**
|
||||
* cogl_path_line_to:
|
||||
* @x: X coordinate of the end line vertex
|
||||
* @y: Y coordinate of the end line vertex
|
||||
*
|
||||
* Adds a straight line segment to the current path that ends at the
|
||||
* given coordinates.
|
||||
**/
|
||||
void
|
||||
cogl_path_line_to (float x,
|
||||
float y);
|
||||
|
||||
/**
|
||||
* cogl_path_rel_line_to:
|
||||
* @x: X offset from the current pen location of the end line vertex
|
||||
* @y: Y offset from the current pen location of the end line vertex
|
||||
*
|
||||
* Adds a straight line segment to the current path that ends at the
|
||||
* given coordinates relative to the current pen location.
|
||||
**/
|
||||
void
|
||||
cogl_path_rel_line_to (float x,
|
||||
float y);
|
||||
|
||||
|
||||
/**
|
||||
* cogl_path_arc:
|
||||
* @center_x: X coordinate of the elliptical arc center
|
||||
* @center_y: Y coordinate of the elliptical arc center
|
||||
* @radius_x: X radius of the elliptical arc
|
||||
* @radius_y: Y radius of the elliptical arc
|
||||
* @angle_1: Angle in degrees at which the arc begin
|
||||
* @angle_2: Angle in degrees at which the arc ends
|
||||
*
|
||||
* Adds an elliptical arc segment to the current path. A straight line
|
||||
* segment will link the current pen location with the first vertex
|
||||
* of the arc. If you perform a move_to to the arcs start just before
|
||||
* drawing it you create a free standing arc.
|
||||
*
|
||||
* The angles are measured in degrees where 0° is in the direction of
|
||||
* the positive X axis and 90° is in the direction of the positive Y
|
||||
* axis. The angle of the arc begins at @angle_1 and heads towards
|
||||
* @angle_2 (so if @angle_2 is less than @angle_1 it will decrease,
|
||||
* otherwise it will increase).
|
||||
**/
|
||||
void
|
||||
cogl_path_arc (float center_x,
|
||||
float center_y,
|
||||
float radius_x,
|
||||
float radius_y,
|
||||
float angle_1,
|
||||
float angle_2);
|
||||
|
||||
/**
|
||||
* cogl_path_curve_to:
|
||||
* @x_1: X coordinate of the second bezier control point
|
||||
* @y_1: Y coordinate of the second bezier control point
|
||||
* @x_2: X coordinate of the third bezier control point
|
||||
* @y_2: Y coordinate of the third bezier control point
|
||||
* @x_3: X coordinate of the fourth bezier control point
|
||||
* @y_3: Y coordinate of the fourth bezier control point
|
||||
*
|
||||
* Adds a cubic bezier curve segment to the current path with the given
|
||||
* second, third and fourth control points and using current pen location
|
||||
* as the first control point.
|
||||
**/
|
||||
void
|
||||
cogl_path_curve_to (float x_1,
|
||||
float y_1,
|
||||
float x_2,
|
||||
float y_2,
|
||||
float x_3,
|
||||
float y_3);
|
||||
|
||||
/**
|
||||
* cogl_path_rel_curve_to:
|
||||
* @x_1: X coordinate of the second bezier control point
|
||||
* @y_1: Y coordinate of the second bezier control point
|
||||
* @x_2: X coordinate of the third bezier control point
|
||||
* @y_2: Y coordinate of the third bezier control point
|
||||
* @x_3: X coordinate of the fourth bezier control point
|
||||
* @y_3: Y coordinate of the fourth bezier control point
|
||||
*
|
||||
* Adds a cubic bezier curve segment to the current path with the given
|
||||
* second, third and fourth control points and using current pen location
|
||||
* as the first control point. The given coordinates are relative to the
|
||||
* current pen location.
|
||||
*/
|
||||
void
|
||||
cogl_path_rel_curve_to (float x_1,
|
||||
float y_1,
|
||||
float x_2,
|
||||
float y_2,
|
||||
float x_3,
|
||||
float y_3);
|
||||
|
||||
/**
|
||||
* cogl_path_close:
|
||||
*
|
||||
* Closes the path being constructed by adding a straight line segment
|
||||
* to it that ends at the first vertex of the path.
|
||||
**/
|
||||
void
|
||||
cogl_path_close (void);
|
||||
|
||||
/**
|
||||
* cogl_path_line:
|
||||
* @x_1: X coordinate of the start line vertex
|
||||
* @y_1: Y coordinate of the start line vertex
|
||||
* @x_2: X coordinate of the end line vertex
|
||||
* @y_2: Y coordinate of the end line vertex
|
||||
*
|
||||
* Constructs a straight line shape starting and ending at the given
|
||||
* coordinates. If there is an existing path this will start a new
|
||||
* disjoint sub-path.
|
||||
**/
|
||||
void
|
||||
cogl_path_line (float x_1,
|
||||
float y_1,
|
||||
float x_2,
|
||||
float y_2);
|
||||
|
||||
/**
|
||||
* cogl_path_polyline:
|
||||
* @coords: (in) (array) (transfer none): A pointer to the first element of an
|
||||
* array of fixed-point values that specify the vertex coordinates.
|
||||
* @num_points: The total number of vertices.
|
||||
*
|
||||
* Constructs a series of straight line segments, starting from the
|
||||
* first given vertex coordinate. If there is an existing path this
|
||||
* will start a new disjoint sub-path. Each subsequent segment starts
|
||||
* where the previous one ended and ends at the next given vertex
|
||||
* coordinate.
|
||||
*
|
||||
* The coords array must contain 2 * num_points values. The first value
|
||||
* represents the X coordinate of the first vertex, the second value
|
||||
* represents the Y coordinate of the first vertex, continuing in the same
|
||||
* fashion for the rest of the vertices. (num_points - 1) segments will
|
||||
* be constructed.
|
||||
**/
|
||||
void
|
||||
cogl_path_polyline (const float *coords,
|
||||
int num_points);
|
||||
|
||||
|
||||
/**
|
||||
* cogl_path_polygon:
|
||||
* @coords: (in) (array) (transfer none): A pointer to the first element of
|
||||
* an array of fixed-point values that specify the vertex coordinates.
|
||||
* @num_points: The total number of vertices.
|
||||
*
|
||||
* Constructs a polygonal shape of the given number of vertices. If
|
||||
* there is an existing path this will start a new disjoint sub-path.
|
||||
*
|
||||
* The coords array must contain 2 * num_points values. The first value
|
||||
* represents the X coordinate of the first vertex, the second value
|
||||
* represents the Y coordinate of the first vertex, continuing in the same
|
||||
* fashion for the rest of the vertices.
|
||||
**/
|
||||
void
|
||||
cogl_path_polygon (const float *coords,
|
||||
int num_points);
|
||||
|
||||
|
||||
/**
|
||||
* cogl_path_rectangle:
|
||||
* @x_1: X coordinate of the top-left corner.
|
||||
* @y_1: Y coordinate of the top-left corner.
|
||||
* @x_2: X coordinate of the bottom-right corner.
|
||||
* @y_2: Y coordinate of the bottom-right corner.
|
||||
*
|
||||
* Constructs a rectangular shape at the given coordinates. If there
|
||||
* is an existing path this will start a new disjoint sub-path.
|
||||
**/
|
||||
void
|
||||
cogl_path_rectangle (float x_1,
|
||||
float y_1,
|
||||
float x_2,
|
||||
float y_2);
|
||||
|
||||
/**
|
||||
* cogl_path_ellipse:
|
||||
* @center_x: X coordinate of the ellipse center
|
||||
* @center_y: Y coordinate of the ellipse center
|
||||
* @radius_x: X radius of the ellipse
|
||||
* @radius_y: Y radius of the ellipse
|
||||
*
|
||||
* Constructs an ellipse shape. If there is an existing path this will
|
||||
* start a new disjoint sub-path.
|
||||
**/
|
||||
void
|
||||
cogl_path_ellipse (float center_x,
|
||||
float center_y,
|
||||
float radius_x,
|
||||
float radius_y);
|
||||
|
||||
/**
|
||||
* cogl_path_round_rectangle:
|
||||
* @x_1: X coordinate of the top-left corner.
|
||||
* @y_1: Y coordinate of the top-left corner.
|
||||
* @x_2: X coordinate of the bottom-right corner.
|
||||
* @y_2: Y coordinate of the bottom-right corner.
|
||||
* @radius: Radius of the corner arcs.
|
||||
* @arc_step: Angle increment resolution for subdivision of
|
||||
* the corner arcs.
|
||||
*
|
||||
* Constructs a rectangular shape with rounded corners. If there is an
|
||||
* existing path this will start a new disjoint sub-path.
|
||||
**/
|
||||
void
|
||||
cogl_path_round_rectangle (float x_1,
|
||||
float y_1,
|
||||
float x_2,
|
||||
float y_2,
|
||||
float radius,
|
||||
float arc_step);
|
||||
|
||||
/**
|
||||
* cogl_get_path: (skip)
|
||||
*
|
||||
* Gets a pointer to the current path. The path can later be used
|
||||
* again by calling cogl_path_set(). Note that the path isn't copied
|
||||
* so if you later call any functions to add to the path it will
|
||||
* affect the returned object too. No reference is taken on the path
|
||||
* so if you want to retain it you should take your own reference with
|
||||
* cogl_object_ref().
|
||||
*
|
||||
* Return value: a pointer to the current path.
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
CoglPath *
|
||||
cogl_get_path (void);
|
||||
|
||||
/**
|
||||
* cogl_set_path: (skip)
|
||||
* @path: A #CoglPath object
|
||||
*
|
||||
* Replaces the current path with @path. A reference is taken on the
|
||||
* object so if you no longer need the path you should unref with
|
||||
* cogl_object_unref().
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
void
|
||||
cogl_set_path (CoglPath *path);
|
||||
|
||||
/**
|
||||
* cogl_path_copy: (skip)
|
||||
* @path: A #CoglPath object
|
||||
*
|
||||
* Returns a new copy of the path in @path. The new path has a
|
||||
* reference count of 1 so you should unref it with
|
||||
* cogl_object_unref() if you no longer need it.
|
||||
*
|
||||
* Internally the path will share the data until one of the paths is
|
||||
* modified so copying paths should be relatively cheap.
|
||||
*
|
||||
* Return value: (transfer full): a copy of the path in @path.
|
||||
*/
|
||||
CoglPath *
|
||||
cogl_path_copy (CoglPath *path);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __COGL_PATH_FUNCTIONS_H__ */
|
||||
|
@ -36,6 +36,29 @@
|
||||
#include <math.h>
|
||||
|
||||
#undef cogl_path_set_fill_rule
|
||||
#undef cogl_path_get_fill_rule
|
||||
#undef cogl_path_fill
|
||||
#undef cogl_path_fill_preserve
|
||||
#undef cogl_path_stroke
|
||||
#undef cogl_path_stroke_preserve
|
||||
#undef cogl_path_move_to
|
||||
#undef cogl_path_rel_move_to
|
||||
#undef cogl_path_line_to
|
||||
#undef cogl_path_rel_line_to
|
||||
#undef cogl_path_close
|
||||
#undef cogl_path_new
|
||||
#undef cogl_path_line
|
||||
#undef cogl_path_polyline
|
||||
#undef cogl_path_polygon
|
||||
#undef cogl_path_rectangle
|
||||
#undef cogl_path_arc
|
||||
#undef cogl_path_ellipse
|
||||
#undef cogl_path_round_rectangle
|
||||
#undef cogl_path_curve_to
|
||||
#undef cogl_path_rel_curve_to
|
||||
|
||||
#include "cogl-path-functions.h"
|
||||
|
||||
void
|
||||
cogl_path_set_fill_rule (CoglPathFillRule fill_rule)
|
||||
{
|
||||
@ -44,7 +67,6 @@ cogl_path_set_fill_rule (CoglPathFillRule fill_rule)
|
||||
cogl2_path_set_fill_rule (ctx->current_path, fill_rule);
|
||||
}
|
||||
|
||||
#undef cogl_path_get_fill_rule
|
||||
CoglPathFillRule
|
||||
cogl_path_get_fill_rule (void)
|
||||
{
|
||||
@ -53,7 +75,6 @@ cogl_path_get_fill_rule (void)
|
||||
return cogl2_path_get_fill_rule (ctx->current_path);
|
||||
}
|
||||
|
||||
#undef cogl_path_fill
|
||||
void
|
||||
cogl_path_fill (void)
|
||||
{
|
||||
@ -65,7 +86,6 @@ cogl_path_fill (void)
|
||||
ctx->current_path = cogl2_path_new ();
|
||||
}
|
||||
|
||||
#undef cogl_path_fill_preserve
|
||||
void
|
||||
cogl_path_fill_preserve (void)
|
||||
{
|
||||
@ -74,7 +94,6 @@ cogl_path_fill_preserve (void)
|
||||
cogl2_path_fill (ctx->current_path);
|
||||
}
|
||||
|
||||
#undef cogl_path_stroke
|
||||
void
|
||||
cogl_path_stroke (void)
|
||||
{
|
||||
@ -86,7 +105,6 @@ cogl_path_stroke (void)
|
||||
ctx->current_path = cogl2_path_new ();
|
||||
}
|
||||
|
||||
#undef cogl_path_stroke_preserve
|
||||
void
|
||||
cogl_path_stroke_preserve (void)
|
||||
{
|
||||
@ -95,7 +113,6 @@ cogl_path_stroke_preserve (void)
|
||||
cogl2_path_stroke (ctx->current_path);
|
||||
}
|
||||
|
||||
#undef cogl_path_move_to
|
||||
void
|
||||
cogl_path_move_to (float x,
|
||||
float y)
|
||||
@ -105,7 +122,6 @@ cogl_path_move_to (float x,
|
||||
cogl2_path_move_to (ctx->current_path, x, y);
|
||||
}
|
||||
|
||||
#undef cogl_path_rel_move_to
|
||||
void
|
||||
cogl_path_rel_move_to (float x,
|
||||
float y)
|
||||
@ -115,7 +131,6 @@ cogl_path_rel_move_to (float x,
|
||||
cogl2_path_rel_move_to (ctx->current_path, x, y);
|
||||
}
|
||||
|
||||
#undef cogl_path_line_to
|
||||
void
|
||||
cogl_path_line_to (float x,
|
||||
float y)
|
||||
@ -125,7 +140,6 @@ cogl_path_line_to (float x,
|
||||
cogl2_path_line_to (ctx->current_path, x, y);
|
||||
}
|
||||
|
||||
#undef cogl_path_rel_line_to
|
||||
void
|
||||
cogl_path_rel_line_to (float x,
|
||||
float y)
|
||||
@ -135,7 +149,6 @@ cogl_path_rel_line_to (float x,
|
||||
cogl2_path_rel_line_to (ctx->current_path, x, y);
|
||||
}
|
||||
|
||||
#undef cogl_path_close
|
||||
void
|
||||
cogl_path_close (void)
|
||||
{
|
||||
@ -144,7 +157,6 @@ cogl_path_close (void)
|
||||
cogl2_path_close (ctx->current_path);
|
||||
}
|
||||
|
||||
#undef cogl_path_new
|
||||
void
|
||||
cogl_path_new (void)
|
||||
{
|
||||
@ -154,7 +166,6 @@ cogl_path_new (void)
|
||||
ctx->current_path = cogl2_path_new ();
|
||||
}
|
||||
|
||||
#undef cogl_path_line
|
||||
void
|
||||
cogl_path_line (float x_1,
|
||||
float y_1,
|
||||
@ -166,7 +177,6 @@ cogl_path_line (float x_1,
|
||||
cogl2_path_line (ctx->current_path, x_1, y_1, x_2, y_2);
|
||||
}
|
||||
|
||||
#undef cogl_path_polyline
|
||||
void
|
||||
cogl_path_polyline (const float *coords,
|
||||
int num_points)
|
||||
@ -176,7 +186,6 @@ cogl_path_polyline (const float *coords,
|
||||
cogl2_path_polyline (ctx->current_path, coords, num_points);
|
||||
}
|
||||
|
||||
#undef cogl_path_polygon
|
||||
void
|
||||
cogl_path_polygon (const float *coords,
|
||||
int num_points)
|
||||
@ -186,7 +195,6 @@ cogl_path_polygon (const float *coords,
|
||||
cogl2_path_polygon (ctx->current_path, coords, num_points);
|
||||
}
|
||||
|
||||
#undef cogl_path_rectangle
|
||||
void
|
||||
cogl_path_rectangle (float x_1,
|
||||
float y_1,
|
||||
@ -198,7 +206,6 @@ cogl_path_rectangle (float x_1,
|
||||
cogl2_path_rectangle (ctx->current_path, x_1, y_1, x_2, y_2);
|
||||
}
|
||||
|
||||
#undef cogl_path_arc
|
||||
void
|
||||
cogl_path_arc (float center_x,
|
||||
float center_y,
|
||||
@ -218,7 +225,6 @@ cogl_path_arc (float center_x,
|
||||
angle_2);
|
||||
}
|
||||
|
||||
#undef cogl_path_ellipse
|
||||
void
|
||||
cogl_path_ellipse (float center_x,
|
||||
float center_y,
|
||||
@ -234,7 +240,6 @@ cogl_path_ellipse (float center_x,
|
||||
radius_y);
|
||||
}
|
||||
|
||||
#undef cogl_path_round_rectangle
|
||||
void
|
||||
cogl_path_round_rectangle (float x_1,
|
||||
float y_1,
|
||||
@ -249,7 +254,6 @@ cogl_path_round_rectangle (float x_1,
|
||||
x_1, y_1, x_2, y_2, radius, arc_step);
|
||||
}
|
||||
|
||||
#undef cogl_path_curve_to
|
||||
void
|
||||
cogl_path_curve_to (float x_1,
|
||||
float y_1,
|
||||
@ -264,7 +268,6 @@ cogl_path_curve_to (float x_1,
|
||||
x_1, y_2, x_2, y_2, x_3, y_3);
|
||||
}
|
||||
|
||||
#undef cogl_path_rel_curve_to
|
||||
void
|
||||
cogl_path_rel_curve_to (float x_1,
|
||||
float y_1,
|
||||
|
390
cogl/cogl-path.h
390
cogl/cogl-path.h
@ -97,395 +97,9 @@ typedef enum {
|
||||
COGL_PATH_FILL_RULE_EVEN_ODD
|
||||
} CoglPathFillRule;
|
||||
|
||||
/**
|
||||
* cogl_is_path:
|
||||
* @handle: A CoglHandle
|
||||
*
|
||||
* Gets whether the given handle references an existing path object.
|
||||
*
|
||||
* Return value: %TRUE if the handle references a #CoglPath,
|
||||
* %FALSE otherwise
|
||||
*/
|
||||
gboolean
|
||||
cogl_is_path (CoglHandle handle);
|
||||
|
||||
/**
|
||||
* cogl_path_set_fill_rule:
|
||||
* @fill_rule: The new fill rule.
|
||||
*
|
||||
* Sets the fill rule of the current path to @fill_rule. This will
|
||||
* affect how the path is filled when cogl_path_fill() is later
|
||||
* called. Note that the fill rule state is attached to the path so
|
||||
* calling cogl_get_path() will preserve the fill rule and calling
|
||||
* cogl_path_new() will reset the fill rule back to the default.
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
void
|
||||
cogl_path_set_fill_rule (CoglPathFillRule fill_rule);
|
||||
|
||||
/**
|
||||
* cogl_path_get_fill_rule:
|
||||
*
|
||||
* Retrieves the fill rule set using cogl_path_set_fill_rule().
|
||||
*
|
||||
* Return value: the fill rule that is used for the current path.
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
CoglPathFillRule
|
||||
cogl_path_get_fill_rule (void);
|
||||
|
||||
/**
|
||||
* cogl_path_fill:
|
||||
*
|
||||
* Fills the interior of the constructed shape using the current
|
||||
* drawing color. The current path is then cleared. To use the path
|
||||
* again, call cogl_path_fill_preserve() instead.
|
||||
*
|
||||
* The interior of the shape is determined using the fill rule of the
|
||||
* path. See %CoglPathFillRule for details.
|
||||
**/
|
||||
void
|
||||
cogl_path_fill (void);
|
||||
|
||||
/**
|
||||
* cogl_path_fill_preserve:
|
||||
*
|
||||
* Fills the interior of the constructed shape using the current
|
||||
* drawing color and preserves the path to be used again. See
|
||||
* cogl_path_fill() for a description what is considered the interior
|
||||
* of the shape.
|
||||
*
|
||||
* Since: 1.0
|
||||
**/
|
||||
void
|
||||
cogl_path_fill_preserve (void);
|
||||
|
||||
/**
|
||||
* cogl_path_stroke:
|
||||
*
|
||||
* Strokes the constructed shape using the current drawing color and a
|
||||
* width of 1 pixel (regardless of the current transformation
|
||||
* matrix). To current path is then cleared. To use the path again,
|
||||
* call cogl_path_stroke_preserve() instead.
|
||||
**/
|
||||
void
|
||||
cogl_path_stroke (void);
|
||||
|
||||
/**
|
||||
* cogl_path_stroke_preserve:
|
||||
*
|
||||
* Strokes the constructed shape using the current drawing color and
|
||||
* preserves the path to be used again.
|
||||
*
|
||||
* Since: 1.0
|
||||
**/
|
||||
void
|
||||
cogl_path_stroke_preserve (void);
|
||||
|
||||
/**
|
||||
* cogl_path_new:
|
||||
*
|
||||
* Clears the current path and starts a new one. Creating a new path
|
||||
* also resets the fill rule to the default which is
|
||||
* %COGL_PATH_FILL_RULE_EVEN_ODD.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
void
|
||||
cogl_path_new (void);
|
||||
|
||||
/**
|
||||
* cogl_path_move_to:
|
||||
* @x: X coordinate of the pen location to move to.
|
||||
* @y: Y coordinate of the pen location to move to.
|
||||
*
|
||||
* Moves the pen to the given location. If there is an existing path
|
||||
* this will start a new disjoint subpath.
|
||||
**/
|
||||
void
|
||||
cogl_path_move_to (float x,
|
||||
float y);
|
||||
|
||||
|
||||
/**
|
||||
* cogl_path_rel_move_to:
|
||||
* @x: X offset from the current pen location to move the pen to.
|
||||
* @y: Y offset from the current pen location to move the pen to.
|
||||
*
|
||||
* Moves the pen to the given offset relative to the current pen
|
||||
* location. If there is an existing path this will start a new
|
||||
* disjoint subpath.
|
||||
**/
|
||||
void
|
||||
cogl_path_rel_move_to (float x,
|
||||
float y);
|
||||
|
||||
/**
|
||||
* cogl_path_line_to:
|
||||
* @x: X coordinate of the end line vertex
|
||||
* @y: Y coordinate of the end line vertex
|
||||
*
|
||||
* Adds a straight line segment to the current path that ends at the
|
||||
* given coordinates.
|
||||
**/
|
||||
void
|
||||
cogl_path_line_to (float x,
|
||||
float y);
|
||||
|
||||
/**
|
||||
* cogl_path_rel_line_to:
|
||||
* @x: X offset from the current pen location of the end line vertex
|
||||
* @y: Y offset from the current pen location of the end line vertex
|
||||
*
|
||||
* Adds a straight line segment to the current path that ends at the
|
||||
* given coordinates relative to the current pen location.
|
||||
**/
|
||||
void
|
||||
cogl_path_rel_line_to (float x,
|
||||
float y);
|
||||
|
||||
|
||||
/**
|
||||
* cogl_path_arc:
|
||||
* @center_x: X coordinate of the elliptical arc center
|
||||
* @center_y: Y coordinate of the elliptical arc center
|
||||
* @radius_x: X radius of the elliptical arc
|
||||
* @radius_y: Y radius of the elliptical arc
|
||||
* @angle_1: Angle in degrees at which the arc begin
|
||||
* @angle_2: Angle in degrees at which the arc ends
|
||||
*
|
||||
* Adds an elliptical arc segment to the current path. A straight line
|
||||
* segment will link the current pen location with the first vertex
|
||||
* of the arc. If you perform a move_to to the arcs start just before
|
||||
* drawing it you create a free standing arc.
|
||||
*
|
||||
* The angles are measured in degrees where 0° is in the direction of
|
||||
* the positive X axis and 90° is in the direction of the positive Y
|
||||
* axis. The angle of the arc begins at @angle_1 and heads towards
|
||||
* @angle_2 (so if @angle_2 is less than @angle_1 it will decrease,
|
||||
* otherwise it will increase).
|
||||
**/
|
||||
void
|
||||
cogl_path_arc (float center_x,
|
||||
float center_y,
|
||||
float radius_x,
|
||||
float radius_y,
|
||||
float angle_1,
|
||||
float angle_2);
|
||||
|
||||
/**
|
||||
* cogl_path_curve_to:
|
||||
* @x_1: X coordinate of the second bezier control point
|
||||
* @y_1: Y coordinate of the second bezier control point
|
||||
* @x_2: X coordinate of the third bezier control point
|
||||
* @y_2: Y coordinate of the third bezier control point
|
||||
* @x_3: X coordinate of the fourth bezier control point
|
||||
* @y_3: Y coordinate of the fourth bezier control point
|
||||
*
|
||||
* Adds a cubic bezier curve segment to the current path with the given
|
||||
* second, third and fourth control points and using current pen location
|
||||
* as the first control point.
|
||||
**/
|
||||
void
|
||||
cogl_path_curve_to (float x_1,
|
||||
float y_1,
|
||||
float x_2,
|
||||
float y_2,
|
||||
float x_3,
|
||||
float y_3);
|
||||
|
||||
/**
|
||||
* cogl_path_rel_curve_to:
|
||||
* @x_1: X coordinate of the second bezier control point
|
||||
* @y_1: Y coordinate of the second bezier control point
|
||||
* @x_2: X coordinate of the third bezier control point
|
||||
* @y_2: Y coordinate of the third bezier control point
|
||||
* @x_3: X coordinate of the fourth bezier control point
|
||||
* @y_3: Y coordinate of the fourth bezier control point
|
||||
*
|
||||
* Adds a cubic bezier curve segment to the current path with the given
|
||||
* second, third and fourth control points and using current pen location
|
||||
* as the first control point. The given coordinates are relative to the
|
||||
* current pen location.
|
||||
*/
|
||||
void
|
||||
cogl_path_rel_curve_to (float x_1,
|
||||
float y_1,
|
||||
float x_2,
|
||||
float y_2,
|
||||
float x_3,
|
||||
float y_3);
|
||||
|
||||
/**
|
||||
* cogl_path_close:
|
||||
*
|
||||
* Closes the path being constructed by adding a straight line segment
|
||||
* to it that ends at the first vertex of the path.
|
||||
**/
|
||||
void
|
||||
cogl_path_close (void);
|
||||
|
||||
/**
|
||||
* cogl_path_line:
|
||||
* @x_1: X coordinate of the start line vertex
|
||||
* @y_1: Y coordinate of the start line vertex
|
||||
* @x_2: X coordinate of the end line vertex
|
||||
* @y_2: Y coordinate of the end line vertex
|
||||
*
|
||||
* Constructs a straight line shape starting and ending at the given
|
||||
* coordinates. If there is an existing path this will start a new
|
||||
* disjoint sub-path.
|
||||
**/
|
||||
void
|
||||
cogl_path_line (float x_1,
|
||||
float y_1,
|
||||
float x_2,
|
||||
float y_2);
|
||||
|
||||
/**
|
||||
* cogl_path_polyline:
|
||||
* @coords: (in) (array) (transfer none): A pointer to the first element of an
|
||||
* array of fixed-point values that specify the vertex coordinates.
|
||||
* @num_points: The total number of vertices.
|
||||
*
|
||||
* Constructs a series of straight line segments, starting from the
|
||||
* first given vertex coordinate. If there is an existing path this
|
||||
* will start a new disjoint sub-path. Each subsequent segment starts
|
||||
* where the previous one ended and ends at the next given vertex
|
||||
* coordinate.
|
||||
*
|
||||
* The coords array must contain 2 * num_points values. The first value
|
||||
* represents the X coordinate of the first vertex, the second value
|
||||
* represents the Y coordinate of the first vertex, continuing in the same
|
||||
* fashion for the rest of the vertices. (num_points - 1) segments will
|
||||
* be constructed.
|
||||
**/
|
||||
void
|
||||
cogl_path_polyline (const float *coords,
|
||||
int num_points);
|
||||
|
||||
|
||||
/**
|
||||
* cogl_path_polygon:
|
||||
* @coords: (in) (array) (transfer none): A pointer to the first element of
|
||||
* an array of fixed-point values that specify the vertex coordinates.
|
||||
* @num_points: The total number of vertices.
|
||||
*
|
||||
* Constructs a polygonal shape of the given number of vertices. If
|
||||
* there is an existing path this will start a new disjoint sub-path.
|
||||
*
|
||||
* The coords array must contain 2 * num_points values. The first value
|
||||
* represents the X coordinate of the first vertex, the second value
|
||||
* represents the Y coordinate of the first vertex, continuing in the same
|
||||
* fashion for the rest of the vertices.
|
||||
**/
|
||||
void
|
||||
cogl_path_polygon (const float *coords,
|
||||
int num_points);
|
||||
|
||||
|
||||
/**
|
||||
* cogl_path_rectangle:
|
||||
* @x_1: X coordinate of the top-left corner.
|
||||
* @y_1: Y coordinate of the top-left corner.
|
||||
* @x_2: X coordinate of the bottom-right corner.
|
||||
* @y_2: Y coordinate of the bottom-right corner.
|
||||
*
|
||||
* Constructs a rectangular shape at the given coordinates. If there
|
||||
* is an existing path this will start a new disjoint sub-path.
|
||||
**/
|
||||
void
|
||||
cogl_path_rectangle (float x_1,
|
||||
float y_1,
|
||||
float x_2,
|
||||
float y_2);
|
||||
|
||||
/**
|
||||
* cogl_path_ellipse:
|
||||
* @center_x: X coordinate of the ellipse center
|
||||
* @center_y: Y coordinate of the ellipse center
|
||||
* @radius_x: X radius of the ellipse
|
||||
* @radius_y: Y radius of the ellipse
|
||||
*
|
||||
* Constructs an ellipse shape. If there is an existing path this will
|
||||
* start a new disjoint sub-path.
|
||||
**/
|
||||
void
|
||||
cogl_path_ellipse (float center_x,
|
||||
float center_y,
|
||||
float radius_x,
|
||||
float radius_y);
|
||||
|
||||
/**
|
||||
* cogl_path_round_rectangle:
|
||||
* @x_1: X coordinate of the top-left corner.
|
||||
* @y_1: Y coordinate of the top-left corner.
|
||||
* @x_2: X coordinate of the bottom-right corner.
|
||||
* @y_2: Y coordinate of the bottom-right corner.
|
||||
* @radius: Radius of the corner arcs.
|
||||
* @arc_step: Angle increment resolution for subdivision of
|
||||
* the corner arcs.
|
||||
*
|
||||
* Constructs a rectangular shape with rounded corners. If there is an
|
||||
* existing path this will start a new disjoint sub-path.
|
||||
**/
|
||||
void
|
||||
cogl_path_round_rectangle (float x_1,
|
||||
float y_1,
|
||||
float x_2,
|
||||
float y_2,
|
||||
float radius,
|
||||
float arc_step);
|
||||
|
||||
/**
|
||||
* cogl_get_path: (skip)
|
||||
*
|
||||
* Gets a pointer to the current path. The path can later be used
|
||||
* again by calling cogl_path_set(). Note that the path isn't copied
|
||||
* so if you later call any functions to add to the path it will
|
||||
* affect the returned object too. No reference is taken on the path
|
||||
* so if you want to retain it you should take your own reference with
|
||||
* cogl_object_ref().
|
||||
*
|
||||
* Return value: a pointer to the current path.
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
CoglPath *
|
||||
cogl_get_path (void);
|
||||
|
||||
/**
|
||||
* cogl_set_path: (skip)
|
||||
* @path: A #CoglPath object
|
||||
*
|
||||
* Replaces the current path with @path. A reference is taken on the
|
||||
* object so if you no longer need the path you should unref with
|
||||
* cogl_object_unref().
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
void
|
||||
cogl_set_path (CoglPath *path);
|
||||
|
||||
/**
|
||||
* cogl_path_copy: (skip)
|
||||
* @path: A #CoglPath object
|
||||
*
|
||||
* Returns a new copy of the path in @path. The new path has a
|
||||
* reference count of 1 so you should unref it with
|
||||
* cogl_object_unref() if you no longer need it.
|
||||
*
|
||||
* Internally the path will share the data until one of the paths is
|
||||
* modified so copying paths should be relatively cheap.
|
||||
*
|
||||
* Return value: (transfer full): a copy of the path in @path.
|
||||
*/
|
||||
CoglPath *
|
||||
cogl_path_copy (CoglPath *path);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#include "cogl-path-functions.h"
|
||||
|
||||
#endif /* __COGL_PATH_H__ */
|
||||
|
||||
|
@ -244,6 +244,12 @@ dump_pipeline_cb (CoglNode *node, void *user_data)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* This function is just here to be called from GDB so we don't really
|
||||
want to put a declaration in a header and we just add it here to
|
||||
avoid a warning */
|
||||
void
|
||||
_cogl_debug_dump_pipelines_dot_file (const char *filename);
|
||||
|
||||
void
|
||||
_cogl_debug_dump_pipelines_dot_file (const char *filename)
|
||||
{
|
||||
|
@ -792,7 +792,7 @@ _cogl_pipeline_fragend_arbfp_add_layer (CoglPipeline *pipeline,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
static gboolean
|
||||
_cogl_pipeline_fragend_arbfp_passthrough (CoglPipeline *pipeline)
|
||||
{
|
||||
CoglPipelineShaderState *shader_state = get_shader_state (pipeline);
|
||||
|
@ -47,6 +47,7 @@
|
||||
#include "cogl-shader-private.h"
|
||||
#include "cogl-program-private.h"
|
||||
#include "cogl-pipeline-cache.h"
|
||||
#include "cogl-pipeline-fragend-glsl-private.h"
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
@ -998,7 +999,7 @@ add_alpha_test_snippet (CoglPipeline *pipeline,
|
||||
|
||||
#endif /* HAVE_COGL_GLES2 */
|
||||
|
||||
gboolean
|
||||
static gboolean
|
||||
_cogl_pipeline_fragend_glsl_end (CoglPipeline *pipeline,
|
||||
unsigned long pipelines_difference)
|
||||
{
|
||||
|
@ -36,6 +36,7 @@
|
||||
#include "cogl-matrix.h"
|
||||
#include "cogl-snippet-private.h"
|
||||
#include "cogl-texture-private.h"
|
||||
#include "cogl-pipeline-layer-state-private.h"
|
||||
|
||||
#include "string.h"
|
||||
#if 0
|
||||
@ -361,7 +362,7 @@ cogl_pipeline_set_layer_null_texture (CoglPipeline *pipeline,
|
||||
_cogl_pipeline_set_layer_texture_data (pipeline, layer_index, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
_cogl_pipeline_set_layer_wrap_modes (CoglPipeline *pipeline,
|
||||
CoglPipelineLayer *layer,
|
||||
CoglPipelineLayer *authority,
|
||||
|
@ -49,6 +49,7 @@
|
||||
#include "cogl-pipeline-state-private.h"
|
||||
#include "cogl-attribute-private.h"
|
||||
#include "cogl-framebuffer-private.h"
|
||||
#include "cogl-pipeline-progend-glsl-private.h"
|
||||
|
||||
#ifdef HAVE_COGL_GLES2
|
||||
|
||||
|
@ -451,7 +451,7 @@ _cogl_pipeline_get_blend_enabled (CoglPipeline *pipeline)
|
||||
return authority->blend_enable;
|
||||
}
|
||||
|
||||
gboolean
|
||||
static gboolean
|
||||
_cogl_pipeline_blend_enable_equal (CoglPipeline *authority0,
|
||||
CoglPipeline *authority1)
|
||||
{
|
||||
@ -844,7 +844,7 @@ cogl_pipeline_get_alpha_test_reference (CoglPipeline *pipeline)
|
||||
return authority->big_state->alpha_state.alpha_func_reference;
|
||||
}
|
||||
|
||||
GLenum
|
||||
static GLenum
|
||||
arg_to_gl_blend_factor (CoglBlendStringArgument *arg)
|
||||
{
|
||||
if (arg->source.is_zero)
|
||||
@ -914,7 +914,7 @@ arg_to_gl_blend_factor (CoglBlendStringArgument *arg)
|
||||
return GL_ONE;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
setup_blend_state (CoglBlendStringStatement *statement,
|
||||
GLenum *blend_equation,
|
||||
GLint *blend_src_factor,
|
||||
|
@ -88,12 +88,6 @@ _cogl_pipeline_progends[MAX (COGL_PIPELINE_N_PROGENDS, 1)];
|
||||
|
||||
COGL_OBJECT_DEFINE (Pipeline, pipeline);
|
||||
|
||||
GQuark
|
||||
_cogl_pipeline_error_quark (void)
|
||||
{
|
||||
return g_quark_from_static_string ("cogl-pipeline-error-quark");
|
||||
}
|
||||
|
||||
/*
|
||||
* This initializes the first pipeline owned by the Cogl context. All
|
||||
* subsequently instantiated pipelines created via the cogl_pipeline_new()
|
||||
|
@ -39,6 +39,7 @@
|
||||
#endif
|
||||
|
||||
#include "cogl-util.h"
|
||||
#include "cogl-point-in-poly-private.h"
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
|
@ -39,6 +39,7 @@
|
||||
#include "cogl-meta-texture.h"
|
||||
#include "cogl-framebuffer-private.h"
|
||||
#include "cogl1-context.h"
|
||||
#include "cogl-primitives-private.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
@ -899,7 +900,7 @@ typedef struct _AppendTexCoordsState
|
||||
float *vertices_out;
|
||||
} AppendTexCoordsState;
|
||||
|
||||
gboolean
|
||||
static gboolean
|
||||
append_tex_coord_attributes_cb (CoglPipeline *pipeline,
|
||||
int layer_index,
|
||||
void *user_data)
|
||||
|
@ -58,8 +58,6 @@ struct _CoglProgramUniform
|
||||
unsigned int dirty : 1;
|
||||
};
|
||||
|
||||
CoglProgram *_cogl_program_pointer_from_handle (CoglHandle handle);
|
||||
|
||||
/* Internal function to flush the custom uniforms for the given use
|
||||
program. This assumes the target GL program is already bound. The
|
||||
gl_program still needs to be passed so that CoglProgram can query
|
||||
|
@ -102,8 +102,8 @@ cogl_program_attach_shader (CoglHandle program_handle,
|
||||
if (!cogl_is_program (program_handle) || !cogl_is_shader (shader_handle))
|
||||
return;
|
||||
|
||||
program = _cogl_program_pointer_from_handle (program_handle);
|
||||
shader = _cogl_shader_pointer_from_handle (shader_handle);
|
||||
program = program_handle;
|
||||
shader = shader_handle;
|
||||
|
||||
/* Only one shader is allowed if the type is ARBfp */
|
||||
if (shader->language == COGL_SHADER_LANGUAGE_ARBFP)
|
||||
@ -158,7 +158,7 @@ cogl_program_get_uniform_location (CoglHandle handle,
|
||||
if (!cogl_is_program (handle))
|
||||
return -1;
|
||||
|
||||
program = _cogl_program_pointer_from_handle (handle);
|
||||
program = handle;
|
||||
|
||||
/* We can't just ask the GL program object for the uniform location
|
||||
directly because it will change every time the program is linked
|
||||
|
@ -60,6 +60,12 @@ static CoglQuaternion identity_quaternion =
|
||||
1.0, 0.0, 0.0, 0.0,
|
||||
};
|
||||
|
||||
/* This function is just here to be called from GDB so we don't really
|
||||
want to put a declaration in a header and we just add it here to
|
||||
avoid a warning */
|
||||
void
|
||||
_cogl_quaternion_print (CoglQuaternion *quarternion);
|
||||
|
||||
void
|
||||
_cogl_quaternion_print (CoglQuaternion *quaternion)
|
||||
{
|
||||
@ -240,15 +246,6 @@ cogl_quaternion_init_from_quaternion (CoglQuaternion *quaternion,
|
||||
#define COGL_MATRIX_READ(MATRIX, ROW, COLUMN) \
|
||||
(((const float *)matrix)[COLUMN * 4 + ROW])
|
||||
|
||||
/**
|
||||
* cogl_quaternion_init_from_matrix:
|
||||
* @quaternion: A Cogl Quaternion
|
||||
* @matrix: A rotation matrix with which to initialize the quaternion
|
||||
*
|
||||
* Initializes a quaternion from a rotation matrix.
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
void
|
||||
cogl_quaternion_init_from_matrix (CoglQuaternion *quaternion,
|
||||
const CoglMatrix *matrix)
|
||||
|
@ -251,6 +251,24 @@ void
|
||||
cogl_quaternion_init_from_euler (CoglQuaternion *quaternion,
|
||||
const CoglEuler *euler);
|
||||
|
||||
void
|
||||
cogl_quaternion_init_from_quaternion (CoglQuaternion *quaternion,
|
||||
CoglQuaternion *src);
|
||||
|
||||
/**
|
||||
* cogl_quaternion_init_from_matrix:
|
||||
* @quaternion: A Cogl Quaternion
|
||||
* @matrix: A rotation matrix with which to initialize the quaternion
|
||||
*
|
||||
* Initializes a quaternion from a rotation matrix.
|
||||
*
|
||||
* Since: 1.10
|
||||
* Stability: unstable
|
||||
*/
|
||||
void
|
||||
cogl_quaternion_init_from_matrix (CoglQuaternion *quaternion,
|
||||
const CoglMatrix *matrix);
|
||||
|
||||
/**
|
||||
* cogl_quaternion_equal:
|
||||
* @v1: A #CoglQuaternion
|
||||
|
@ -62,21 +62,20 @@
|
||||
#ifdef COGL_HAS_EGL_PLATFORM_POWERVR_NULL_SUPPORT
|
||||
#include "cogl-winsys-egl-null-private.h"
|
||||
#endif
|
||||
#ifdef COGL_HAS_GLX_SUPPORT
|
||||
#include "cogl-winsys-glx-private.h"
|
||||
#endif
|
||||
#ifdef COGL_HAS_WGL_SUPPORT
|
||||
#include "cogl-winsys-wgl-private.h"
|
||||
#endif
|
||||
#ifdef COGL_HAS_SDL_SUPPORT
|
||||
#include "cogl-winsys-sdl-private.h"
|
||||
#endif
|
||||
|
||||
#if COGL_HAS_XLIB_SUPPORT
|
||||
#include "cogl-xlib-renderer.h"
|
||||
#endif
|
||||
|
||||
#ifdef COGL_HAS_GLX_SUPPORT
|
||||
extern const CoglWinsysVtable *_cogl_winsys_glx_get_vtable (void);
|
||||
#endif
|
||||
#ifdef COGL_HAS_WGL_SUPPORT
|
||||
extern const CoglWinsysVtable *_cogl_winsys_wgl_get_vtable (void);
|
||||
#endif
|
||||
#ifdef COGL_HAS_SDL_SUPPORT
|
||||
extern const CoglWinsysVtable *_cogl_winsys_sdl_get_vtable (void);
|
||||
#endif
|
||||
|
||||
typedef const CoglWinsysVtable *(*CoglWinsysVtableGetter) (void);
|
||||
|
||||
static CoglWinsysVtableGetter _cogl_winsys_vtable_getters[] =
|
||||
|
@ -45,8 +45,6 @@ struct _CoglShader
|
||||
char *source;
|
||||
};
|
||||
|
||||
CoglShader *_cogl_shader_pointer_from_handle (CoglHandle handle);
|
||||
|
||||
void
|
||||
_cogl_shader_compile_real (CoglHandle handle, int n_tex_coord_attribs);
|
||||
|
||||
|
@ -130,7 +130,7 @@ cogl_shader_source (CoglHandle handle,
|
||||
if (!cogl_is_shader (handle))
|
||||
return;
|
||||
|
||||
shader = _cogl_shader_pointer_from_handle (handle);
|
||||
shader = handle;
|
||||
|
||||
#ifdef HAVE_COGL_GL
|
||||
if (strncmp (source, "!!ARBfp1.0", 10) == 0)
|
||||
@ -399,7 +399,7 @@ cogl_shader_get_info_log (CoglHandle handle)
|
||||
if (!cogl_is_shader (handle))
|
||||
return NULL;
|
||||
|
||||
shader = _cogl_shader_pointer_from_handle (handle);
|
||||
shader = handle;
|
||||
|
||||
#ifdef HAVE_COGL_GL
|
||||
if (shader->language == COGL_SHADER_LANGUAGE_ARBFP)
|
||||
@ -450,7 +450,7 @@ cogl_shader_get_type (CoglHandle handle)
|
||||
return COGL_SHADER_TYPE_VERTEX;
|
||||
}
|
||||
|
||||
shader = _cogl_shader_pointer_from_handle (handle);
|
||||
shader = handle;
|
||||
return shader->type;
|
||||
}
|
||||
|
||||
@ -466,7 +466,7 @@ cogl_shader_is_compiled (CoglHandle handle)
|
||||
if (!cogl_is_shader (handle))
|
||||
return FALSE;
|
||||
|
||||
shader = _cogl_shader_pointer_from_handle (handle);
|
||||
shader = handle;
|
||||
|
||||
#ifdef HAVE_COGL_GL
|
||||
if (shader->language == COGL_SHADER_LANGUAGE_ARBFP)
|
||||
|
@ -237,8 +237,7 @@ cogl_sub_texture_new (CoglContext *ctx,
|
||||
instead. */
|
||||
if (cogl_is_sub_texture (next_texture))
|
||||
{
|
||||
CoglSubTexture *other_sub_tex =
|
||||
_cogl_sub_texture_pointer_from_handle (next_texture);
|
||||
CoglSubTexture *other_sub_tex = COGL_SUB_TEXTURE (next_texture);
|
||||
full_texture = other_sub_tex->full_texture;
|
||||
sub_x += other_sub_tex->sub_x;
|
||||
sub_y += other_sub_tex->sub_y;
|
||||
|
@ -37,12 +37,6 @@ static void _cogl_swap_chain_free (CoglSwapChain *swap_chain);
|
||||
|
||||
COGL_OBJECT_DEFINE (SwapChain, swap_chain);
|
||||
|
||||
GQuark
|
||||
cogl_swap_chain_error_quark (void)
|
||||
{
|
||||
return g_quark_from_static_string ("cogl-swap-chain-error-quark");
|
||||
}
|
||||
|
||||
static void
|
||||
_cogl_swap_chain_free (CoglSwapChain *swap_chain)
|
||||
{
|
||||
|
@ -46,6 +46,9 @@ void
|
||||
cogl_swap_chain_set_length (CoglSwapChain *swap_chain,
|
||||
int length);
|
||||
|
||||
gboolean
|
||||
cogl_is_swap_chain (void *object);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __COGL_SWAP_CHAIN_H__ */
|
||||
|
@ -99,4 +99,18 @@ cogl_texture_2d_sliced_new_with_size (CoglContext *ctx,
|
||||
CoglPixelFormat internal_format,
|
||||
GError **error);
|
||||
|
||||
/**
|
||||
* cogl_is_texture_2d_sliced:
|
||||
* @object: A #CoglObject pointer
|
||||
*
|
||||
* Gets whether the given object references a #CoglTexture2dSliced.
|
||||
*
|
||||
* Return value: %TRUE if the object references a #CoglTexture2dSliced
|
||||
* and %FALSE otherwise.
|
||||
* Since: 1.10
|
||||
* Stability: unstable
|
||||
*/
|
||||
gboolean
|
||||
cogl_is_texture_2d_sliced (void *object);
|
||||
|
||||
#endif /* __COGL_TEXURE_2D_SLICED_H */
|
||||
|
@ -395,12 +395,6 @@ cogl_texture_3d_new_from_data (CoglContext *context,
|
||||
return ret;
|
||||
}
|
||||
|
||||
GQuark
|
||||
cogl_texture_3d_error_quark (void)
|
||||
{
|
||||
return g_quark_from_static_string ("cogl-texture-3d-error-quark");
|
||||
}
|
||||
|
||||
static int
|
||||
_cogl_texture_3d_get_max_waste (CoglTexture *tex)
|
||||
{
|
||||
|
@ -154,11 +154,5 @@ typedef struct _CoglVertexBuffer
|
||||
|
||||
} CoglVertexBuffer;
|
||||
|
||||
CoglVertexBuffer *
|
||||
_cogl_vertex_buffer_pointer_from_handle (CoglHandle handle);
|
||||
|
||||
CoglVertexBufferIndices *
|
||||
_cogl_vertex_buffer_indices_pointer_from_handle (CoglHandle handle);
|
||||
|
||||
#endif /* __COGL_VERTEX_BUFFER_H */
|
||||
|
||||
|
@ -144,7 +144,7 @@ cogl_vertex_buffer_get_n_vertices (CoglHandle handle)
|
||||
if (!cogl_is_vertex_buffer (handle))
|
||||
return 0;
|
||||
|
||||
buffer = _cogl_vertex_buffer_pointer_from_handle (handle);
|
||||
buffer = handle;
|
||||
|
||||
return buffer->n_vertices;
|
||||
}
|
||||
@ -451,7 +451,7 @@ cogl_vertex_buffer_add (CoglHandle handle,
|
||||
if (!cogl_is_vertex_buffer (handle))
|
||||
return;
|
||||
|
||||
buffer = _cogl_vertex_buffer_pointer_from_handle (handle);
|
||||
buffer = handle;
|
||||
buffer->dirty_attributes = TRUE;
|
||||
|
||||
cogl_attribute_name = canonize_attribute_name (attribute_name);
|
||||
@ -577,7 +577,7 @@ cogl_vertex_buffer_delete (CoglHandle handle,
|
||||
if (!cogl_is_vertex_buffer (handle))
|
||||
return;
|
||||
|
||||
buffer = _cogl_vertex_buffer_pointer_from_handle (handle);
|
||||
buffer = handle;
|
||||
buffer->dirty_attributes = TRUE;
|
||||
|
||||
/* The submit function works by diffing between submitted_attributes
|
||||
@ -618,7 +618,7 @@ set_attribute_enable (CoglHandle handle,
|
||||
if (!cogl_is_vertex_buffer (handle))
|
||||
return;
|
||||
|
||||
buffer = _cogl_vertex_buffer_pointer_from_handle (handle);
|
||||
buffer = handle;
|
||||
buffer->dirty_attributes = TRUE;
|
||||
|
||||
/* NB: If a buffer is currently being edited, then there can be two seperate
|
||||
@ -1469,7 +1469,7 @@ cogl_vertex_buffer_submit (CoglHandle handle)
|
||||
if (!cogl_is_vertex_buffer (handle))
|
||||
return;
|
||||
|
||||
buffer = _cogl_vertex_buffer_pointer_from_handle (handle);
|
||||
buffer = handle;
|
||||
|
||||
cogl_vertex_buffer_submit_real (buffer);
|
||||
}
|
||||
@ -1647,7 +1647,7 @@ cogl_vertex_buffer_draw (CoglHandle handle,
|
||||
if (!cogl_is_vertex_buffer (handle))
|
||||
return;
|
||||
|
||||
buffer = _cogl_vertex_buffer_pointer_from_handle (handle);
|
||||
buffer = handle;
|
||||
|
||||
update_primitive_and_draw (buffer, mode, first, count, NULL);
|
||||
}
|
||||
@ -1683,8 +1683,7 @@ cogl_vertex_buffer_indices_get_type (CoglHandle indices_handle)
|
||||
if (!cogl_is_vertex_buffer_indices (indices_handle))
|
||||
return COGL_INDICES_TYPE_UNSIGNED_SHORT;
|
||||
|
||||
buffer_indices =
|
||||
_cogl_vertex_buffer_indices_pointer_from_handle (indices_handle);
|
||||
buffer_indices = indices_handle;
|
||||
|
||||
return cogl_indices_get_type (buffer_indices->indices);
|
||||
}
|
||||
@ -1711,13 +1710,12 @@ cogl_vertex_buffer_draw_elements (CoglHandle handle,
|
||||
if (!cogl_is_vertex_buffer (handle))
|
||||
return;
|
||||
|
||||
buffer = _cogl_vertex_buffer_pointer_from_handle (handle);
|
||||
buffer = handle;
|
||||
|
||||
if (!cogl_is_vertex_buffer_indices (indices_handle))
|
||||
return;
|
||||
|
||||
buffer_indices =
|
||||
_cogl_vertex_buffer_indices_pointer_from_handle (indices_handle);
|
||||
buffer_indices = indices_handle;
|
||||
|
||||
update_primitive_and_draw (buffer, mode, indices_offset, count,
|
||||
buffer_indices);
|
||||
|
@ -561,15 +561,6 @@ cogl_set_projection_matrix (CoglMatrix *matrix)
|
||||
cogl_framebuffer_set_projection_matrix (cogl_get_draw_framebuffer (), matrix);
|
||||
}
|
||||
|
||||
CoglClipState *
|
||||
_cogl_get_clip_state (void)
|
||||
{
|
||||
CoglFramebuffer *framebuffer;
|
||||
|
||||
framebuffer = cogl_get_draw_framebuffer ();
|
||||
return _cogl_framebuffer_get_clip_state (framebuffer);
|
||||
}
|
||||
|
||||
GQuark
|
||||
_cogl_driver_error_quark (void)
|
||||
{
|
||||
|
@ -124,7 +124,6 @@
|
||||
*/
|
||||
#ifdef COGL_ENABLE_EXPERIMENTAL_2_0_API
|
||||
#include <cogl/cogl2-path.h>
|
||||
#include <cogl/cogl2-clip-state.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -1,53 +0,0 @@
|
||||
/*
|
||||
* Cogl
|
||||
*
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Copyright (C) 2007,2008,2009,2010 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#if !defined(__COGL_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
||||
#error "Only <cogl/cogl.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#ifndef __COGL2_CLIP_STATE_H
|
||||
#define __COGL2_CLIP_STATE_H
|
||||
|
||||
#include <cogl/cogl-types.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define cogl_clip_push_from_path cogl2_clip_push_from_path
|
||||
/**
|
||||
* cogl_clip_push_from_path:
|
||||
* @path: The path to clip with.
|
||||
*
|
||||
* Sets a new clipping area using the silhouette of the specified,
|
||||
* filled @path. The clipping area is intersected with the previous
|
||||
* clipping area. To restore the previous clipping area, call
|
||||
* call cogl_clip_pop().
|
||||
*
|
||||
* Since: 1.8
|
||||
* Stability: Unstable
|
||||
*/
|
||||
void
|
||||
cogl_clip_push_from_path (CoglPath *path);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __COGL2_CLIP_STATE_H */
|
@ -31,6 +31,7 @@
|
||||
#include "cogl-context-private.h"
|
||||
#include "cogl-feature-private.h"
|
||||
#include "cogl-renderer-private.h"
|
||||
#include "cogl-private.h"
|
||||
|
||||
gboolean
|
||||
_cogl_gles_update_features (CoglContext *context,
|
||||
|
@ -46,6 +46,7 @@
|
||||
#include "cogl-renderer-private.h"
|
||||
#include "cogl-framebuffer-private.h"
|
||||
#include "cogl-onscreen-private.h"
|
||||
#include "cogl-kms-renderer.h"
|
||||
|
||||
static const CoglWinsysEGLVtable _cogl_winsys_egl_vtable;
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Copyright (C) 2007,2008,2009,2010 Intel Corporation.
|
||||
* Copyright (C) 2012 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -21,16 +21,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
#ifndef __COGL_WINSYS_GLX_PRIVATE_H
|
||||
#define __COGL_WINSYS_GLX_PRIVATE_H
|
||||
|
||||
#include "cogl-clip-state-private.h"
|
||||
#include "cogl-framebuffer-private.h"
|
||||
#include "cogl-journal-private.h"
|
||||
const CoglWinsysVtable *
|
||||
_cogl_winsys_glx_get_vtable (void);
|
||||
|
||||
void
|
||||
cogl2_clip_push_from_path (CoglPath *path)
|
||||
{
|
||||
cogl_framebuffer_push_path_clip (cogl_get_draw_framebuffer (), path);
|
||||
}
|
||||
#endif /* __COGL_WINSYS_GLX_PRIVATE_H */
|
@ -47,6 +47,7 @@
|
||||
#include "cogl-swap-chain-private.h"
|
||||
#include "cogl-xlib-renderer.h"
|
||||
#include "cogl-util.h"
|
||||
#include "cogl-winsys-glx-private.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
|
30
cogl/winsys/cogl-winsys-sdl-private.h
Normal file
30
cogl/winsys/cogl-winsys-sdl-private.h
Normal file
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Cogl
|
||||
*
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Copyright (C) 2012 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __COGL_WINSYS_SDL_PRIVATE_H
|
||||
#define __COGL_WINSYS_SDL_PRIVATE_H
|
||||
|
||||
const CoglWinsysVtable *
|
||||
_cogl_winsys_sdl_get_vtable (void);
|
||||
|
||||
#endif /* __COGL_WINSYS_SDL_PRIVATE_H */
|
@ -36,6 +36,7 @@
|
||||
#include "cogl-onscreen-template-private.h"
|
||||
#include "cogl-context-private.h"
|
||||
#include "cogl-onscreen-private.h"
|
||||
#include "cogl-winsys-sdl-private.h"
|
||||
|
||||
typedef struct _CoglRendererSdl
|
||||
{
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "cogl-context-private.h"
|
||||
#include "cogl-framebuffer-private.h"
|
||||
#include "cogl-private.h"
|
||||
#include "cogl-winsys-stub-private.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
|
30
cogl/winsys/cogl-winsys-wgl-private.h
Normal file
30
cogl/winsys/cogl-winsys-wgl-private.h
Normal file
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Cogl
|
||||
*
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Copyright (C) 2012 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __COGL_WINSYS_WGL_PRIVATE_H
|
||||
#define __COGL_WINSYS_WGL_PRIVATE_H
|
||||
|
||||
const CoglWinsysVtable *
|
||||
_cogl_winsys_wgl_get_vtable (void);
|
||||
|
||||
#endif /* __COGL_WINSYS_WGL_PRIVATE_H */
|
@ -44,6 +44,7 @@
|
||||
#include "cogl-private.h"
|
||||
#include "cogl-feature-private.h"
|
||||
#include "cogl-win32-renderer.h"
|
||||
#include "cogl-winsys-wgl-private.h"
|
||||
|
||||
typedef struct _CoglRendererWgl
|
||||
{
|
||||
|
@ -260,7 +260,7 @@ MAINTAINER_COMPILER_FLAGS="-Wall -Wcast-align -Wuninitialized
|
||||
-Wno-strict-aliasing -Wempty-body -Wformat
|
||||
-Wformat-security -Winit-self
|
||||
-Wdeclaration-after-statement -Wvla
|
||||
-Wpointer-arith"
|
||||
-Wpointer-arith -Wmissing-declarations"
|
||||
|
||||
AS_CASE(
|
||||
[$enable_maintainer_flags],
|
||||
|
@ -173,17 +173,6 @@ cogl_poll_dispatch
|
||||
cogl_glib_source_new
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>cogl-clipping</FILE>
|
||||
<TITLE>Clipping</TITLE>
|
||||
cogl_clip_push_rectangle
|
||||
cogl_clip_push_window_rectangle
|
||||
cogl_clip_push_from_path
|
||||
cogl_clip_push_from_path_preserve
|
||||
cogl_clip_push_primitive
|
||||
cogl_clip_pop
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>cogl-index-array</FILE>
|
||||
<TITLE>Index Arrays</TITLE>
|
||||
|
@ -128,7 +128,7 @@ static GSourceFuncs wayland_event_source_funcs =
|
||||
NULL
|
||||
};
|
||||
|
||||
GSource *
|
||||
static GSource *
|
||||
wayland_event_source_new (struct wl_event_loop *loop)
|
||||
{
|
||||
WaylandEventSource *source;
|
||||
|
@ -1,6 +1,12 @@
|
||||
#ifndef _TEST_UTILS_H_
|
||||
#define _TEST_UTILS_H_
|
||||
|
||||
/* We don't really care about functions that are defined without a
|
||||
header for the unit tests so we can just disable it here */
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC diagnostic ignored "-Wmissing-declarations"
|
||||
#endif
|
||||
|
||||
typedef enum _TestRequirement
|
||||
{
|
||||
TEST_REQUIREMENT_GL = 1<<0,
|
||||
|
Loading…
Reference in New Issue
Block a user