summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Add support for RG texturesNeil Roberts2014-01-205-0/+104
| | | | | | | | | | | | | | | | | | This adds COGL_PIXEL_FORMAT_RG_88 and COGL_TEXTURE_COMPONENTS_RG in order to support two-component textures. The RG components for a texture is only supported if COGL_FEATURE_ID_TEXTURE_RG is advertised. This is only available on GL 3, GL 2 with the GL_ARB_texture_rg extension or GLES with the GL_EXT_texture_rg extension. The RG pixel format is always supported for images because Cogl can easily do the conversion if an application uses this format to upload to a texture with a different format. If an application tries to create an RG texture when the feature isn't supported then it will raise an error when the texture is allocated. https://bugzilla.gnome.org/show_bug.cgi?id=712830 Reviewed-by: Robert Bragg <robert@linux.intel.com>
* remove internal_format and redundant error argumentsRobert Bragg2014-01-0128-92/+65
| | | | | | | | | | | | | | | | Texture allocation is now consistently handled lazily such that the internal format can now be controlled using cogl_texture_set_components() and cogl_texture_set_premultiplied() before allocating the texture with cogl_texture_allocate(). This means that the internal_format arguments to texture constructors are now redundant and since most of the texture constructors now can't ever fail the error arguments are also redundant. This now means we no longer use CoglPixelFormat in the public api for describing the internal format of textures which had been bad solution originally due to how specific CoglPixelFormat is which is missleading when we don't support such explicit control over the internal format. Reviewed-by: Neil Roberts <neil@linux.intel.com>
* Fix calculating the bounds when clipping from a primitiveNeil Roberts2013-12-031-1/+1
| | | | | | | | When projecting the bounding rectangle of a primitive it was using the modelview matrix twice instead of the modelview and projection matrices so it was coming out with garbage. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* Add a test for cogl_framebuffer_push_path_clipNeil Roberts2013-12-033-1/+71
| | | | | | | | | | | The test makes an L-shaped path that fills the whole framebuffer except for the top right quadrant. It then clips to that and tries to fill the framebuffer with a rectangle. Then it verifies that all of the quadrants have the expected colour. This is currently failing due to a bug in the primitive clipping. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* Declare interface types as void and remove cast macrosRobert Bragg2013-11-2724-84/+89
| | | | | | | | | | | | | | | | | | This declares the interface types CoglFramebuffer, CoglBuffer, CoglTexture, CoglMetaTexture and CoglPrimitiveTexture as void when including the public cogl.h header so that users don't have to use lots of C type casts between instance types and interface types. This also removes all of the COGL_XYZ() type cast macros since they do nothing more than compile time type casting but it's less readable if you haven't seen that coding pattern before. Unlike with gobject based apis that use per-type macros for casting and performing runtime type checking we instead prefer to do our runtime type checking internally within the front-end public apis when objects are passed into Cogl. This greatly reduces the verbosity for users of the api and may help reduce the chance of excessive runtime type checking that can sometimes be a problem.
* Add API to control per-framebuffer depth writingHans Petter Jansson2013-10-281-0/+20
| | | | | | | | | | | | | | | Add framebuffer methods cogl_framebuffer_[gs]et_depth_write_enabled() and backend bits to pass the state on to glDepthMask(). This allows us to enable or disable depth writing per-framebuffer, which if disabled saves us some work in glClear(). When rendering, the flag is combined with the pipeline's depth writing flag using a logical AND. Depth writing is enabled by default. https://bugzilla.gnome.org/show_bug.cgi?id=709827 Reviewed-by: Robert Bragg <robert@linux.intel.com>
* conform: check we invalidate ancestor cached stateRobert Bragg2013-10-143-0/+96
| | | | | | | | | | | | | | | | | In the cases where we cache vertex state with an ancestor pipeline (whose vertex processing state is equivalent) we need to invalidate that state if that ancestor is later modified. This conformance test checks this case but currently fails because we only notify the progend directly associated with the pipeline being changed. In this case the pipeline can be using a different progend to the ancestor which it is caching state with so when the ancestor is changed it needs to notify all the progends that they may need to clear their private state. Reviewed-by: Neil Roberts <neil@linux.intel.com>
* tests: use 'FIXME' instead of 'fail' for expected failuresRobert Bragg2013-09-061-2/+2
| | | | | | | | | | | Seeing 'fail' in the test reports and the explanation that it means "Test failed, but it was an expected failure" somewhat gives the impression that these failures are ok. Actually these failures represent known bugs/issues that we haven't yet fixed but we don't want them to result in 'make check' ailing. To try and better reflect the severity of these issues we now report them as 'FIXME'. Reviewed-by: Neil Roberts <neil@linux.intel.com>
* Fix generating the unit test wrappers when building with MingW32Neil Roberts2013-09-021-1/+1
| | | | | | | | | | | | For some reason the unit test symbols end up in the read-only data section when building on windows rather than the initialised data section so they have a different letter in the list generated by nm. They also begin with an underscore because windows likes to add underscores to symbols for some reason. This patch changes the regular expressions in the code to generate the wrapper list so that it accepts either way. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* Fix building the conformance and unit tests on mingw32Neil Roberts2013-09-022-3/+1
| | | | | | | | | | | | | The unit tests were failing to build with mingw32 because the libtest-fixtures was being included both by libcogl and the test-conformance and test-unit executables. That meant that the symbols were defined twice and it wouldn't link. The rule which depends on test-unit being built needs to be called test-unit.exe on Windows so this patch fixes it to use the $(EXEEXT) variable to get the right name. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* Add a conformance test for using cogl_point_coord in a shaderNeil Roberts2013-09-022-19/+66
| | | | | | | | | This adds a modification to the test-point-sprite test which uses a shader snippet which directly references cogl_point_coord instead of relying on cogl_pipeline_set_layer_point_sprite_coords_enabled to replace the texture coordinates with the point coords. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* gl: bind position attribute to location 0Robert Bragg2013-08-191-19/+26
| | | | | | | | | | | | | | | | | | | | | | | | | Full GL treats the position attribute specially and requires that it must be bound to generic attribute location 0 unlike GLES 2.0 or GL 3.2 core. We now make sure to unconditionally bind the cogl_position_in attribute to location 0 before linking any glsl program in cogl. For reference the relevant part of the GL 3.0 spec that covers these semantics is Section 2.7 "Vertex Specification" pg 27 After this change there was one remaining problem in test-custom-attributes where the test_short_verts() test was using its own "pos" attribute instead of cogl_position_in and so cogl wasn't able to ensure it would be bound to location 0. This updates the test to use cogl_position_in but to work around the fact that glVertexPointer doesn't support UNSIGNED_SHORT components we force the test to use the glsl backend by setting a shader snippet on the pipeline. https://bugs.freedesktop.org/show_bug.cgi?id=67548 Reviewed-by: Neil Roberts <neil@linux.intel.com>
* offscreen: rename _new_to_texture to _new_with_textureRobert Bragg2013-08-167-10/+10
| | | | | | | | | | | This renames cogl_offscreen_new_to_texture to cogl_offscreen_new_with_texture. The intention is to then cherry-pick this back to the cogl-1.16 branch so we can maintain a parallel cogl_offscreen_new_to_texture() function which keeps the synchronous allocation semantics that some clutter applications are currently relying on. Reviewed-by: Neil Roberts <neil@linux.intel.com>
* framebuffer: remove attribute drawing apisRobert Bragg2013-07-152-43/+42
| | | | | | | | Almost nothing draws attributes directly and for those things that do it's trivial to adapt them to instead draw via the cogl_primitive api. This simplifies the Cogl api a bit. Reviewed-by: Neil Roberts <neil@linux.intel.com>
* Add _primitive_draw to replace _framebuffer_draw_primitiveRobert Bragg2013-07-157-20/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | When splitting out the CoglPath api we saw that we would be left with inconsistent drawing apis if the drawing apis in core Cogl were lumped into the cogl_framebuffer_ api considering other Cogl sub-libraries or that others will want to create higher level drawing apis outside of Cogl but can't use the same namespace. So that we can aim for a more consistent style this adds a cogl_primitive_draw() api, comparable to cogl_path_fill() or cogl_pango_show_layout() that's intended to replace cogl_framebuffer_draw_primitive() Note: the attribute and rectangle drawing apis are still in the cogl_framebuffer_ namespace and this might potentially change but in these cases there is no single object representing the thing being drawn so it seems a more reasonable they they live in the framebuffer namespace for now. Note: the cogl_framebuffer_draw_primitive() api isn't removed by this patch so it can more conveniently be cherry picked to the 1.16 branch so we can mark it deprecated for a short while. Even though it's marked as experimental api we know that there are people using the api so we'd like to give them a chance to switch to the new api. Reviewed-by: Neil Roberts <neil@linux.intel.com>
* tests: stop using cogl-auto-texture apisRobert Bragg2013-07-1118-128/+120
| | | | | | | | | | | | | | | | | | The plan is to remove the cogl-auto-texture apis since they hide a bit too much from developers but currently the conformance tests depend on these apis in numerous places. For the conformance tests it makes some sense to continue using high level texture apis similar to the auto-texture apis since we may want to make broad variations to how textures are allocated as part of the testing running if that might help exercise more code paths. This patch copies much of the auto-texture functionality into some slightly more special purpose utilities in test-utils.c/h. Minor changes include being constrained to the public Cogl api and they also don't let you catch CoglErrors and just assume they should abort on error. Reviewed-by: Neil Roberts <neil@linux.intel.com>
* Install conformance testsMatthias Clasen2013-07-092-0/+27
| | | | | | | | | 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>
* Don't include cogl/cogl.h from test-utils.hNeil Roberts2013-07-042-4/+3
| | | | | | | | | | | | | | | 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>
* build: Fix make distRico Tzschichholz2013-07-031-2/+1
| | | | Reviewed-by: Neil Roberts <neil@linux.intel.com>
* Set G_DEBUG=fatal-warnings in run-tests.shNeil Roberts2013-06-211-0/+8
| | | | | | | | | | | | We want any run-time warnings to cause the conformance tests to fail. We are currently setting G_DEBUG in test_utils_init and this would previously cause the fatal-warnings debug option to be set. However since commit 47444dac of glib this no longer works because the environment variable is read in a magic constructor of libglib so it is too late to try to set it there. This patch makes it also set it in run-tests.sh to avoid the problem. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* Fix freeing an atlas texture that hasn't been allocatedNeil Roberts2013-06-131-1/+1
| | | | | | | | | | The free function for atlas textures was previously always assuming that there will be a valid sub_texture pointer but this might not be the case if the texture was never successfully allocated. This was causing Cogl to crash if the application tries to make a texture that can not fit in the atlas using the automagic texture API. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* Add test that Cogl doesn't crash when freeing unallocated textureNeil Roberts2013-06-133-0/+88
| | | | | | | | | It looks like Cogl doesn't currently clean up an unallocated atlas texture properly so if it fails to allocate it. It will then crash when it is freed. This adds a conformance test to verify that all of the various texture types can be freed without allocating them. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* Use GModule instead of libdl to load unit test symbolsNeil Roberts2013-06-121-3/+6
| | | | | | | | | | | | | | | | | Previously the unit tests were using libdl without directly linking to it. It looks like this ends up working because one of Cogl's dependencies ends up pulling adding -ldl via libtool. However in some configurations it looks like this wasn't happening. To avoid this problem we can just use GModule to resolve the symbols. g_module_open is documented to return a handle to the ‘main program’ when NULL is passed as the filename and looking at the code it seems that this ends up using RTLD_DEFAULT so it will have the same effect. The in-tree copy of glib already has the code for gmodule so this shouldn't cause problems for --disable-glib. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* Separate out CoglPath api into sub-libraryRobert Bragg2013-06-123-2/+11
| | | | | | | | | | | | | | | | | | | | | | | This splits out the cogl_path_ api into a separate cogl-path sub-library like cogl-pango and cogl-gst. This enables developers to build Cogl with this sub-library disabled if they don't need it which can be useful when its important to keep the size of an application and its dependencies down to a minimum. The functions cogl_framebuffer_{fill,stroke}_path have been renamed to cogl_path_{fill,stroke}. There were a few places in core cogl and cogl-gst that referenced the CoglPath api and these have been decoupled by using the CoglPrimitive api instead. In the case of cogl_framebuffer_push_path_clip() the core clip stack no longer accepts path clips directly but it's now possible to get a CoglPrimitive for the fill of a path and so the implementation of cogl_framebuffer_push_path_clip() now lives in cogl-path and works as a shim that first gets a CoglPrimitive and uses cogl_framebuffer_push_primitive_clip instead. We may want to consider renaming cogl_framebuffer_push_path_clip to put it in the cogl_path_ namespace. Reviewed-by: Neil Roberts <neil@linux.intel.com>
* Add support for per-vertex point sizesNeil Roberts2013-06-073-0/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a new function to enable per-vertex point size on a pipeline. This can be set with cogl_pipeline_set_per_vertex_point_size(). Once enabled the point size can be set either by drawing with an attribute named 'cogl_point_size_in' or by writing to the 'cogl_point_size_out' builtin from a snippet. There is a feature flag which must be checked for before using per-vertex point sizes. This will only be set on GL >= 2.0 or on GLES 2.0. GL will only let you set a per-vertex point size from GLSL by writing to gl_PointSize. This is only available in GL2 and not in the older GLSL extensions. The per-vertex point size has its own pipeline state flag so that it can be part of the state that affects vertex shader generation. Having to enable the per vertex point size with a separate function is a bit awkward. Ideally it would work like the color attribute where you can just set it for every vertex in your primitive with cogl_pipeline_set_color or set it per-vertex by just using the attribute. This is harder to get working with the point size because we need to generate a different vertex shader depending on what attributes are bound. I think if we wanted to make this work transparently we would still want to internally have a pipeline property describing whether the shader was generated with per-vertex support so that it would work with the shader cache correctly. Potentially we could make the per-vertex property internal and automatically make a weak pipeline whenever the attribute is bound. However we would then also need to automatically detect when an application is writing to cogl_point_size_out from a snippet. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* build: fix building test-gles2-contextRobert Bragg2013-06-061-0/+1
| | | | | This makes sure we build the conform tests with -I$(top_builddir)/cogl to be able to find cogl-gl-header.h
* units: remove test-bitmask and add UNIT_TEST insteadRobert Bragg2013-06-063-201/+1
| | | | | | | This moves the code in test-bitmask into a UNIT_TEST() directly in cogl-bitmask.c which will now be run as a tests/unit/ test. Reviewed-by: Neil Roberts <neil@linux.intel.com>
* tests: Adds our first white-box unit testRobert Bragg2013-06-0610-543/+205
| | | | | | | | | | | | | | | | | | This adds a white-box unit test that verifies that GL_BLEND is disabled when drawing an opaque rectangle, enabled when drawing a transparent rectangle and then disabled again when drawing a transparent rectangle but with a blend string that effectively disables blending. This shares the test utilities and launcher infrastructure we are using for conformance tests so we get consistent reporting and so unit tests will be run against a range of different drivers. This adds a --enable-unit-tests configure option which is enabled by default but if disabled will make all UNIT_TESTS() into static inline functions that we should expect the compiler to discard since they won't be referenced by anything. Reviewed-by: Neil Roberts <neil@linux.intel.com>
* conform: Add color attribute based blending testRobert Bragg2013-05-305-0/+98
| | | | | | | | | | This adds a test to make sure that if the same pipeline is used to draw two primitives, one which doesn't need blending because it has an opaque color associated, and another using a color attribute that requires blending then Cogl should recognize that it needs to enable blending for the second primitive even though the pipeline hasn't changed. Reviewed-by: Neil Roberts <neil@linux.intel.com>
* tests: Add a test for the RGB <-> HSL functionsDamien Lespiau2013-05-293-0/+47
| | | | Reviewed-by: Robert Bragg <robert@linux.intel.com>
* Adds initial Emscripten support to CoglRobert Bragg2013-05-291-2/+10
| | | | | | | | | | | | | | | | | | This enables basic Emscripten support in Cogl via the SDL winsys. Assuming you have setup an emscripten toolchain you can configure Cogl like this: emconfigure ./configure --enable-debug --enable-emscripten Building the examples will build .html files that can be loaded directly by a WebGL enabled browser. Note: at this point the emscripten support has just barely been smoke tested so it's expected that as we continue to build on this we will learn about more things we need to change in Cogl to full support this environment. Reviewed-by: Neil Roberts <neil@linux.intel.com>
* Add fence APIDaniel Stone2013-05-285-1/+75
| | | | | | | | | | | | | | | cogl_framebuffer_add_fence creates a synchronisation fence, which will invoke a user-specified callback when the GPU has finished executing all commands provided to it up to that point in time. Support is currently provided for GL 3.x's GL_ARB_sync extension, and EGL's EGL_KHR_fence_sync (when used with OpenGL ES). Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Neil Roberts <neil@linux.intel.com> Reviewed-by: Robert Bragg <robert@linux.intel.com> https://bugzilla.gnome.org/show_bug.cgi?id=691752
* Add $(LIBM) to the LDADD for all of the examples and testsNeil Roberts2013-04-232-2/+10
| | | | | | | | | | | | | Some of the examples and tests are using functions from -lm. With some linkers, if we don't expicitly link against it an error will be reported. This patch adds the library to all of the examples even though not all of them use math functions because I don't think it will do any harm and it will save us having to remember to add it if an example later starts using some math functions. https://bugzilla.gnome.org/show_bug.cgi?id=697330 Reviewed-by: Robert Bragg <robert@linux.intel.com>
* Remove support for luminance texturesNeil Roberts2013-04-152-13/+0
| | | | | | | | | | | Luminance textures have been removed in GL3 so it is difficult to support them on the GL3 driver unless we use the texture swizzle extension like we do for alpha textures. However, it doesn't seem like it would be worth the effort because we haven't yet hit a case in practice where alpha textures wouldn't suffice in place of luminance textures. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* pipeline-cache: Use a special trimmed down pipeline for the keyNeil Roberts2013-04-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | When a pipeline is added to the cache, a normal copy would previously be made to use as the key in the hash table. This copy keeps a reference to the real pipeline which means all of the resources it contains are retained forever, even if they aren't necessary to generate the hash. This patch changes it to create a trimmed down copy that only has the state necessary to generate the hash. A new function called _cogl_pipeline_deep_copy is added which makes a new pipeline that is directly a child of the root pipeline. It then copies over the pertinent state from the original pipeline. The pipeline state is copied using the existing _cogl_pipeline_copy_differences function. There was no equivalent function for the layer state so I have added one. That way the pipeline key doesn't have the texture data state and it doesn't hold a reference to the original pipeline so it should be much cheaper to keep around. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* Conformance test to check whether the pipeline cache holds texturesNeil Roberts2013-04-043-0/+95
| | | | | | | | | | | | | | | Currently when a unique pipeline is created and added to the pipeline cache that pipeline will live forever which includes keeping a reference to any large resources that the pipeline has such as textures. These textures don't actually need to be kept for the pipeline to be used as a key in the hash table so ideally we wouldn't do this. This test case tries rendering with a pipeline that has textures and then checks whether the textures are successfully destroyed after the pipeline is unreffed. The test is currently marked as a known failure because the pipeline cache will prevent them from being destroyed. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* Prune redundant pipeline ancestry after adding a layer differenceNeil Roberts2013-03-181-1/+1
| | | | | | | | | | | | | | | Adding a layer difference may mean the pipeline overrides all of the layers of its parent which might make the parent redundant so we should try to prune the hierarchy. This is particularly important for CoglGst because whenever a new frame is ready it tries to make a copy of the pipeline it last used and then replace all of the textures in the layers. Without this patch the new pipeline would keep the parent pipeline alive which means also keeping the old textures alive so all of the frames of the video would effectively be leaked. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* Add test to verify replacing a layer doesn't leak the pipeline parentNeil Roberts2013-03-183-0/+124
| | | | | | | | | | | | | | | | | | | | | | | The current recommendation for pipelines is that once they have been used for painting then they should be considered immutable. If you want to modify a pipeline you should instead make a copy and unref the original pipeline. Internally we try to check whether the modified copy replaces all of the properties of the parent and prune a redundant ancestor hierarchy. Pruning the hierarchy is particularly important if the pipelines contain textures because otherwise the textures may be leaked when the parent pipeline keeps a reference to it. This test verifies that usage pattern by creating a chain of pipeline copies each with their own replacement texture. Some user data is then set on the textures with a callback so that we can verify that once the original pipelines are destroyed then the textures are also destroyed. The test is currently failing because Cogl doesn't correctly prune ancestory for layer state authority. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* Add fragment and vertex snippet hooks for global declarationsNeil Roberts2013-02-261-3/+111
| | | | | | | | | | | | | | | | | This adds hook points to add global function and variable declarations to either the fragment or vertex shader. The declarations can then be used by subsequent snippets. Only the ‘declarations’ string of the snippet is used and the code is directly put in the global scope near the top of the shader. The reason this is necessary rather than just adding a normal snippet with the declarations is that for the other hooks Cogl assumes that the snippets are independent of each other. That means if a snippet has a replace string then it will assume that it doesn't even need to generate the code for earlier hooks which means the global declarations would be lost. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* win32: Minor build fixes for building for win32Neil Roberts2013-02-211-1/+0
| | | | | | | | | | | | | | | | | | This fixes some minor errors and warnings that were preventing Cogl building with mingw32: • cogl-framebuffer-gl.c was not including cogl-texture-private.h. Presumably something else ends up including that when building for GLX. • The WGL winsys was not including cogl-error-private.h • A call to strsplit in the WGL winsys was wrong. • For some reason the test-wrap-rectangle-textures test was trying to include the GDKPixbuf header. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* journal: Dirty the modelview matrix state when flushingNeil Roberts2013-02-191-1/+1
| | | | | | | | | | | The journal manually flushes its own modelview matrix state so it needs to mark the state as dirty so that if a primitive is drawn with the same matrix state as the last primitive it will correctly reflush it. https://bugzilla.gnome.org/show_bug.cgi?id=693612 Reviewed-by: Robert Bragg <robert@linux.intel.com>
* Add a test to check interleaving primitives and the journalNeil Roberts2013-02-193-0/+129
| | | | | | | | | | | | | | | This adds a conformance test which draws a rectangle using the journal in-between two rectangles drawn with primitives without changing any other state. Currently this is failing because the modelview matrix state is not correctly flushed. The journal also flushes in own clip state so the test additionally puts everything in a clip and verifies that that worked. This is not currently broken but we might as well test it. https://bugzilla.gnome.org/show_bug.cgi?id=693612 Reviewed-by: Robert Bragg <robert@linux.intel.com>
* conform: explicitly check value of boolean env varsRobert Bragg2013-02-151-2/+30
| | | | | | | | | | | | | For the boolean environment variables that affect the running of the conformance tests we now explicitly check the value of those variables so that "0", "off" and "false" (upper or lower case) will be considered as FALSE instead of just interpreting set as TRUE and unset as FALSE. If the value is set to something entirely spurious then we abort with a warning message. Thanks to Artie Eoff for suggesting this change. https://bugzilla.gnome.org/show_bug.cgi?id=693894 Reviewed-by: Neil Roberts <neil@linux.intel.com>
* avoid redundant idle if using FRAME_SYNC to throttleRobert Bragg2013-02-151-1/+1
| | | | | | | This updates the examples and test-journal which now use the _FRAME_SYNC events to throttle rendering so that they don't install a redundant idle handler to paint when they get a FRAME_SYNC event and instead they now directly paint when the event is received.
* test-journal: use new _add_frame_callback apiRobert Bragg2013-02-151-13/+11
| | | | | | This updates test-journal to use the new cogl_onscreen_add_frame_callback() api to use _SYNC events for throttling.
* test-gles2-context: Read pixels using GL_RGBA not GL_RGBNeil Roberts2013-02-081-6/+6
| | | | | | | | | The GLES2 spec only guarantees calling glReadPixels with GL_RGBA and an implementation specific format. Mesa seems to now reject reading with GL_RGB so the test had started failing. This fixes it to just read using GL_RGBA. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* test-gles2-context: Use test_utils_compare_pixel instead of g_assertsNeil Roberts2013-02-081-15/+5
| | | | | | | | test_utils_compare_pixel makes the error report slightly easier to read because it displays the values for the whole pixel instead of reporting that there was a difference somewhere. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* Don't set GL_TEXTURE_MAX_LEVEL on GLESNeil Roberts2013-01-251-1/+3
| | | | | | | | | | | | GL_TEXTURE_MAX_LEVEL is not supported on GLES so we can't set it. It looks like Mesa was letting us get away with this but on other drivers it may cause errors. The enum is not defined in the GLES headers so it was failing to compile unless the GL driver is also enabled. The test-texture-mipmap-get-set test is now marked as n/a on GLES2 because it can't support limiting the sampled mipmaps. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* test-write-texture-formats: Add fuzziness to the pixel comparisonsNeil Roberts2013-01-213-11/+39
| | | | | | | | | | | | | The rounding used when storing 10-bit per component data into an 8-bit per component texture seems to have changed in recent versions of Mesa which was causing this test to fail. I've also noticed this failing on the NVidia binary driver. This patch adds some fuzziness to the comparison so that it will pass. There is a new test_utils function called test_utils_compare_pixel_and_alpha which is the same as test_utils_compare_pixel except that it also compares the alpha component. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* tests: Mark test_framebuffer_get_bits as only working on GLNeil Roberts2013-01-211-1/+3
| | | | | | | | | | | It looks like it's not meant to be valid to create a framebuffer with an alpha-only texture as a render target on GLES. Since the following Mesa commit, this requirement is now enforced so that the test_framebuffer_get_bits test fails: http://cgit.freedesktop.org/mesa/mesa/commit/?id=cf300eaa Reviewed-by: Robert Bragg <robert@linux.intel.com>