Commit Graph

3 Commits

Author SHA1 Message Date
Robert Bragg
6436cd073d Declare interface types as void and remove cast macros
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.

(cherry picked from commit 248a76f5eac7e5ae4fb45208577f9a55360812a7)

Since we can't break the 1.x api this version of the patch actually
defines compatible NOP macros within deprecated/cogl-type-casts.h
2013-11-27 19:33:44 +00:00
Robert Bragg
937337993d tests: stop using cogl-auto-texture apis
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>

(cherry picked from commit 911df79776ce6f695351c15e9872b4f1479d30bf)

Conflicts:
	tests/conform/test-atlas-migration.c
	tests/conform/test-backface-culling.c
	tests/conform/test-blend-strings.c
	tests/conform/test-color-mask.c
	tests/conform/test-just-vertex-shader.c
	tests/conform/test-npot-texture.c
	tests/conform/test-primitive.c
	tests/conform/test-snippets.c
	tests/conform/test-texture-get-set-data.c
	tests/conform/test-texture-mipmap-get-set.c
	tests/conform/test-texture-no-allocate.c
	tests/conform/test-wrap-modes.c
2013-07-29 17:56:07 +01:00
Neil Roberts
49a30eecfb Add test that Cogl doesn't crash when freeing unallocated texture
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>

(cherry picked from commit bfada22d9a7f60baad5ae5615e45f10327e23e36)
2013-06-13 13:45:34 +01:00