Install the conformance tests, and metadata to run them
with gnome-desktop-testing-runner.
https://bugzilla.gnome.org/show_bug.cgi?id=702942
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit 53f3eb421239982b69569ad03ccbfa4b4f601cf3)
This allows to easily caculate shades of the same color or pick colors
with the same saturation/luminance. In short, all sorts of interesting
things.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit edcbeaf3c941f7a2335fbec47d5248cd9b0e8088)
This adds cogl_wayland_renderer_set_event_dispatch_enabled() which can
be used to prevent Cogl from adding the socket for the Wayland display
to its list of file descriptors to poll. This can be used in
applications that want to integrate Cogl with existing code that is
reading from the Wayland socket itself.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit f5b8d98676ab3e90ad80459019c737ec2ff90aa4)
The Wayland 1.0 protocol supports multiple independent components querying the
available interfaces by retreiving their own wl_registry object so the
application doesn't need to pass them down anymore.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit 8ca36a1d1ab7236fec0f4d7b7361ca96e14c32be)
The idea with the framebuffer allocation is that it will lazily
allocate so that if you don't want to handle errors then you don't
have to be aware that there is an allocation step. In order for this
to work any accessors that get data that is only available after
allocation should implicitly allocate the framebuffer. This patch
makes that change for cogl_wayland_onscreen_get_surface and
cogl_wayland_onscreen_get_shell_surface.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit 0c4ba78787323fedd162d7b71b86b460908b9b98)
cogl_wayland_onscreen_get_surface previously only worked if the
onscreen had a foreign surface on it. However there is no reason why
this shouldn't also work fine for manipulating the surface that Cogl
created as well. We may want to consider adding a separate getter for
the foreign surface that can be used before the framebuffer is
allocated.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit 6bc12947a51224b70525893143bfe421723ce255)
wl_resource may become an opaque type in future so we should probably
be using the accessors instead of directly prodding into the struct.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit 8ab07725734b8b2151470cc44bb3f88798ac5538)
The version of gbm can sometimes be suffixed with ‘-devel’. This was
making the GBM_MICRO define come out as 0-devel which was generating a
warning when it was used in a #if check. This patch makes it chop off
anything after a ‘-’ using sed.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit 64472027fb5750971e94c0b4c6c624a39e5abe2f)
This is no longer generated so it was breaking the build when the docs
are enabled.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit 67b976cdc9bc44976c7c18fac0e872a1746de21d)
Otherwise make distcheck was breaking.
Thanks to Rico Tzschichholz for pointing this out.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit d47b4d92187b9eb1b34998e02b96955afdd84a6e)
There was a circular depedency when building from a fresh git clone
where test-fixtures needs to be built before the cogl directory, but
test-fixtures also indirectly includes cogl-enum-types.h which is only
generated when building the cogl directory. If we change the header to
just include specific cogl headers instead of cogl/cogl.h then we can
break the circular dependency.
This needs a tweak to test-no-gl-header because that first undefines
COGL_COMPILATION before including test-utils.h. However it doesn't
really do any actual work so we can get away without including it.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit adb26bd13a48ed571ef4cae4de005e039b34e361)
CoglFixed was trying to use the __FLOAT_WORD_ORDER macro in order to
do some fast float conversions but it wasn't including any header that
could define it so it was giving an annoying warning. This patch
checks for the macro in endian.h in the configure script and only
checks its value if it's available.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
Commit 839cf49763 changed the inline ARM assembler so that it
won't be used when targetting the Thumb instruction set. I manually
applied the patch but I messed up the #if so it was generating a
warning.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
The 1.x branch needs to use some of the deprecated API internally in
order to set up some deprecated state. This was causing a lot of
annoying warnings so instead we'll just disable the deprecation
attribute when COGL_COMPLIATION is defined.
It probably wouldn't be a good idea to apply this to the 2.0 branch
because at least for now we want to get warnings if we accidentally
use deprecated API internally.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
Since the Wayland server support has been updated to use wl_shm_buffer
we need the latest git version of Wayland to build. Previously the
configure.ac file only had one define for the minimum version of both
the client-side and server-side support but as they are now different
this patch splits them out.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit 75d62292fc268164f8a085225033abe17e59ba1c)
wl_client_add_resource has been deprecated in the Wayland API in
favour of wl_client_add_object which returns a pointer to a
wl_resource which it allocates instead of the compositor having to
embed it in a larger struct. As far as I understand the idea is to
eventually make wl_resource completely opaque. This patch changes
Cogland accordingly.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit adb971954757dffb9ddecf8c9091b96756424800)
The Wayland server API has changed so that wl_shm_buffer is no longer
a type of wl_buffer and it instead must be retrieved directly from the
resource.
cogl_wayland_texture_2d_new_from_buffer now takes a resource pointer
instead of directly taking a wl_buffer and it will do different things
depending on whether it can get a wl_shm_buffer out of the resource
instead of trying to query the buffer type.
Cogland has also been updated so that it tracks a resource for buffers
of surfaces instead of directly tracking a wl_buffer. This are pointed
to by a new CoglandBuffer struct which can be referenced by a
CoglandBufferReference. The WL_BUFFER_RELEASE event will be posted
when the last reference to the buffer is removed instead of directly
whenever a new buffer is attached. This is similar to how Weston
works.
https://bugzilla.gnome.org/show_bug.cgi?id=702999
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit 9b35e1651ad0e46ed489893b60563e2c25457701)
Conflicts:
examples/cogland.c
Previously Cogl would only call wl_display_flush after doing a swap
buffers on the onscreen because that is the only place where Cogl
itself would end up queueing requests. However since commit
323fe188748 Cogl takes control of calling wl_display_dispatch as well
which effectively makes it very difficult for the application to
handle the Wayland event queue itself. Therefore it needs to rely on
Cogl to do it which means that other parts of the application may also
queue requests that need to be flushed.
This patch tries to copy the display fd handling of window.c in the
Weston example clients. wl_display_flush will always be called in
prepare function for the fd which means it will always be called
before going idle. If flushing the display causes the socket buffer to
become full, it will additionally poll for write on the FD to try
flushing again when it becomes empty.
We also need to call wl_display_dispatch_pending in the prepare
because apparently calling eglSwapBuffers can cause it to read data
from the FD to receive events for a different queue. In that case
there will be events that need to be handled but the FD will no longer
be ready for reading so we won't wake up the main loop any other way.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit 962d1825105a87dd8358a765353b77f6af8fe760)
_cogl_poll_rendererer_modify_fd can be used internally to modify the
event mask on an FD to be polled. This will be used in the Wayland
backend to start blocking on write whenever flushing the display fills
the socket's buffer. Modifying the FD's events causes the poll age to
increase.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit 8bc0df53ee508687b87e547c1cbac5e8d7d5fc80)
Eventually the Wayland winsys will want to do useful work in its
prepare callback before the main loop goes idle. Previously
cogl_poll_renderer_get_info would stop calling any further prepare
functions if it found one with a zero timeout. That would mean the
Wayland prepare function might not get called before going idle in
some cases. This patch changes it so that it continues to call all of
the prepare functions regardless of the timeout.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit 02f7fa538c9d2b383fa0f601177140b571ecf315)
If we don't do this then it might leak connections to the display if
multiple different renderers are tried.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit 8e5b4d40a4d960d0d20927d30ee68a37387fe776)
When a primitive is drawn with an attribute that contains texture
coordinates Cogl will fetch the corresponding layer in order to
determine the unit number. However if the pipeline didn't actually
have a layer it would end up redundantly creating it. It's probably
not a good idea to be modifying the pipeline while flushing the
attributes state so this patch makes it pass the no-create flag to the
get_layer function and then skips out enabling the attribute if the
layer didn't already exist.
https://bugzilla.gnome.org/show_bug.cgi?id=702570
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit 7507ad1a55a2aeb5beb8c0e3343e1e1f2805ddde)
When a layer is added to a pipeline without setting a texture it ends
up sampling from a default 1x1 texture which is meant to be solid
white. However for some reason we were creating the texture with 0
opacity which is effectively an invalid premultiplied colour. This
would make the blending behave oddly if it was used.
https://bugzilla.gnome.org/show_bug.cgi?id=702570
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit 2ffc77565fb6395b986d3274f8bdb6eee6addbf9)
Unlike in GError, the policy in Cogl for when NULL is passed as the
CoglError argument is that the program should abort with a fatal
error. Previously however any errors that were being propagated were
being silently dropped if the application passed NULL. This patch
fixes it to also log a fatal error in that case.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit 41e233b4b27de579f77b82115cf43a618bf0c93f)
This adds several utility apis that aim to make it as easy as possible
for an application to determine what size a video should be drawn at.
The important detail here is that these apis take into account the
pixel-aspect-ratio in addition to the video's own aspect ratio.
This patch updates the cogl-basic-video-player example to use the
cogl_gst_video_sink_fit_size() api to perform letterboxing.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit d26f17c97ff6b9f6d6211e0527d5965a85305a56)
Previously cogl_gst_video_sink_attach_frame returned the last layer
used by the sink. This can also be retrieved via
cogl_gst_video_sink_get_free_layer so I don't think it's necessary to
return it here and it seems kind of out of place.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit 0805f3e9db715fc2c97b7e60d4f3a25e7fa598fc)
These are just internal convenience macros to define the GObject
properties so they shouldn't be in the public headers.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit b7b861aa87ad05a2c253afdd87323acd82fd988f)
Adds documentation comments to CoglGstVideoSink and makes it generate
a separate manual to contain it.
One thing that I wasn't able to figure out with this was how to get
the documentation to have correct references to the main Cogl docs.
You can pass arguments to gtkdoc-fixxref to point to other manuals,
but presumably this needs the installed locations and when the
Cogl-Gst documentation is generated the Cogl docs may not have been
installed yet.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit 5acdf8db47311893a9cf9ea04a66a287b657b8b0)
This declaration was a leftover from a previous iteration of the
CoglGST patches.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit 53ae6d39efa113e28f5d1177ccb8613ddf28ee43)
These functions are used when attaching frames at a start point other
than layer 0 is required. This could potentially be used to "layer"
videos and textures on top of each other in the CoglPipeline. This
layering could come handy if videos are used as alpha masks or normal
maps, or when arranging layers in a perticular order, so Cogl could
blend them nicely without extra hassle.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit f98b437c9ea79f04ef1ebbb6ff547f58b49b0008)
Previously, when CoglGST generated the default sampling snippet it
would set the replace string so that Cogl wouldn't generate any
redundant code for the other layers. However this also meant that it
wouldn't modulate with the default colour. This patch changes it to
set the combine mode on all of the layers to REPLACE(PREVIOUS) so that
it just copies the previous layer without generating any texture
sampling. That way the fragment snippet for the final layer can just
modulate the previous value with the video sampling function. This
makes it possible to set a color on the pipeline and have it modulate
the video. Also if we eventually add a way to insert layers before the
GST sampling layer then it can modulate with those.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit f5da8d2caf4b2fbaf6941642a5d5ea7b93d0dd0f)
This is an inappropriately pessimistic remark for the header of
CoglGstVideoSink.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit ce2a70165054fea3e9d992c14650ba8cccf60e97)
Luminance textures are not supported on GL3 and as the textures are
accessed via a shader anyway it doesn't seem like it should make much
difference which component the single-component textures are in. Cogl
already has code to fake alpha textures via the texture swizzle
extension on GL3.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit ca1666860a325fa4d2362cdd38297d6281e997d8)
Instead of hardcoding the version number “0.0” it now uses the version
number from the Cogl source. The web address has been changed to
cogl3d.org.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit 5363e4a68da9811fb136a01b278846ce15913287)
• Fixes some overly long lines, hugging asterisks in the pointer type
declarations and indentation issues.
• Tidies up the GLSL source so that it will look nicer in the
debug output.
• Removes the backwards ‘parent_class’ define which hacks the
implementation of the G_DEFINE_TYPE macro and just uses the full
type name instead.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit 3ffe8979da4d4dc7deb221e5653b6f24f41b412c)
There were a few hugging pointer asterisks and inconsistent newlines for
a prototype which this patch tweaks.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit 488c074316b270b17d1000c68f26210108b1b0ca)
The experimental HW decode path was adapted from clutter-gst based on
some experimental gstreamer api. This path was disabled by upstream
gstreamer developers back in september last year due to instabilities.
Without understanding how the experimental api is implemented it seems
rather strange to be plucking out the GL handle of a cogl texture and
passing that to some unknown gstreamer code which would presumably
somehow have to use the same GL context as Cogl to be able to do
something with that texture. For now we can strip all of this unused
code and it would be easy enough to re-instate later if it's useful.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit 2a24cb9f2a283af87bb685b3e9c7e3af1ffeab6e)
CoglGst is a GStreamer integration library that facilitates
video playback using the Cogl API. It works by retrieving
each video frame from the GStreamer pipeline and attaching
it to a Cogl pipeline in the form of a Cogl texture along
with possible color model conversion shaders. The pipeline
is then retrieved by the user during each draw. An example
use of the CoglGst API is included in the examples directory.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit dfb94cf4b0b6b42d6465df362a0c0af780596890)