[cogl] Move rect and poly drawing code from cogl-texture.c to cogl-primitives.c
None of this code directly related to implementing CoglTextures, and the code was needlessly duplicated between the GL and GLES backends. This moves the cogl_rectangle* and cogl_polygon* code into common/cogl-primitives.c makes which makes lot of sense since the two copies keep needlessly diverging introducing or fixing bugs in one but not the other. For instance I came accross one such bug regarding the enabling of texture units when unifying the code.
This commit is contained in:
parent
c797d564b2
commit
d7c5fa4b61
5 changed files with 1331 additions and 2498 deletions
File diff suppressed because it is too large
Load diff
|
@ -39,6 +39,23 @@ struct _CoglTexSliceSpan
|
|||
gint waste;
|
||||
};
|
||||
|
||||
struct _CoglSpanIter
|
||||
{
|
||||
gint index;
|
||||
GArray *array;
|
||||
CoglTexSliceSpan *span;
|
||||
float pos;
|
||||
float next_pos;
|
||||
float origin;
|
||||
float cover_start;
|
||||
float cover_end;
|
||||
float intersect_start;
|
||||
float intersect_end;
|
||||
float intersect_start_local;
|
||||
float intersect_end_local;
|
||||
gboolean intersects;
|
||||
};
|
||||
|
||||
struct _CoglTexture
|
||||
{
|
||||
guint ref_count;
|
||||
|
@ -73,9 +90,26 @@ typedef struct _CoglJournalEntry
|
|||
CoglTexture*
|
||||
_cogl_texture_pointer_from_handle (CoglHandle handle);
|
||||
|
||||
void
|
||||
_cogl_texture_set_wrap_mode_parameter (CoglTexture *tex,
|
||||
GLenum wrap_mode);
|
||||
|
||||
gboolean
|
||||
_cogl_texture_span_has_waste (CoglTexture *tex,
|
||||
gint x_span_index,
|
||||
gint y_span_index);
|
||||
|
||||
void
|
||||
_cogl_span_iter_begin (CoglSpanIter *iter,
|
||||
GArray *array,
|
||||
float origin,
|
||||
float cover_start,
|
||||
float cover_end);
|
||||
|
||||
gboolean
|
||||
_cogl_span_iter_end (CoglSpanIter *iter);
|
||||
|
||||
void
|
||||
_cogl_span_iter_next (CoglSpanIter *iter);
|
||||
|
||||
#endif /* __COGL_TEXTURE_H */
|
||||
|
|
1261
gl/cogl-texture.c
1261
gl/cogl-texture.c
File diff suppressed because it is too large
Load diff
|
@ -39,6 +39,23 @@ struct _CoglTexSliceSpan
|
|||
gint waste;
|
||||
};
|
||||
|
||||
struct _CoglSpanIter
|
||||
{
|
||||
gint index;
|
||||
GArray *array;
|
||||
CoglTexSliceSpan *span;
|
||||
float pos;
|
||||
float next_pos;
|
||||
float origin;
|
||||
float cover_start;
|
||||
float cover_end;
|
||||
float intersect_start;
|
||||
float intersect_end;
|
||||
float intersect_start_local;
|
||||
float intersect_end_local;
|
||||
gboolean intersects;
|
||||
};
|
||||
|
||||
struct _CoglTexture
|
||||
{
|
||||
guint ref_count;
|
||||
|
@ -73,9 +90,26 @@ typedef struct _CoglJournalEntry
|
|||
CoglTexture*
|
||||
_cogl_texture_pointer_from_handle (CoglHandle handle);
|
||||
|
||||
void
|
||||
_cogl_texture_set_wrap_mode_parameter (CoglTexture *tex,
|
||||
GLenum wrap_mode);
|
||||
|
||||
gboolean
|
||||
_cogl_texture_span_has_waste (CoglTexture *tex,
|
||||
gint x_span_index,
|
||||
gint y_span_index);
|
||||
|
||||
void
|
||||
_cogl_span_iter_begin (CoglSpanIter *iter,
|
||||
GArray *array,
|
||||
float origin,
|
||||
float cover_start,
|
||||
float cover_end);
|
||||
|
||||
gboolean
|
||||
_cogl_span_iter_end (CoglSpanIter *iter);
|
||||
|
||||
void
|
||||
_cogl_span_iter_next (CoglSpanIter *iter);
|
||||
|
||||
#endif /* __COGL_TEXTURE_H */
|
||||
|
|
1244
gles/cogl-texture.c
1244
gles/cogl-texture.c
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue