| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Instead of having our own USING_EMSCRIPTEN define, we now just rely on
emcc's EMSCRIPTEN define.
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
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().
|
|
|
|
|
| |
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'.
|
| |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
This makes some of the texture vfuncs optional to simplify adding new
texture types.
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
There was some internal testing code lying unused in
cogl-blending-string.c so this adapts it into a unit test.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Since it's not possible to build Clutter against Cogl master it doesn't
make sense to have any Clutter specific code.
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Rig uses a patched version of SDL maintained at:
https://github.com/rig-project/sdl.git
|
|
|
|
|
| |
This splits out the list of build dependencies for Cogl into a
Makefile.sources file that could be shared with other build systems.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
This simply removes a couple of eglib apis that aren't needed by Cogl
and the corresponding tests.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
This fixes a few build issues with compiling Cogl against our internal
deps/glib and deps/gmodule libraries.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
This upgrades stb_image to 1.33 which notably fixes some problems with
inconsistently using #if and #ifdef to check the STBI_SIMD define.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Reviewed-by: Neil Roberts <neil@linux.intel.com>
|