This verifies that calling cogl_texture_get_data returns the same data
uploaded to the texture. The bottom quarter of the texture is replaced
using cogl_texture_set_region. It tries creating the texture with
different sizes and flags in the hope that it will hit different
texture backends.
This greatly speeds up running all the conformance tests by no longer
delaying many of the tests for a number of dummy frames to be painted.
We used to skip frames because we thought there was a problem with the
driver's glReadPixels implementation. Although we have seen driver
issues at times the real reason the delay was needed was because
resizing the stage usually happens asynchronously (because a non
synchronous X request is used by clutter_stage_set_size()). We now force
all X requests to be synchronized for the conformance tests so this is
no longer a problem and we can avoid these hacks.
This makes test-timeline get the default stage so there is at least one
stage instantiated. Without any stages the master clock will never run
which was causing this test to fail.
The report generation was broken by the split of the various test units;
also, we were using GTest in a way that's not really sanctioned by
upstream.
This commit tries to re-use the targets from GLib's Makefile rules while
compensating for our own set up.
Normally the asynchronous nature of X means that setting the clutter
stage size may really happen an indefinite amount of time later but
since the tests are so short lived and may only render a single frame
this is not an acceptable semantic.
This way we should be able to remove all the hacky sleeps and frame
count delays from our tests.
Since we now run every test in a separate process there is no need to
try and avoid state leakage between tests. This removes the code to
cleanup all children of the stage and disconnect handlers from the
stage paint signal. We now explicitly print a warning if the users tries
to run multiple tests in one process.
In the .json file used for the test, there is no null -> "base"
transition defined only a "clicked" -> "base", when the "clicked" state
is removed the "base" state will also disappear.
I was fed up to cd into the tests/conform or tests/interactive directories
to launch a specific test. Now, with the power the abs_ variants of
builddir and srcdir we can run specific test from any directory.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2159
This allows you to tell Cogl that you are planning to replace all the
buffer's data once it is mapped with cogl_buffer_map. This means if the
buffer is currently being accessed by the GPU then the driver doesn't
have to stall and wait for it to finish before it can access it from the
CPU and can instead potentially allocate a new buffer with undefined
data and map that.
There was a missing '* 4' and '* i' in the for() loops that initialized
the first test buffer, so it was containing uninitialized data causing
the test to fail.
Since CoglPixelBuffer was renamed to CoglPixelArray the test entry point
was also renamed to test_cogl_pixel_array, but mistakenly the
corresponding test-conform-main.c change wasn't pushed at the same time.
This removes cogl_pixel_array_new which just took a size in bytes.
Without the image size and pixel format then the driver often doesn't
have enough information to allocate optimal GPU memory that can be
textured from directly. This is because GPUs often have ways to
spatially alter the layout of a texture to improve cache access patterns
which may require special alignment and padding dependant in the images
width, height and bpp.
Although currently we are limited by OpenGL because it doesn't let us
pass on the width and height when allocating a PBO, the hope is that we
can define a better extension at some point.
The usage hint should be implied by the CoglBuffer subclass type so the
public getter and setter APIs for manually changing the usage hint of a
CoglBuffer have now been removed.
This creates a path with an outer clockwise and two internal sub
paths, one clockwise and one counter-clockwise. The path is then
painted twice, once with each fill rule.
The -rdynamic linker option is specific to ELF so it was breaking
builds on systems with other object formats such as Windows and
Solaris. This patch replaces that option with -export-dynamic which is
a portable libtool option which should do the right thing on each
platform.
http://bugzilla.clutter-project.org/show_bug.cgi?id=1930
This adds a separate variable name "CLUTTER_SONAME_INFIX" to define the
infix for the clutter library that gets linked. Currently the WINSYS
corresponds to the directory we enter when building to compile the
window system and input support, but it is desirable to be able to
define multiple flavours that use the same WINSYS but should result in
different library names.
For example we are planning to combine the eglx and eglnative window
systems into one "egl" winsys but we will need to preserve the current
library names for the eglx and eglnative flavours.
This redirects the legacy depth testing APIs through CoglMaterial and
adds a new experimental cogl_material_ API for handling the depth
testing state.
This adds the following new functions:
cogl_material_set_depth_test_enabled
cogl_material_get_depth_test_enabled
cogl_material_set_depth_writing_enabled
cogl_material_get_depth_writing_enabled
cogl_material_set_depth_test_function
cogl_material_get_depth_test_function
cogl_material_set_depth_range
cogl_material_get_depth_range
As with other experimental Cogl API you need to define
COGL_ENABLE_EXPERIMENTAL_API to access them and their stability isn't
yet guaranteed.
This test breaks out into raw OpenGL to create a RECTANGLE texture so it
needs to be careful not to trample on any state that may be cached by
Cogl internally.
Layout properties work similarly to child properties, with the added
headache that they require the 3-tuple:
( layout manager, container, actor )
to be valid in order to be inspected, parsed and applied. This means
using the newly added back-pointer from the container to the layout
manager and then rejigging a bit how the ScriptParser handles the
unresolved properties.
Similarly to the child properties, which use the "child::" prefix, the
layout manager properties use the "layout::" prefix and are defined with
the child of a container holding a layout manager.
This adds a boolean "pick-with-alpha" property to ClutterTexture and when
true, it will use the textures alpha channel to define the actors shape when
picking.
Users should be aware that it's a bit more expensive to pick textures like
this (so probably best not to blindly enable it on *all* your textures)
since it implies rasterizing the texture during picking whereas we would
otherwise just send a solid filled quad to the GPU. It will also interrupt
the internal batching of geometry for pick renders which can otherwise often
be done in a single draw call.
The drawing code from test_invalid_texture_layers which draws a
rectangle, a polygon and a vertex buffer has been split out to
separate function. test_using_all_layers now also uses this so that it
will also test the other two primitives. This causes the test to fail
when all of the layers are drawn using a vertex buffer.
http://bugzilla.openedhand.com/show_bug.cgi?id=2132
GLES 2 doesn't have GL_MAX_TEXTURE_UNITS. Instead the cogl backend
uses GL_MAX_TEXTURE_IMAGE_UNITS with a maximum limit of 16. The same
restriction is now used in the test.
This adds a simple test for ClutterCairoTexture that draws two
rectangles to the cairo surface in an idle callback and then verifies
that they appeared at the right colours in the paint callback. If that
succeeds then the second time the idle callback is invoked it will
replace one of the rectangles with a sub region update and the
following paint callback will again verify the rectangles.
Instead of asking gtester to run ./test-conformance directly we now tell
it to run a list of wrapper scripts. This results in each test being
spawned in a separate process avoiding leakage of state between tests
which has been a big problem with the conformance tests for quite a
while now.
Otherwise it seems that rounding errors will cause the fragments at
the edge of the quad to blend with neighbouring quarters of the
texture which cause the test to fail.
A few of the tests connected to the paint signal but never
disconnected it. Most of these handlers had a call to g_main_quit in
them which meant that it could sometimes cause subsequent tests to
exit after the first frame is painted. Most of the tests don't
validate any of the results until after a couple of frames have been
rendered so this ended up skipping out the test entirely.
To workaround this the test setup function now disconnects all
handlers for the paint signal on the default stage before the test is
run.
The on_paint function for test-cogl-readpixels tries to temporarily
set the projection, modelview and viewport to its own values. However
it was never restoring the saved values so it could affect the results
of subsequent tests.
This adds a test which creates a material using the maximum number of
layers. All of the layers are assigned a white texture except the last
which is set to red. The default combine mode is used for all of the
layers so the final fragment should end up red.
Currently Cogl doesn't provide a way to query the maximum number of
layers so it just uses glGetIntegerv instead. This might cause
problems on GLES 2 because that adds additional restrictions on the
number of layers.
http://bugzilla.openedhand.com/show_bug.cgi?id=2064
This changes the original tests so that it splits the original path
into two sub paths. When adding a new block to the copied path it also
adds another sub path. This further stresses the path copying
mechanism and exposes a bug.
It also tests intersections by drawing a self-intersecting path and a
path with two sub-paths that overlap. Where the path overlaps it
should be inverted.
This renders a texture using different combinations of wrap modes for
the s and t coordinates and then verifies that the expected wrapping
is acheived. The texture is drawn using rectangles, polygons and
vbos. There is also code to test a rectangle using an atlased texture
(which should test the manual repeating) however the validation for
this is currently disabled because it doesn't work.
http://bugzilla.openedhand.com/show_bug.cgi?id=2063
This tests various paths drawing rectangles and verifies that the
expected pixels are filled in. Some of the paths are drawn by copying
an existing path and modifying it which should test the copy-on-write
code.
The test creates a GL_TEXTURE_RECTANGLE_ARB texture using
cogl_texture_new_from_foreign and confirms that rendering it works
correctly. If the rectangle texture extension isn't available then
this test always succeeds.
http://bugzilla.openedhand.com/show_bug.cgi?id=2015
cogl_read_pixels() no longer asserts that the format passed in is
RGBA_8888 but instead accepts any format. The appropriate GL enums for
the format are passed to glReadPixels so OpenGL should be perform a
conversion if neccessary.
It currently assumes glReadPixels will always give us premultiplied
data. This will usually be correct because the result of the default
blending operations for Cogl ends up with premultiplied data in the
framebuffer. However it is possible for the framebuffer to be in
whatever format depending on what CoglMaterial is used to render to
it. Eventually we may want to add a way for an application to inform
Cogl that the framebuffer is not premultiplied in case it is being
used for some special purpose.
If the requested format is not premultiplied then Cogl will convert
it. The tests have been changed to read the data as premultiplied so
that they won't be affected by the conversion. Picking in Clutter has
been changed to use COGL_PIXEL_FORMAT_RGB_888 because it doesn't need
the alpha component. clutter_stage_read_pixels is left unchanged
because the application can't specify a format for that so it seems to
make most sense to store unpremultiplied values.
http://bugzilla.openedhand.com/show_bug.cgi?id=1959