This makes a start on porting the Cogl conformance tests that currently
still live in the Clutter repository to be standalone Cogl tests that no
longer require a ClutterStage.
The main thing is that this commit brings in is the basic testing
infrastructure we need, so now we can port more and more tests
incrementally.
Since the test suite wants a way to synchronize X requests/replies and
we can't simply call XSynchronize in the test-utils code before we know
if we are really running on X this adds a check for an environment
variable named "COGL_X11_SYNC" in cogl-xlib-renderer.c and if it's set
it forces XSynchronize (dpy, TRUE) to be called.
By default the conformance tests are run off screen. This makes the
tests run much faster and they also don't interfere with other work you
may want to do by constantly stealing focus. CoglOnscreen framebuffers
obviously don't get tested this way so it's important that the tests
also get run on screen every once in a while, especially if changes are
being made to CoglFramebuffer related code. On screen testing can be
enabled by setting COGL_TEST_ONSCREEN=1 in your environment.
The line "#define cogl_display_get_rendrer cogl_display_get_rendrer_EXP"
should read
"#define cogl_display_get_renderer cogl_display_get_renderer_EXP"...
https://bugzilla.gnome.org/show_bug.cgi?id=658333
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
Cogl requires gobject and gmodule API, so we need to check for these and
add them to the pkg-config files as dependencies, otherwise building
Cogl with --as-needed (like modern distributions now do) will cause
build errors.
https://bugzilla.gnome.org/show_bug.cgi?id=656809
Reviewed-by: Robert Bragg <robert@linux.intel.com>
This adds a new function, cogl_framebuffer_get_color_format() to be able
to query the common pixel format for any color buffers attached to a
given CoglFramebuffer. For example an offscreen framebuffer created
using cogl_offscreen_new_to_texture() would have a format matching the
texture.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
If the user doesn't explicitly pass an onscreen template then instead of
leaving display->onscreen_template as NULL we now instantiate a template
ourselves. This simplifies winsys code that might want to refer to the
template since it needn't first check for a NULL pointer.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
All our experimental Cogl symbols have a corresponding #define to add
"_EXP" to the end of the symbol name, but those defines are often
positioned right after the corresponding gtk-doc comment and before
the symbol definition which means the generated documentation ends up
refering to the define and not the real definition. This tidies up
cogl-texture-2d.h and moves all the defines to be be before the gtk-doc
comments.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
Whenever a texture lookup is performed for a layer the result is now
stored in a variable and used repeatedly instead of generating the
code for the lookup every time it is accessed. This means for example
when using the INTERPOLATE function with a texture lookup for the
third parameter it will only generate one texture lookup instead of
two.
https://bugzilla.gnome.org/show_bug.cgi?id=656426
Reviewed-by: Robert Bragg <robert@linux.intel.com>
This patch changes it so that code for each layer is generated on
demand instead of directly in the add_layer implementation. The
pipeline only explicitly generates code for the last layer. If this
layer references the result from any other layers, these will also be
recursively generated. This means that if a layer is using 'REPLACE'
then it won't redundantly generate the code for the previous
layers.
The result for each layer is generated into a variable called layer%i
where %i is the layer index (not the unit index). Therefore to get the
result from layer n we just have to refer to the varible layern.
https://bugzilla.gnome.org/show_bug.cgi?id=656426
Reviewed-by: Robert Bragg <robert@linux.intel.com>
Instead of calling _cogl_texutre_prepare_for_upload in
cogl_texture_set_region_from_bitmap the call is now deferred to the
implementation of the virtual for set_region. This is needed if the
texture backend is using a different format for the actual GL texture
than what is reported by cogl_texture_get_format. This happens for
example with atlas textures which report the original internal format
specified when the texture was created but actually always store the
data in an RGBA texture.
Also when creating an atlas texture from a bitmap it was preparing the
bitmap to be uploaded to the original format instead of the format of
the actual texture used for the atlas. Then it was using
cogl_texture_set_region_from_bitmap to upload the 5 pieces to make the
copies of the edge pixels. This would end up converting the image to
the actual format 5 times. The atlas textures have now been changed to
prepare the bitmap for the right format.
https://bugzilla.gnome.org/show_bug.cgi?id=657840
Reviewed-by: Robert Bragg <robert@linux.intel.com>
The crate example uses the cogl_pango API and perviously we just
explicitly said to link with the libcogl-pango.la but that doesn't seem
to be enough (not really sure why since libtool should know the required
dependencies to brining in for linking) so we now pass
$(COGL_PANGO_DEP_LIBS) when linking the crate demo.
https://bugzilla.gnome.org/show_bug.cgi?id=656441
for a blend string like:
"RGBA=ADD(SRC_COLOR, SRC_COLOR * (DST_COLOR[A]))"
it was awkward that we were requiring developers to explicitly put
redundant brackets around the DST_COLOR[A] blend factor. The parser has
been updated so now braces are only required for factors like
"(1-SRC_COLOR[A])"
Reviewed-by: Neil Roberts <neil@linux.intel.com>
Add a method on the renderer to know how many texture image units are
accessible from fragment shaders.
https://bugzilla.gnome.org/show_bug.cgi?id=657347
Reviewed-by: Robert Bragg <robert@linux.intel.com>
This function was not used in the opengl pipeline, probably because of
the more precise get_max_activable_texture_units().
Remove it then.
https://bugzilla.gnome.org/show_bug.cgi?id=657347
Reviewed-by: Robert Bragg <robert@linux.intel.com>
When using glib-android, it's not possible to select parts of the
library you want to initialize anymore. Plus it was decided that argc
and argv are useless as you basically don't start applications with
command line arguments on Android.
https://bugzilla.gnome.org/show_bug.cgi?id=655791
Reviewed-by: Robert Bragg <robert@linux.intel.com>
This file is generated by:
android update project -p . -t $i
but it needs to have the name changed to the application name and thus
needs to be checked in.
https://bugzilla.gnome.org/show_bug.cgi?id=655792
Reviewed-by: Robert Bragg <robert@linux.intel.com>
Similar to the widely used gluLookAt API, this adds a CoglMatrix utility
for setting up a view transform in terms of positioning a camera/eye
position that points to a given object position aligned to a given
world-up vector.
Reviewed-by: Neil Roberts <neil@linux.intel.com>