summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* emscripten: rely on emcc's EMSCRIPTEN definewip/rigRobert Bragg2014-06-133-4/+3
| | | | | Instead of having our own USING_EMSCRIPTEN define, we now just rely on emcc's EMSCRIPTEN define.
* sdl2: return a CoglError instead of calling c_errorRobert Bragg2014-06-131-2/+10
| | | | | | This avoids calling c_error while initializing the sdl2 winsys when no user-event number has been allocated for cogl. This error isn't fatal so the code now throws a CoglError instead.
* test-utils: support testing with sdlRobert Bragg2014-06-131-5/+22
|
* Remove support for CoglTextureRectangleRobert Bragg2014-06-1339-1772/+114
| | | | | | | | | | | | TextureRectangle used to be useful for supporting X11 texture from pixmap on older ATI cards without full NPOT texture support and theoretically it was there to help at times when it's preferable to access a texture with non-normalized coordinates. More recent versions of glsl now offer a way to sample texture with non-normalized coordinates and so in practice this feature represents quite a lot of code and special cases for non-normalized coordinates for basically zero benefit.
* Use the EGL_KHR_surfacless_context extensionNeil Roberts2014-06-138-71/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | The surfaceless context extension can be used to bind a context without a surface. We can use this to avoid creating a dummy surface when the CoglContext is first created. Otherwise we have to have the dummy surface so that we can bind it before the first onscreen is created. The main awkward part of this patch is that theoretically according to the GL and GLES spec if you first bind a context without a surface then the default state for glDrawBuffers is GL_NONE instead of GL_BACK. In practice Mesa doesn't seem to do this but we need to be robust against a GL implementation that does. Therefore we track when the CoglContext is first used with a CoglOnscreen and force the glDrawBuffers state to be GL_BACK. There is a further awkward part in that GLES2 doesn't actually have a glDrawBuffers state but GLES3 does. GLES3 also defaults to GL_NONE in this case so if GLES3 is available then we have to be sure to set the state to GL_BACK. As far as I can tell that actually makes GLES3 incompatible with GLES2 because in theory if the application is not aware of GLES3 then it should be able to assume the draw buffer is always GL_BACK. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* Add a COGL_EXT_IN_GLES3 option to specify extensions that are in GLES3Neil Roberts2014-06-136-42/+92
| | | | | | | | | | Some features that were previously available as an extension in GLES2 are now in core in GLES3 so we should be able to specify that with the gles_availability mask of COGL_EXT_BEGIN so that GL implementations advertising GLES3 don't have to additionally advertise the extension for us to take advantage of it. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* Add cogl_poll_renderer_dispatch_fd apiRobert Bragg2014-06-112-0/+46
| | | | | | This adds a cogl_poll_renderer_dispatch_fd function for dispatching any work associated with just a single fd returned by cogl_poll_renderer_get_info().
* Rename ulib to clib ready for merging into rigRobert Bragg2014-06-11298-10983/+4769
| | | | | The 'u' prefix has turned out to be problematic since it clashes with the lib ICU namespace and can also be confused with meaning 'unsigned'.
* ulib: fix linking with libiconv if requiredRobert Bragg2014-05-163-12/+12
|
* support glsl >= 1.3 with varying/attribute deprecatedRobert Bragg2014-05-168-39/+96
| | | | | | | This adds support for glsl >= 1.3 where the varying and attribute keywords were removed. This makes cogl emit compatibility defines for the new in and out keywords so we can use these consistently across all versions of glsl.
* gl: consider min glsl ver. of 1.3 with GL 3.1 core profileRobert Bragg2014-05-161-5/+22
| | | | | | | | When we're using GL 3 we always request a GL 3.1 core profile context which corresponds to supporting glsl >= 1.3 and so this patch makes sure we won't request glsl 1.2 in this case. This is required to use Cogl on later versions of OSX.
* fragend-glsl: avoid re-getting the shader stateRobert Bragg2014-04-011-29/+49
| | | | | | | | | This reduces how often we have to get the shader state for a pipeline while generating the code for each layer of the pipeline. This also separates looking up the corresponding layer state with a layer index from the codegen code. This would allow us to avoid redundant index based lookups if we were to start generating code for layers that aren't used internally.
* pipeline: don't free BigState before we might dereference itRobert Bragg2014-03-261-3/+3
|
* pango: include cogl-texture-private.h for _get_format() apiRobert Bragg2014-03-241-3/+2
|
* Remove support for GL's legacy fixed function apisRobert Bragg2014-03-2430-1707/+439
| | | | | | | | | This removes the GL fixed function vertend, fragend and progend since we don't have any need to support non programmable GPUs and since it reduces the number of code paths we maintain. This adds "nop" backends so that for now, we continue to keep support internally for selecting pipeline backends at runtime.
* Remove ARBfp supportRobert Bragg2014-03-2417-1280/+36
| | | | | | For simplicity we would like to only support GLSL based progends even though it's still quite possible that the ARBfp backend may be slightly faster in some cases.
* Remove OpenGL ES 1.1 supportRobert Bragg2014-03-2439-611/+203
| | | | | | We haven't depended on OpenGL ES 1.1 support for years now and if we can remove the need to support GL's legacy fixed function apis then we may simplify some parts of Cogl.
* texture: make some texture vfuncs optionalRobert Bragg2014-03-242-5/+14
| | | | | This makes some of the texture vfuncs optional to simplify adding new texture types.
* bitmap: avoid unsigned intRobert Bragg2014-03-243-9/+9
| | | | | We generally avoid using the unsigned int C type in the Cogl api due to the trouble that it can lead to due to C's implicit casting rules.
* xlib: remove deprecated apisRobert Bragg2014-03-245-170/+4
| | | | | | | | | This removes some deprecated cogl_xlib_ code that depends on a global CoglContext. Note: we keep cogl-xlib.h as a top-level header for xlib specific apis. Since we now have no longer include cogl-xlib.h internally this slightly simplifies the guarding inside the header to trigger an error from now on if the header is use internally, as we do for cogl.h.
* texture-pixmap-x11: avoid depending on _GET_CONTEXTRobert Bragg2014-03-246-40/+47
| | | | | | | This updates cogl-texture-pixmap-x11.c so it no longer depends on a global CoglContext. This also avoids depending on the deprecated cogl_xlib_ api that depends on COGL_GET_CONTEXT() in favour of the cogl_xlib_renderer_ API.
* blend-string: Avoid using _COGL_GET_CONTEXTRobert Bragg2014-03-244-15/+22
| | | | | | | | Although this just moves the _GET_CONTEXT() into the cogl-pipeline code, it means we have one less component in cogl depending on a global context. CoglPipeline is one of the only remaining components that heavily depends on a global context and will probably be the last component we tackle.
* blend-string: Expose internal test code as unit testRobert Bragg2014-03-241-56/+80
| | | | | There was some internal testing code lying unused in cogl-blending-string.c so this adapts it into a unit test.
* bitmap-conversion: Avoid using _COGL_GET_CONTEXT()Robert Bragg2014-03-241-2/+1
|
* framebuffer: update docs for _get_depth_texture()Robert Bragg2014-03-241-7/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This clarifies in the documentation for cogl_framebuffer_get_depth_texture() that if a depth texture is added as a layer to a pipeline and sampled then depth values should be read from the red component and that all other components are undefined. It depends on the version of OpenGL, and what profile is selected whether sampling depth textures behaves like sampling a luminance texture (L,L,L,1) or a component red texture (R,0,0,1). In particular I was caught out by this issue in Rig where we were referencing the .z component of shadow map textures, and this had worked ok until updating to a recent version of mesa which has updated its behaviour. The relevant mesa commit is: 678ac190a5a6fd39b8568587fac28 Reading the mailing list discussion that happened around that patch it looks like Kenneth Graunke investigated the different variations so for posterity it could be handy note them here: Apparently it works like this: - Core: RED - Forward Compatible: RED - Compatibility or <= 3.0: LUMINANCE - ES2 with OES_depth_texture: LUMINANCE - ES3 for unsized formats: RED - ES3 for sized formats: LUMINANCE
* cogl-gst: add cogl_gst_video_sink_get_natural_size() apiRobert Bragg2014-03-242-0/+119
| | | | | | | This adds api for querying a "natural" width and height for a video which has the correct aspect ratio for displaying on square, 1:1 pixels. The natural size is the minimum size where downscaling is not required.
* basic-video-player: don't try and sample mipmapRobert Bragg2014-03-241-16/+0
| | | | | | | | | | Since we don't generate a mipmap chain for uploaded video frames this avoids setting the min filter to COGL_PIPELINE_FILTER_LINEAR_MIPMAP_LINEAR. Since COGL_PIPELINE_FILTER_LINEAR is the default and since it is also dubious that cogl-basic-video-player is directly manipulating layers that are conceptually internal to cogl-gst this removes the loop that updates the filtering for cogl-gst layers.
* Enable building without gtk-doc, e.g. on OSXRobert Bragg2014-03-242-7/+1
|
* sdl2: fix GL driver selectionRobert Bragg2014-03-241-4/+16
| | | | | | | SDL2 supports selecting between full OpenGL or OpenGL ES 1/2 but our selection code was written before SDL 2.0 was officially released and since then a new SDL_GL_CONTEXT_PROFILE_MASK attribute was added and we have to explicitly set the SDL_GL_CONTEXT_MINOR_VERSION attribute.
* Remove some leftover references to ClutterRobert Bragg2014-03-2417-2020/+2
| | | | | Since it's not possible to build Clutter against Cogl master it doesn't make sense to have any Clutter specific code.
* update cogl.doapRobert Bragg2014-03-241-6/+34
|
* Update Cogl description in README.inRobert Bragg2014-03-241-14/+26
|
* check if we need to explicitly link with a libiconv libraryRobert Bragg2014-03-241-1/+10
| | | | | | This is also careful to check whether locale_charset() is available in the case that we are explicitly linking to libiconv otherwise since it may not be enough to just check for the localcharset.h header.
* Adds CoglAtlasSet and CoglAtlas apisRobert Bragg2014-03-2019-520/+1227
| | | | | | | | | | | This enables applications to more closely manage their own texture atlases via a CoglAtlasSet api. A CoglAtlasSet represents a set of CoglAtlases and a CoglAtlas represents one large texture that is subdivided into smaller "allocations". The intention is to enable functionality like cogl-pango to be implemented outside of Cogl; specifically to allow Rig to handle its own glyph caches for text rendering.
* examples: Add a new SDL2 based Android exampleRobert Bragg2014-03-2028-0/+1502
| | | | | | | This adds another examples/android project that uses SDL instead of glib. The example itself is a copy of examples/cogl-sdl2-hello.c which includes basic input handling to move a triangle around the screen.
* sdl2: Add android supportRobert Bragg2014-03-201-1/+29
| | | | | | | | | | | | | | This adds Android support to the SDL2 winsys. Unlike some other window systems, Android's SDL2 backend only allows you to create one window. Since the Cogl SDL2 winsys creates a "dummy" window when setting up the display (so we have something to bind a GL context to) it wasn't then possible to create a CoglOnscreen framebuffer for rendering. This updates the winsys so that the first CoglOnscreen framebuffer created will actually refer to the dummy window we created earlier. Note: it doesn't matter that we request the dummy window to have a 1x1 size, and request for it to be hidden because these are overridden by SDL's Android backend.
* configure: check for sdl2-rig instead of sdl2 pkg-config fileRobert Bragg2014-03-201-2/+2
| | | | | Rig uses a patched version of SDL maintained at: https://github.com/rig-project/sdl.git
* build: split out list of deps into Makefile.sourcesRobert Bragg2014-03-202-369/+396
| | | | | This splits out the list of build dependencies for Cogl into a Makefile.sources file that could be shared with other build systems.
* Tightly integrate ulib (was eglib)Robert Bragg2014-03-20316-7331/+7308
| | | | | | | | | | | | | | Instead of maintaining optional support for using deps/eglib instead of glib we now always use this code. This way the code is always being tested so we are less likely to break support for building Cogl without glib, and because the api no longer needs to be swappable we are free to make Cogl specific changes to the api. So that we can still support glib integration the eglib library has been renamed to ulib and symbols are prefixed with 'u_' or 'U_' so that they don't clash with glib. GLib integration for GError and GType continues to be supported.
* eglib: simplify compiler checksRobert Bragg2014-03-204-184/+75
| | | | | | | | | | | This removes a number of ./configure time compiler checks in favour of compile time checks and also assumes you are building with a modern compiler. For example we assume <stdint.h> and <inttypes.h> headers are available. These changes will make it easier to maintain the ability to build Cogl on Android via an Android.mk file where it's not usual to use the build system to check compiler features.
* eglib: remove unused gpattern and gmarkup apisRobert Bragg2014-03-207-1009/+3
| | | | | This simply removes a couple of eglib apis that aren't needed by Cogl and the corresponding tests.
* eglib: remove some redundant filesRobert Bragg2014-03-2017-2653/+5
| | | | | | The eglib as found in the mono git repository can be built separately from the rest of mono, but to avoid maintaining parallel build scripts for eglib this strips away the autotool related files from deps/eglib.
* Add deps/eglib library from the mono projectRobert Bragg2014-03-20193-38604/+23443
| | | | | | | | | | | | | This adds a deps/eglib api which is a small MIT licensed library that is api compatible with enough of the glib api to run Cogl. This replaces deps/glib and deps/gmodule for use when Cogl is built with --enable-standalone. This code is based on eglib from the mono project, with a few updates and additions to handle apis that Cogl uses that mono doesn't. As a reference point for monitoring eglib changes in the mono project, this code is based on commit d50c836721f22df74a45185d51d0b9d37c370e33
* standalone: Fix building standaloneRobert Bragg2014-03-203-12/+8
| | | | | This fixes a few build issues with compiling Cogl against our internal deps/glib and deps/gmodule libraries.
* gmacros: Use _Static_assert for G_STATIC_ASSERTRobert Bragg2014-03-201-3/+6
| | | | | | This now simply defines G_STATIC_ASSERT in terms of _Static_assert if __GNUC__ is defined, and disables the assertion if not. This stops lots of verbose compiler warnings caused by the previous typedef based approach.
* stb_image: upgrade to version 1.33Robert Bragg2014-03-201-1291/+2076
| | | | | This upgrades stb_image to 1.33 which notably fixes some problems with inconsistently using #if and #ifdef to check the STBI_SIMD define.
* Fix _COGL_RETURN_VAL_IF_FAIL return type warningRobert Bragg2014-03-201-1/+1
| | | | | | This fixes a warning by making the _COGL_RETURN_VAL_IF_FAIL check in _cogl_offscreen_gl_allocate return FALSE not NULL, since the api returns a CoglBool not a pointer.
* cogl-gst: allocate textures synchronouslyRobert Bragg2014-03-201-3/+10
| | | | | | | | | | | | | This makes sure video textures being uploaded via video_texture_new_from_data are allocated before the function returns. This function create a CoglBitmap to wrap the data from gstreamer and by allowing cogl to allocate the texture lazily it's possible that the data being pointed to by the bitmap won't remain valid until we actually come to allocate the texture. Note: we don't simply use cogl_texture_2d_[sliced_]new_from_data() here because we need to be able to call cogl_texture_set_premultiplied() before allocating the texture.
* Set COGL_WINSYS_FEATURE_BUFFER_AGE on EGLNeil Roberts2014-03-141-0/+5
| | | | | | | | | | | This winsys feature flag is exposed via the deprecated cogl_clutter_winsys_has_feature function and Clutter is curently relying on it. Previously the EGL winsys was only setting the internal COGL_EGL_WINSYS_FEATURE_BUFFER_AGE flag and there was no mapping to the public flag. Therefore the feature would only be used on GLX. This patch just adds the mapping. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* cogl-winsys-egl-kms: Make sure to close our connection to DRM at shutdownJasper St. Pierre2014-03-121-0/+3
| | | | Reviewed-by: Neil Roberts <neil@linux.intel.com>