summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Release 1.7.4 (snapshot)wip/release-1.7.4Robert Bragg2011-07-201-3/+3
|
* dist: enable more features for distcheckRobert Bragg2011-07-202-2/+10
| | | | | | | As a bare minimum we want to ensure that are releases are able to build with support for gles1, gles2, gl, egl and glx. Previously we only checked the build with gl + glx enabled and our last release actually missed a header file required for building with egl.
* dist: Don't use elaborate script to gen ChangelogsRobert Bragg2011-07-205-92/+22
| | | | | | The changelog generation scripts used for releases are overly elaborate and fragile. A Changelog is also no substitute for the Git log so now we simply ship a static Changelog that points to the Git log instead.
* Add note about updating libtool versioning in doc/RELEASINGRobert Bragg2011-07-201-0/+1
|
* Updates NEWS for 1.7.4 releaseRobert Bragg2011-07-201-2/+62
|
* gles: don't check for glClientActiveTextureRobert Bragg2011-07-201-1/+6
| | | | | | | | | | | | | | | | in cogl-ext-functions.h we had one multitexture feature that checked for the ARB_multitexture extension and if found it then expected to find glActiveTexture and glClientActiveTexture. The problem is that the multitexture extension is part of the core GLES 1 and 2 APIs except that for GLES2 there is no glClientActiveTexture function. By trying to handle it as one feature that meant that Cogl would fail to check the multitexture extension which is a hard requirement for Cogl. The reason this went unnoticed is because Cogl can indirectly end up linked to an OpenGL library via cairo and so we were finding a glClientActiveTexture symbol there. This highlights that we should probably stop using g_module_open (NULL) when checking features and instead we should use the module we opened in cogl-renderer.c.
* x11: don't try and close a NULL displayRobert Bragg2011-07-201-1/+1
| | | | | If we failed to open an X display then don't later try and close a NULL display resulting in a crash.
* Adds ColorMask support to CoglRobert Bragg2011-07-1911-3/+260
| | | | | | | | | | | | | This adds CoglPipeline and CoglFramebuffer support for setting a color mask which is a bit mask defining which color channels should be written to the current framebuffer. The final color mask is the intersection of the framebuffer color mask and the pipeline color mask. The framebuffer mask affects all rendering to the framebuffer while the pipeline masks can be used to affect individual primitives. Reviewed-by: Neil Roberts <neil@linux.intel.com>
* configure: Add configure options to override the GL library nameNeil Roberts2011-07-191-0/+20
| | | | | | | | | | | | | | | | This adds 3 configure options to override the library name that gets dlopened for GL, GLES and GLESv2. This could be useful for distro maintainers who have an unusual name for the libraries (for example, on OpenBSD the GL library appears to be called libGL.so.4). This could at least be simpler than having to create a distro patch. The configure options would be used like this: ./configure --with-gl-libname=libGL.so \ --with-gles1-libname=libGLESv1.so \ --with-gles2-libname=libGLESv2.so https://bugzilla.gnome.org/show_bug.cgi?id=654593
* Specify the full filename when g_module_open'ing the GL libraryNeil Roberts2011-07-193-22/+8
| | | | | | | | | | | | | | | | | | | | Instead of using g_module_build_path with the short name of the GL library (eg, "GL") and relying on glib to add the suffix and prefix, the configure script now directly encodes the full name including the version number (eg, "libGL.so.1"). This is necessary because distros don't always install the non-versioned suffix for the library. The GLES libraries are left without the version suffix because it's not clear what should be placed here and I can't find any documentation from Khronos to clarify this. Mesa seems to install a file called libGLESv2.so.2 but the IMG SDK doesn't install any versioned library. There is an example of dynamically loading libGLESv2 in the Chromium source code and that does not use the version suffix even though it does use the version suffix for GL. This implies that it's at least fairly normal to load the unversioned name for GLES. https://bugzilla.gnome.org/show_bug.cgi?id=654593
* gles: Or in private features into ctx->private_feature_flagsRobert Bragg2011-07-191-1/+1
| | | | | | | | | | When we moved all the GL function pointers to be part of CoglContext in commit dae02a99a5c8c5 we made a mistake and started to OR in the private COGL_PRIVATE_FEATURE_TEXTURE_2D_FROM_EGL_IMAGE feature flag into the non private flags which would mean cogl would think the GL_OES_EGL_image extension wasn't supported. Reviewed-by: Neil Roberts <neil@linux.intel.com>
* hello: Make sure to clear background explicitlyRobert Bragg2011-07-181-0/+3
| | | | | | | | This test wasn't actually explicitly clearing the background to black it was simply a fluke that some drivers clear the background when allocating a new framebuffer. Reviewed-by: Neil Roberts <neil@linux.intel.com>
* egl: if texture_pixmap_x11_create fails free priv dataRobert Bragg2011-07-181-1/+4
| | | | | | | | This makes sure the egl winsys frees the private egl_tex_pixmap state if in _cogl_winsys_texture_pixmap_x11_create if there is a failure to create an EGLImage. Reviewed-by: Neil Roberts <neil@linux.intel.com>
* examples: Add x11-tfp exampleRobert Bragg2011-07-182-1/+237
| | | | | | This adds a minimal example that tests the cogl_texture_pixmap_x11 API. Reviewed-by: Neil Roberts <neil@linux.intel.com>
* texture-pixmap-x11: set ->winsys = NULL if _create failsRobert Bragg2011-07-181-0/+3
| | | | | | | | | If _cogl_winsys_texture_pixmap_x11_create() fails then implicitly no private state has been associated with the given tex_pixmap. Since that winsys isn't associated with it we explicitly set tex_pixmap->winsys = NULL. Reviewed-by: Neil Roberts <neil@linux.intel.com>
* texture-pixmap-x11: initialize ->use_winsys_textureRobert Bragg2011-07-181-1/+6
| | | | | | | | | This ensures that tex_pixmap->use_winsys_texture is always initialized during cogl_texture_pixmap_x11_new - either according to the result of winsys->texture_pixmap_x11_create, or if the winsys doesn't support tfp we explicitly initialize to FALSE. Reviewed-by: Neil Roberts <neil@linux.intel.com>
* Combine _cogl_context_check_gl_version and update_features into oneNeil Roberts2011-07-189-87/+55
| | | | | | | | | | | | | | The _cogl_context_check_gl_version function is meant to be called once Cogl has a GL context so that it can check whether the context found is supported by Cogl. However, only the stub winsys was calling this and it was doing it before Cogl had a chance to retrieve the function pointer for glString so it would just crash. This patch combines the two functions into one so that _cogl_context_update_features returns a gboolean and a GError. Then it can just check the context itself. https://bugzilla.gnome.org/show_bug.cgi?id=654440 Reviewed-by: Robert Bragg <robert@linux.intel.com>
* Compilation fixes for sunccEmmanuele Bassi2011-07-182-3/+9
| | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=654718 Reviewed-by: Neil Roberts <neil@linux.intel.com> Reviewed-by: Robert Bragg <robert@linux.intel.com>
* Use MESA_pack_invert to avoid read_pixels flipRobert Bragg2011-07-133-4/+27
| | | | | | | | | | cogl_read_pixels returns image data in a top-down memory order, but because OpenGL normally returns pixel data in a bottom-up order we have to flip the data before returning it to the user. If the OpenGL driver supports the GL_MESA_pack_invert extension though we can ask the driver to return the data in a top-down order in the first place. Signed-off-by: Neil Roberts <neil@linux.intel.com>
* build: don't referencing wayland syms if not availableRobert Bragg2011-07-131-0/+2
| | | | | | | | | cogl-winsys-egl-feature-functions.h was unconditionally depending on the struct wl_display type being defined. This guards the check for the "WL_bind_wayland_display" extension with #ifdef COGL_HAS_EGL_PLATFORM_WAYLAND_SUPPORT Signed-off-by: Neil Roberts <neil@linux.intel.com>
* configure: Expose COGL_HAS_GLX_SUPPORT publiclyRobert Bragg2011-07-131-1/+1
| | | | | | | Instead of only exposing COGL_HAS_GLX_SUPPORT internally in config.h we now expose it though the public cogl-defines.h header. Signed-off-by: Neil Roberts <neil@linux.intel.com>
* framebuffer: Add dither_enabled getter/settersRobert Bragg2011-07-135-0/+75
| | | | | | | | | | | | | | | | This adds a getter and setter for requesting dithering to be enabled. Dithering is a hardware dependent technique to increase the visible color resolution beyond what the underlying hardware supports by playing tricks with the colors placed into the framebuffer to give the illusion of other colors. (For example this can be compared to half-toning used by some news papers to show varying levels of grey even though their may only be black and white are available). The results of enabling dithering are platform dependent and may have no effect. Signed-off-by: Neil Roberts <neil@linux.intel.com>
* Add some generated files to the gitignore listEmmanuele Bassi2011-07-132-1/+3
|
* cogl-pipeline: Use the pipeline cache for the GLSL backendsNeil Roberts2011-07-135-4/+192
| | | | | | | | | | | | | The CoglPipelineCache is now extended to store templates for state affecting vertex shaders and combined programs. The GLSL fragend, vertend and progend now uses this to get cached shaders and a program. When a new pipeline is created it will now get hashed three times if the GLSL backends are in use (once for the fragend, once for the vertend and once for the progend). Ideally we should add some way for the progend to check its cache before the fragends and vertends are checked so that it can bypass them entirely if it can find a cached combined program.
* fragend-arbfp: Move the pipeline cache to a separate fileNeil Roberts2011-07-137-151/+248
| | | | | | | | | | | | | | | | | The pipeline cache is now handled in CoglPipelineCache instead of directly in the ARBfp fragend. The flags needed to hash a pipeline should be exactly the same for the ARBfp and GLSL fragends so it's convenient to share the code. The hash table now stores the actual pipeline as the value instead of the private data so that the two fragends can attach their data to it. That way it's possible to use the same pipeline key with ancestors that are using different fragends. The hash table is created with g_hash_table_new_full to set a destructor for the key and value and there is a destructor for CoglPipelineCache that gets called when the CoglContext is destroyed. That way we no longer leak the pipelines and shader state when the context is desroyed.
* pipeline: Unify how the backends store private dataNeil Roberts2011-07-137-698/+567
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the fragends had a separate private data pointer which was used by the GLSL and ARBfp fragends to store a tiny struct containing a single pointer to the ref-counted shader state. The space for the private data pointer is reserved in all of the pipelines for all of the potential backends. The vertends and progends however did this differently by directly storing the pointer to the ref counted data using cogl_object_set_user_data. This patch unifies the different methods so that they all use cogl_object_set_user_data and the fragends don't bother with the separate tiny allocation for the private data. The private data pointer array has been removed from CoglPipeline and the corresponding fragend virtual to free the private data has also been removed because this can instead be done with the destroy notify from the object user data. The variable names used have been unified so that all of the vertends and fragends name their data struct CoglPipelineShaderState and use a variable called shader_state to refer to it. The progend uses CoglPipelineProgramState and a variable called program_state. This should also fix two potential bugs. the ARBfp fragend was apprently leaking a reference to the private state when it creates the private data because it was adding a reference before stroring the pointer to the newly allocated data but the ref count is already set to 1 on creation. The other potential bug is that the free function for CoglPipeline was only calling the free_priv virtual for the currently used fragend of the pipeline. The design of the fragends is meant to allow a pipeline to have multiple fragend priv datas because a child pipeline could be attaching its fragend data to the ancestor and its allowed to pick a different fragend.
* pipeline: NULLify deprecated_get_layers_list on copyDamien Lespiau2011-07-121-0/+1
| | | | | | That list is tracking the layers for get_layers_list() and needs to be freed later on. However _copy() did not initialize it and we ended up trying to free some garbage pointer.
* pipeline: Plug a leak of GListsDamien Lespiau2011-07-121-0/+2
| | | | | | | | | | _cogl_pipeline_get_layers() allocates a list on the pipeline to be able to get the pointer valid as long as possible and store that list in the pipeline object. You need to free that list when freeing the pipeline. Signed-off-by: Robert Bragg <robert@linux.intel.com>
* build: Fix the help string for --enable-profileDamien Lespiau2011-07-121-1/+1
| | | | | | | --enable-uprof has been renamed to --enable-profile, make sure the help string is updated accordingly. Signed-off-by: Robert Bragg <robert@linux.intel.com>
* build: Correctly quote the help message for --enable-profileDamien Lespiau2011-07-121-2/+2
| | | | | | It did not show up in ./configure --help because of that. Signed-off-by: Robert Bragg <robert@linux.intel.com>
* dist: Make sure to dist cogl-winsys-egl-feature-functions.hRobert Bragg2011-07-111-20/+2
| | | | | | | cogl-winsys-egl-feature-functions.h wasn't being listed as source and so it wasn't ending up in dist tarballs. Signed-off-by: Neil Roberts <neil@linux.intel.com>
* dist: give 2.0 manual unique DOC_MODULE nameRobert Bragg2011-07-114-2/+2
| | | | | | | | | | | | The experimental 2.0 reference manual was setup with DOC_MODULE name of "cogl" which conflicted with the 1.x API manual. This meant that when running make install for both the reference manuals all the html files would end up bundled together in the same location. The 2.0 API reference now has a DOC_MODULE name of "cogl-2.0-experimental" the corresponding -sections.txt and -docs.xml.in files have also been renamed to match this. Signed-off-by: Neil Roberts <neil@linux.intel.com>
* Adds examples/crate to .gitignoreRobert Bragg2011-07-111-0/+1
|
* fix namespace for cogl_context_egl_get_egl_contextRobert Bragg2011-07-112-3/+3
| | | | | | | | This renames cogl_context_egl_get_egl_context to cogl_egl_context_get_egl_context to be consistent with other platform specific APIs. Signed-off-by: Neil Roberts <neil@linux.intel.com>
* Remove cogl_context_set_default APIRobert Bragg2011-07-113-17/+0
| | | | | | | | For cogl 2.0 we don't want to have a default context. In the meantime we can simply assume that calling cogl_context_new() implicitly sets that context as the default context before returning. Signed-off-by: Neil Roberts <neil@linux.intel.com>
* onscreen: make platform specific onscreen apis consistentRobert Bragg2011-07-114-27/+27
| | | | | | | | | There were several CoglOnscreen functions named like: cogl_onscreen_<platform>_blah instead of cogl_<platform>_onscreen_blah so this patch updates those to be consistent with other platform specific apis we have in cogl. Signed-off-by: Neil Roberts <neil@linux.intel.com>
* Dynamically load the GL or GLES libraryNeil Roberts2011-07-1148-1106/+1552
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The GL or GLES library is now dynamically loaded by the CoglRenderer so that it can choose between GL, GLES1 and GLES2 at runtime. The library is loaded by the renderer because it needs to be done before calling eglInitialize. There is a new environment variable called COGL_DRIVER to choose between gl, gles1 or gles2. The #ifdefs for HAVE_COGL_GL, HAVE_COGL_GLES and HAVE_COGL_GLES2 have been changed so that they don't assume the ifdefs are mutually exclusive. They haven't been removed entirely so that it's possible to compile the GLES backends without the the enums from the GL headers. When using GLX the winsys additionally dynamically loads libGL because that also contains the GLX API. It can't be linked in directly because that would probably conflict with the GLES API if the EGL is selected. When compiling with EGL support the library links directly to libEGL because it doesn't contain any GL API so it shouldn't have any conflicts. When building for WGL or OSX Cogl still directly links against the GL API so there is a #define in config.h so that Cogl won't try to dlopen the library. Cogl-pango previously had a #ifdef to detect when the GL backend is used so that it can sneakily pass GL_QUADS to cogl_vertex_buffer_draw. This is now changed so that it queries the CoglContext for the backend. However to get this to work Cogl now needs to export the _cogl_context_get_default symbol and cogl-pango needs some extra -I flags to so that it can include cogl-context-private.h
* Move the cogl texture driver functions to a vtableNeil Roberts2011-07-0813-337/+419
| | | | | | | The texture driver functions are now accessed through a vtable pointed to by a struct in the CoglContext so that eventually it will be possible to compile both the GL and GLES texture drivers into a single binary and then select between them at runtime.
* cogl-context: Remove the driver private dataNeil Roberts2011-07-084-81/+0
| | | | | | | | | | Since the GL function pointers have move to the root of CoglContext, the driver specific data for GLES became empty and the GL data had only one varible which apparently nothing was using. It's therefore convenient to remove the private driver data to make it easier to have a build of Cogl which enables both GL and GLES support. If we ever need driver private data later we might want to use cogl_object_set_user_data instead.
* Use all core GL functions through indirect pointersNeil Roberts2011-07-0831-828/+989
| | | | | | | | | cogl-ext-functions.h now contains definitions for all of the core GL and GLES functions that we would normally link to directly. All of the code has changed to access them through the cogl context pointer. The GE macro now takes an extra parameter to specify the context because the macro itself needs to make GL calls but various points in the Cogl source use different names for the context variable.
* Move all of the GL function pointers directly to CoglContextNeil Roberts2011-07-0730-858/+750
| | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of storing all of the feature function pointers in the driver specific data of the CoglContext they are now all stored directly in CoglContext. There is a single header containing the description of the functions which gets included by cogl-context.h. There is a single function in cogl-feature-private.c to check for all of these functions. The name of the function pointer variables have been changed from ctx->drv.pf_glWhatever to just ctx->glWhatever. The feature flags that get set when an extension is available are now separated from the table of extensions. This is necessary because different extensions can mean different things on GLES and GL. For example, having access to glMapBuffer implies read and write support on GL but only write support on GLES. The flags are instead set in the driver specific init function by checking whether the function pointers were successfully resolved. _cogl_feature_check has been changed to assume the feature is supported if any of the listed extensions are available instead of requiring all of them. This makes it more convenient to specify alternate names for the extension. Nothing else had previously listed more than one name for an extension so this shouldn't cause any problems.
* cogl-pipeline: Fix reference counting on promoting weak parentsNeil Roberts2011-07-061-18/+21
| | | | | | | | | | | | | | | | | | 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>
* cogl-internal: remove COGL_PRIVATE_FEATURE_EGL flagsRobert Bragg2011-07-051-3/+1
| | | | | | | | 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>
* egl: look for EGL_IMAGE_FROM_X11_PIXMAP as winsys featureRobert Bragg2011-07-051-2/+5
| | | | | | | | | | 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>
* egl: fix tracking of priv features in check_egl_extensionsRobert Bragg2011-07-051-1/+1
| | | | | | | | | 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>
* docs: update cogl-context 2.0 docsRobert Bragg2011-07-042-3/+1
| | | | | | | | | | 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>
* docs: Adds missing cogl_framebuffer syms to referenceRobert Bragg2011-07-042-0/+75
| | | | | | | 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>
* framebuffer: Add _get_XYZ_bits() functionsRobert Bragg2011-07-044-60/+68
| | | | | | | | 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>
* doc: Adds missing cogl_matrix syms to 2.0 referenceRobert Bragg2011-07-041-2/+7
| | | | | | | 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>
* matrix: Adds cogl_matrix_is_identity APIRobert Bragg2011-07-044-0/+24
| | | | | | | 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>