When a copy is made of a weak pipeline it tries to promote the weak
parent by taking a reference on that weak pipeline's parent. However
promote_weak_ancestors was instead always taking a reference on the
first parent, regardless of whether it was weak. The corresponding
revert_weak_ancestors function which is supposed to undo the effect of
promote_weak_ancestors only unref'd the parent if was weak. This meant
that any non-weak pipeline copy would end up leaking a reference on
its parent.
This patch changes both functions to have a similar loop. It loops
through all of the parents of the pipeline until it finds one that is
not weak and refs or unrefs the *parent* of that pipeline instead of
the pipeline itself.
Signed-off-by: Robert Bragg <robert@linux.intel.com>
This removes the unused COGL_PRIVATE_FEATURE_EGL flags since
check_egl_extensions doesn't refer to these flags it uses the
COGL_EGL_WINSYS_FEATURE flags.
Signed-off-by: Neil Roberts <neil@linux.intel.com>
instead of looking at the ctx->private_feature_flags to determine if
Cogl supports creating an EGLImage from a X Pixmap we now check the
renderer private features instead since these are what get setup in
check_egl_extensions. The conflicting flags defined in cogl-internal.h
should be removed since they are un-used.
Signed-off-by: Neil Roberts <neil@linux.intel.com>
check_egl_extensions was mistakenly always ORing in the priv flags of
the first feature_data entry instead of referencing the i variable to
index into the array of feature data after determining that an extension
is available.
Signed-off-by: Neil Roberts <neil@linux.intel.com>
This fixes the 2.0 reference manual Makefile to not ignore
cogl-context.h; it also adds cogl_context_new to cogl-sections.txt and
removes cogl_begin/end_gl. (For using raw GL with Cogl 2.0 the plan was
to add some API for creating additional GL contexts via some Cogl API
and a way to push/pop those contexts.)
Signed-off-by: Neil Roberts <neil@linux.intel.com>
This adds a description for the cogl-framebuffer section and adds lots
of missing symbols to the 2.0 reference manual.
Signed-off-by: Neil Roberts <neil@linux.intel.com>
This exposes the previously internal only
_cogl_framebuffer_get_red/green/blue/alpha_bits() functions as 2.0
experimental API.
Signed-off-by: Neil Roberts <neil@linux.intel.com>
There were a few cogl_matrix symbols missing from the cogl-sections.txt
for the 2.0 reference manual.
Signed-off-by: Neil Roberts <neil@linux.intel.com>
This adds a function called cogl_matrix_is_identity that can determine
if a given matrix is an identity matrix or not.
Signed-off-by: Neil Roberts <neil@linux.intel.com>
It has been overly cumbersome to work with the matrix code ever since we
pulled in the mesa code because we initially kept the mesa and the
original cogl code separate. We have made several updates to the mesa
code since integrating, and the coding style has changed a lot compared
to the original mesa code, so there's little point in keeping the two
files separate any longer.
Signed-off-by: Neil Roberts <neil@linux.intel.com>
Instead of having everything in cogl-matrix-mesa.[ch] be in the
_math namespace this now puts them in the _cogl_matrix namespace
instead, in preparation for flattening cogl-matrix-mesa.[ch] into
cogl-matrix.[ch].
Signed-off-by: Neil Roberts <neil@linux.intel.com>
The aim is to flatten cogl-matrix-mesa.[ch] code back into
cogl-matrix.[ch] and removing cruft first makes sense. This removes
several un-used macros and vector related functions and also replaces
the use of doxygen style comment markup with the gtk-doc style we use
throughout the reset of cogl.
Signed-off-by: Neil Roberts <neil@linux.intel.com>
Instead of having a separate GList for the children we can use the
linked list code from FreeBSD and store the list node directly in the
struct. That way we can avoid having a separate slice allocation for
the list node. It also means that we effectively have a pointer to the
list node given a pointer to the pipeline node. That means we can
unparent a pipeline without having to walk the entire list of
children. With this change there is no need to have the optimisation
to fast track a pipeline that only has one child which simplifies the
code somewhat.
With this patch we are removing a pointer and a gboolean from the
CoglPipeline struct and adding two pointers. On 32-bit architectures
this should end up exactly the same size because a gboolean is the
same size as a pointer. On 64-bit architectures I think it should end
up 4 bytes smaller because it also ends up removing two cases where a
pointer follows a gboolean which presumably would mean the compiler
would have to insert 4 bytes of padding to keep the pointer aligned to
8 bytes.
https://bugzilla.gnome.org/show_bug.cgi?id=652514
This modifies cogl-queue.h so that:-
- Everything is in a COGL_* namespace
- It assumes there is a typedef for all of the types instead of
requiring the code to use struct WhateverType.
- It doesn't contain any tabs
https://bugzilla.gnome.org/show_bug.cgi?id=652514
This directly copies in the header from the FreeBSD kernel for their
linked-list implementation. A later patch will modify it but this
patch is here so we can have a clear patch to show what the
changes are.
Using the list implementation from this header is beneficial as
opposed to using GList because it's possible to embed the list
pointers directly into another struct. This saves a separate
allocation and it also makes it possible to remove an item from the
list without having to iterate the entire list to find its list
node. The header provides four different list types: single and
doubley linked lists and each of them can either have a header with
pointers to the beginning and end or just to the beginning. Glib
effectively only provides single and doubley linked lists with a
pointer to the beginning or a doubley-linked list with a pointer to
both (GQueue).
https://bugzilla.gnome.org/show_bug.cgi?id=652514
The check for the version number was checking against the 2.0.0 micro
version number which isn't expected to change for a long time so the
test was useless.
The README file is generated by the configure script so that it can
include the required dependency version numbers. However there was no
corresponding AC_SUBST calls for the versions so the README would be
left with @THESE_MARKERS@.
The release template had the wrong version number and download URL and
the subject was slightly different from what we used in the previous
release. Also the parts split out from the README were including the
-- separator. These have been removed using tail -n +1. The
documentation section is updated to match the message used for the
1.7.0 release. There is now a note about the release being a
development snapshot that only gets added depending on
COGL_RELEASE_STATUS.
The function declarations for the GL_OES_EGL_image extension were
using the wrong name for the GLeglImageOES type so it was getting
build errors when compiling for GLES.
This adds a cogl-win32-renderer.h for the win32 specific cogl-renderer
API instead of having #ifdef guards in cogl-renderer.h
Signed-off-by: Neil Roberts <neil@linux.intel.com>
This updates the public wayland symbols to follow the pattern
cogl_wayland_blah instead of cogl_blah_wayland.
Signed-off-by: Neil Roberts <neil@linux.intel.com>
we've got into a bit of a mess with how we name platform specific
symbols and files, so this is a first pass at trying to tidy that up.
All platform specific symbols should be named like
cogl_<platform>_symbol_name and similarly files should be named like
cogl-<platform>-filename.c
This patch tackles the X11 specific renderer/display APIs as a start.
Signed-off-by: Neil Roberts <neil@linux.intel.com>
This adds Xlib and Win32 typesafe replacements for
cogl_renderer_handle_native_event, cogl_renderer_add_native_filter,
cogl_renderer_remove_native_filter. The old functions are kept as an
implementation detail so we can share code.
Signed-off-by: Neil Roberts <neil@linux.intel.com>
It used to be that we passed around NULL terminated arrays of
attributes, but since 3c1e83c7f we now explicitly pass an n_attributes
count instead. There were some leftovers of the old approach in the
cogl_vdraw_[indexed]_attributes functions and also there was an
off-by-one error with the n_attributes values passed on which was
causing crashes.
Signed-off-by: Neil Roberts <neil@linux.intel.com>
When setting a NULL texture on a CoglPipeline we would also reset the
texture target to a dummy value of 0. Reseting the target also had the
effect of making fragends discard any associated program. In cases where
the NULL texture was only transient until a replacement texture could be
set we were re-running lots of redundant codegen and shader
compilations.
Signed-off-by: Neil Roberts <neil@linux.intel.com>
There is a documented rule that layer changes should only be notified to
the fragend once; either as a pipeline change or as a layer change. When
the number of layers associated with a material changes then that should
get notified against the pipeline. All other layer changes get notified
against the layer.
There was a mistake in the _cogl_pipeline_add/remove_layer_difference
functions, in that we weren't using the 'inc/dec_n_layers' boolean to
determine if the fragend should be notified of the change.
It was also noticed that the logic of _cogl_pipeline_prune_to_n_layers
would also break this rule, by failing to notify some changes at all.
Signed-off-by: Neil Roberts <neil@linux.intel.com>
This does some minor gardening in cogl-sections.txt, tweaking some of
the section titles and removing some stale api references.
Signed-off-by: Neil Roberts <neil@linux.intel.com>
This adds the cogl_swap_chain and cogl_onscreen_template symbols to the
experimental 2.0 reference manual.
Signed-off-by: Neil Roberts <neil@linux.intel.com>
This lists the cogl_renderer symbols in the cogl-sections.txt for the
experimental 2.0 reference manual.
Signed-off-by: Neil Roberts <neil@linux.intel.com>
This adds API to let you override the choice of Cogl's winsys backend.
Previously it was only possible to override the winsys using the
COGL_RENDERER environment variable, but it's useful for something like
Clutter to be able to control the winsys via API without needing
environment variable tricks. This also adds API to query back the
winsys chosen by Cogl, in case you don't set an explicit override.
Signed-off-by: Neil Roberts <neil@linux.intel.com>
This exposes experimental cogl_framebuffer APIs for getting and setting
a viewport without having to refer to the implicit CoglContext. It adds
the following experimental API:
cogl_framebuffer_set_viewport
cogl_framebuffer_get_viewport4fv
cogl_framebuffer_get_viewport_x
cogl_framebuffer_get_viewport_y
cogl_framebuffer_get_viewport_width
cogl_framebuffer_get_viewport_height
Signed-off-by: Neil Roberts <neil@linux.intel.com>
Based on the Cogl example we had on wiki.clutter-project.org this shows
how to use the primitive API to draw a simple spinning crate.
Signed-off-by: Neil Roberts <neil@linux.intel.com>
This adds a _cogl_init function for Cogl that we expect to be the first
thing called before anything else is done with Cogl. It's not a public
API so it's expected that all entry points for Cogl that might be the
first function used should call _cogl_init().
We currently call _cogl_init() in these functions:
cogl_renderer_new
cogl_display_new
cogl_context_new
cogl_android_set_native_window
_cogl_init() can be called multiple times, and only the first call has
any affect.
For example _cogl_init() gives us a place check and parse the COGL_DEBUG
environment variable.
Since we don't have any need to parse command line arguments (we can
always get user configuration options from the environment) our init
function doesn't require argc/argv pointers.
By saying up front that we aren't interested in command line arguments
that means we can avoid the mess that is GOption based library
initialization which is extremely fragile due to its lack of dependency
tracking between modules.
Signed-off-by: Neil Roberts <neil@linux.intel.com>
The recommended command to check for differences from master to the
remote master was using git log with a range from the local master to
the remote master but this wouldn't work if the local master is ahead
of the remote master because the range is backwards. This patch
changes it to recommend git diff --stat instead because then the
command would work even if the two branches have diverged.
The "default" m4 conflicts with one of libtool's internal symbols, one
that is used to determine whether the -fPIC argument should be used;
this breaks compilation onf 64bit platforms.
https://bugzilla.gnome.org/show_bug.cgi?id=653615
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Signed-off-by: Neil Roberts <neil@linux.intel.com>