Commit Graph

6 Commits

Author SHA1 Message Date
Neil Roberts
9a8a26270c test-write-texture-formats: Add fuzziness to the pixel comparisons
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>

(cherry picked from commit ce626fb3939b0f200d85ccdf32809608b879212d)
2013-01-22 18:00:11 +00:00
Robert Bragg
fa62fe2a4f tests: update inline with master
This renames the global ctx and fb variables to test_ctx and test_fb
respectively in line with the names use on the master branch. This is to
make it easier to cherry pick patches from master.
2013-01-22 17:48:06 +00:00
Damien Lespiau
4bff97bb1d tests: Don't use g_test_verbose() as cogl doesn't use GTest anymore
But use cogl_test_verbose() instead.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit 77efc7428d9ad18c2db1e3fdb544efa091249eaf)
2013-01-22 17:47:24 +00:00
Robert Bragg
54735dec84 Switch use of primitive glib types to c99 equivalents
The coding style has for a long time said to avoid using redundant glib
data types such as gint or gchar etc because we feel that they make the
code look unnecessarily foreign to developers coming from outside of the
Gnome developer community.

Note: When we tried to find the historical rationale for the types we
just found that they were apparently only added for consistent syntax
highlighting which didn't seem that compelling.

Up until now we have been continuing to use some of the platform
specific type such as gint{8,16,32,64} and gsize but this patch switches
us over to using the standard c99 equivalents instead so we can further
ensure that our code looks familiar to the widest range of C developers
who might potentially contribute to Cogl.

So instead of using the gint{8,16,32,64} and guint{8,16,32,64} types this
switches all Cogl code to instead use the int{8,16,32,64}_t and
uint{8,16,32,64}_t c99 types instead.

Instead of gsize we now use size_t

For now we are not going to use the c99 _Bool type and instead we have
introduced a new CoglBool type to use instead of gboolean.

Reviewed-by: Neil Roberts <neil@linux.intel.com>

(cherry picked from commit 5967dad2400d32ca6319cef6cb572e81bf2c15f0)
2012-08-06 14:27:39 +01:00
Robert Bragg
3881fd3259 Adds cogl_framebuffer_draw_[*_]rectangle functions
This adds experimental 2.0 api replacements for the cogl_rectangle[_*]
functions that don't depend on having a current pipeline set on the
context via cogl_{set,push}_source() or having a current framebuffer set
on the context via cogl_push_framebuffer(). The aim for 2.0 is to switch
away from having a statefull context that affects drawing to having
framebuffer drawing apis that are explicitly passed a framebuffer and
pipeline.

To test this change several of the conformance tests were updated to use
this api instead of cogl_rectangle and
cogl_rectangle_with_texture_coords. Since it's quite laborious going
through all of the conformance tests the opportunity was taken to make
other clean ups in the conformance tests to replace other uses of
1.x api with experimental 2.0 api so long as that didn't affect what was
being tested.
2012-03-20 12:33:40 +00:00
Neil Roberts
b85f2e907a tests: Add a test which writes all pixel formats
This adds a test similar to the test-read-texture-formats test but
that updates data on a 1x1 pixel RGBA texture instead. On GLES2 this
should end up testing all of the convesion code because in that case
GL only supports reading back RGBA data.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2012-03-05 17:44:52 +00:00