Commit Graph

3247 Commits

Author SHA1 Message Date
Neil Roberts
4bc7377727 Add the cogl_point_coord snippet builtin
This adds a #define for gl_PointCoord to all shaders so that it can be
accessed with a name in the Cogl namespace.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit c28fc054788e88627bcc2346f4c4c368870ff777)
2013-09-02 16:22:08 +01:00
Neil Roberts
cb178b7a3a Always add the #version pragma to shaders
Previously we would only add the #version pragma to shaders when
point sprite texture coordinates are enabled for a layer so that we
can access the gl_PointCoord builtin. However I don't think there's
any good reason not to just always request GLSL version 1.2 if it's
available. That way applications can always use gl_PointCoord without
having to enable point sprite texture coordinates.

This adds a glsl_version_to_use member to CoglContext which is used to
generate the #version pragma as part of the shader boilerplate. On
desktop GL this is set to 120 if version 1.2 is available, otherwise
it is left at 110. On GLES it is always left as 100.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit e4dfe8b07e8af111ecbcb0da20ff2a2875a2b5d0)

Conflicts:
	cogl/driver/gl/gl/cogl-driver-gl.c
2013-09-02 16:22:01 +01:00
Neil Roberts
e67e487daf docs: Fix the documentation for texture coordinates in snippets
The documentation for the builtin varyings for the texture coordinates
was wrongly claiming that the varyings are stored in an array. This
was changed in e55b64a9cdc9 so that each layer gets its own
independent varying.

The documentation was also referring to texture units instead of layer
numbers. The texture units are no longer publicly exposed in the
shaders and instead everything should in theory be expressed in terms
of layer numbers.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit bf6b509c340bdc3be30e1a81fb96710b3176e9dc)
2013-09-02 15:47:18 +01:00
Chun-wei Fan
9440c690fb cogl/cogl-offscreen.h: Fix deprecation macro placement
The deprecation macros need to be before the function prototype on
Visual Studio, and is also accepted by GCC.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2013-08-30 12:04:36 +01:00
Chun-wei Fan
9f8d21ba48 Update cogl.symbols
Add the symbols that were added to the public Cogl API, and remove the
export of an internal API that was also removed.  Unfortunately
_cogl_system_error_quark needs to be exported for the conformance test
programs.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2013-08-30 12:04:36 +01:00
Chun-wei Fan
eda015d45c MSVC Builds: Update Predefined cogl-defines.h
Cogl-Path was split out from the main Cogl library to become a standalone
library, but many libraries/appplications using Cogl (such as Clutter)
expects that Cogl-Path is still in Cogl.  Define
COGL_HAS_COGL_PATH_SUPPORT here, as it will always be needed, at least for
the 1.16 release series, so that builds of items using Cogl would not
break, such as Clutter.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2013-08-30 12:04:36 +01:00
Chun-wei Fan
98340c44ba Fix the Windows Resource Files
The autotools variables to substitute for versioning in 1.16 is wrong, so we
have incorrect versioning info during a release as the variables are for
Cogl-2.x.  Fix this so we can have the correct versioning info for the
Cogl/Cogl-Pango DLLs during a release.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2013-08-30 12:04:36 +01:00
Chun-wei Fan
24f8d20ada cogl-path: Add a symbols file
This is used for exporting symbols when Cogl-Path becomes a DLL (.so)
of its own, so one can use and process this file with a preprocessor for
e.g. and generate a .def file that can be used for this purpose.  Dist the
symbols file as well.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit 5037d81a1c68cfa9a052b9b081187e717b59b54b)
2013-08-30 12:02:54 +01:00
Chun-wei Fan
1eda045316 cogl/cogl-bitmap-conversion.c: Include missed header
The cogl-texture-private.h needs to be included as
_cogl_texture_needs_premult_conversion, so that we can avoid implicit
declaration warnings of that symbol (aka C4013 on MSVC).

Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit 4afe9dc1fea646e2a9576f9a0dbd1ffafa40485b)
2013-08-30 12:02:54 +01:00
Chun-wei Fan
1f5f931e6f MSVC builds: Update "Installation" of Headers
Some of the headers for Cogl was moved/split out to Cogl-Path, so update
the installation of the headers accordingly
2013-08-28 09:50:43 +08:00
Chun-wei Fan
db73744a1e MSVC Projects: Add project templates for cogl-path
This adds template project files that is used to build cogl-path, where the
source files can be filled in using autotools.  Note that although
cogl-path is built as a static library, items to build DLLs for this
is intentionally left in there as this is intended to be a shared library
later.
2013-08-27 15:43:55 +08:00
Damien Lespiau
af8ea69b7f texture-rectangle: Initialize is_foreign
So we don't read an initializes value later on. Caught by valgrind:

Conditional jump or move depends on uninitialised value(s)
  _cogl_object_texture_rectangle_indirect_free (cogl-texture-rectangle.c:105)
  _cogl_object_context_indirect_free (cogl-context.c:453)
  ...
  main (text.c:149)

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewed-by: Neil Roberts <neil@linux.intel.com>

(cherry picked from commit 90415aae9495749a2a9e85fb17425a3c7f6a08c8)
2013-08-26 23:19:27 +01:00
Chun-wei Fan
f2d785e22b Visual Studio Projects: Use Custom Build Rules
Use custom build rules to generate the enumeration sources and the .def
files so that the IDE will regenerate those files upon change and
clean them when a clean up request is requested.
2013-08-26 18:39:02 +08:00
Chun-wei Fan
8d7a9d606a Update Visual Studio Property Sheets
-Add items to generate the enumeration sources
-Add items to build the CoglPath library, which was split out
2013-08-26 18:18:17 +08:00
Neil Roberts
cf44ad2493 gles2: Use GL_ES instead of __VERSION__ for setting precision
Mesa has started getting picky about specifying the precision for
floating types in the fragment shader. We already have a default
precision specifier in all the fragment shaders but apparently this
wasn't working because it is only used when the __VERSION__ define is
100 and Mesa is reporting 110. Regardless of whether Mesa is doing the
right thing or not I think it makes sense to use GL_ES instead of
__VERSION__ because we will also need the precision specifier if we
start requesting GLSL 3.0. The GLES specification explictly states
that GL_ES will only be defined for GLES and this is similar to what
the internal meta shaders do in Mesa.

http://cgit.freedesktop.org/mesa/mesa/commit/?id=cabd45773b58d6aa482

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

(cherry picked from commit 37f5205739cfb0745ea74dedaec117081ba0088b)
2013-08-25 02:34:13 +01:00
Neil Roberts
7bab449700 renderer: Don't allow the COGL_DRIVER env var to override application
Since e07d0fc7441 the COGL_DRIVER environment variable was able to
override the application's driver selection. This doesn't seem like a
good idea because if the application is specifying a driver explicitly
then presumably it can not work with any other driver. This patch
changes it so that if a driver is selected in the configuration and by
the application then they must match, otherwise it will fail with a
CoglError.

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

(cherry picked from commit 4e0942d74c8d69aa48e0176bfecf27f64a950d0f)
2013-08-23 16:50:51 +01:00
Neil Roberts
e7b50a6cba renderer: Only check certain constraints when selecting a driver
Only COGL_RENDERER_CONSTRAINT_SUPPORTS_COGL_GLES2 affects the driver
selection and all of the the other constraints are only relevant to
the winsys selection. However Cogl was trying to apply all of the
constraints to the driver selection which meant that if any other
constraint was specified then it would always fail. This patch makes
the driver selection filter out all other constraints based on a mask
defined in cogl-renderer-private.h.

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

(cherry picked from commit f07febc8913b97fb828e7f2cc2857813af2d3657)
2013-08-23 16:49:59 +01:00
Robert Bragg
627e518da0 display: add _set_onscreen_template() api
Currently it's only possible to set an onscreen template on a
CoglDisplay by passing a template to cogl_display_new(). For
applications that want to deal with fallbacks then they may want to
replace the onscreen template so this adds a
cogl_display_set_onscreen_template() function.

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

(cherry picked from commit f307c9545791dae5472a9568fef6b31b3bf52854)
2013-08-23 16:44:07 +01:00
Robert Bragg
1c91bd4a05 renderer: assert CoglPrivateFeatureFlags fit in 32 bits
This updates the static assertion in cogl-renderer.c to only check that
the flags will fit in 32 bits instead of asserting the type has the same
size as an unsigned long.

(cherry picked from commit c6893fa3c9eda0f13b79d3a1fc03f8b79c42a8f6)
2013-08-23 15:26:45 +01:00
Robert Bragg
29f08ef124 webgl: use DEPTH_STENCIL_ATTACHMENT
WebGL doesn't allow you to separately attach buffers to the
STENCIL_ATTACHMENT and DEPTH_ATTACHMENT framebuffer attachment points
and instead requires you to use the DEPTH_STENCIL_ATTACHMENT whenever
you want a depth and stencil buffer.

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

(cherry picked from commit ec7b6360c9c4e45e0b113f9dca7bb1502e7e93be)
2013-08-23 15:25:44 +01:00
Robert Bragg
3fc1a39db8 Adds "webgl" driver
This adds a COGL_DRIVER_WEBGL enum and a new driver description for
webgl in cogl-renderer.c. This also adds a COGL_DRIVER_FLAG_OPENGL_WEB
driver flag and a HAVE_COGL_WEBGL define which we can start to use to
handle special cases where webgl differs from gles2.

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

(cherry picked from commit 2c167b7a4ee56241827322bbe7cb287b0628437c)
2013-08-23 15:22:30 +01:00
Robert Bragg
34658ea057 generalize driver description and selection
This adds a table of driver descriptions to cogl-renderer.c in order of
preference and when choosing what driver to use we now iterate the table
instead of repeating boilerplate checks. For handling the "default driver"
that can be specified when building cogl and handling driver overrides
there is a foreach_driver_description() that will make sure to iterate
the default driver first or if an override has been set then nothing but
the override will be considered.

This patch introduces some driver flags that let us broadly categorize
what kind of GL driver we are currently running on. Since there are
numerous OpenGL apis with different broad feature sets and new apis
may be introduced in the future by Khronos then we should tend to
avoid using the driver id to do runtime feature checking. These flags
provide a more stable quantity for broad feature checks.

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

(cherry picked from commit e07d0fc7441dddc3f0a2bc33a6a37d62ddc3efc0)
2013-08-23 14:51:43 +01:00
Giovanni Campagna
bd3dce4af1 kms: add public API to override the default configuration of outputs
Add API to allow complex applications using the KMS backend
to go almost straight to direct configuration (which is not possible
because Cogl needs to be in charge of buffers and FB objects).

https://bugzilla.gnome.org/show_bug.cgi?id=705837

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

(cherry picked from commit 52fb8e1c33d8c83c731c05cee767928fdd5991d7)
2013-08-23 13:55:42 +01:00
Robert Bragg
5fe0d81bea Update the RELEASING notes
(cherry picked from commit 2ce521afad01e95d072f5e069c392615bce15b1d)
2013-08-23 13:55:42 +01:00
Jasper St. Pierre
d749a28cb0 Update .gitignore 2013-08-21 15:33:21 -04:00
Neil Roberts
245df46f75 cogl-path: Generate the primitive before using it for clipping
The data->fill_primitive member is meant to be generated on demand in
an accessor function. However when using it for clipping the code was
trying to directly use it without calling the accessor so it would
crash if nothing else caused the primitive to be generated. This was
making the texture-fbo test in Clutter crash.

(cherry picked from commit 0e913664339739812848cdb73bec64c066860e65)
2013-08-21 15:40:14 +01:00
Neil Roberts
cd9291f511 Add a cogl-point-sprites example
This updates the old point sprites interactive test from Clutter to be
a standalone Cogl example using the 2.0 API.

(cherry picked from commit e7ede458fde7207896e507d64b52b77777b3c872)
2013-08-21 15:40:09 +01:00
Jasper St. Pierre
99352e1149 Fix introspection issues 2013-08-20 19:18:40 -04:00
Jasper St. Pierre
4ef5a5fc08 Update .gitignore 2013-08-20 19:14:57 -04:00
Robert Bragg
38ddecf503 Post-release version bump to 1.15.9 2013-08-20 12:36:57 +01:00
Robert Bragg
9d71eec457 Release 1.15.8 (snapshot) 2013-08-20 12:21:33 +01:00
Robert Bragg
7738b373fd Updates NEWS for the 1.15.8 release 2013-08-20 12:19:59 +01:00
Robert Bragg
d9cf422253 cogl: further fix for including cogl-path.h
This now updates the guard to ignore whether
COGL_ENABLE_EXPERIMENTAL_2_0_API is defined since we need to work for
clutter which does define that, as well as clutter users that don't.
2013-08-20 12:14:12 +01:00
Robert Bragg
29c2819df4 cogl: fix incorrect guard around cogl-path.h include
cogl.h was meant to include cogl-path.h so long as
COGL_ENABLE_EXPERIMENTAL_2_0_API is not defined but it was actually
requiring it to be defined which was breaking clutter applications.
2013-08-20 11:53:39 +01:00
Neil Roberts
45550cd343 wayland: Call eglTerminate before destroying wl_display, not after
The eglTerminate code in Mesa will try to destroy the wl_drm object
which involves using data structures in the wl_display. Cogl was
disconnecting the display before calling eglTerminate which meant that
this would end up accessing potentially garbage data.

https://bugzilla.gnome.org/show_bug.cgi?id=705591

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

(cherry picked from commit 358d85f35d0fe36698b758163729c4551fe5fd25)
2013-08-20 11:13:37 +01:00
Robert Bragg
07930069d3 Post-release version bump to 1.15.7 2013-08-20 01:23:17 +01:00
Robert Bragg
0c40013a8d Release 1.15.6 (snapshot) 2013-08-20 01:06:44 +01:00
Robert Bragg
e1dfcdee3d Updates NEWS for the 1.15.6 release 2013-08-20 01:06:44 +01:00
Robert Bragg
daa3a7d7b5 framebuffer: restore api to maintain ABI for release
This restores the cogl_framebufer_[v]draw_*_attributes APIs for the 1.16
branch so we can avoid changing the soname for the 1.15.6 release
2013-08-20 01:06:25 +01:00
Chun-wei Fan
aa878ddca6 Fix the placement of deprecation macros
The deprecation macros, which expand to __declspec (deprecated) on Visual
Studio, is expected to be before the return type of the function which
is annotated by them, and having the deprecation macros there is also
accepted by GCC as well.

This will fix the builds of all applications/libraries using Cogl under
Visual Studio,

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2013-08-19 22:44:45 +01:00
Fan Chun-wei
d87a0b08d6 Update the cogl.symbols file
Add and rename the symbols that have been added/renamed during the
development cycle, and also remove those that have been dropped during the
process.

Also continue the quest of purging from the exports lists of the internal
APIs as some of those are no longer referenced by other Cogl components.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2013-08-19 22:44:45 +01:00
Chun-wei Fan
00b3e21f44 cogl-gpu-info.c: Avoid using named initializers
Unfortunately named initializers is a feature that is not supported by
all compilers (such as pre-2013 Visual Studio) so avoid using that.

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

(cherry picked from commit 5a5659f9861dfe7a4808f2a5284de8fe6175bec2)
2013-08-19 22:44:45 +01:00
Chun-wei Fan
45288c5d6d cogl-texture-gl.c: Don't include strings.h unconditionally
Use the HAVE_STRINGS_H check before we include strings.h, as it is not
universally available.

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

(cherry picked from commit ff65144c84a16f9470d3f3931dc91cc9a6ef5938)
2013-08-19 22:44:45 +01:00
Chun-wei Fan
96de3fbcf5 MSVC builds: Update pre-defined cogl-define.h
...For both the regular WGL winsys and SDL winsys builds, that
COGL_HAS_GTYPE_SUPPORT is defined, so that the builds won't break as
Visual Studio builds do assume an existing installation of GLib.

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

(cherry picked from commit ef41aea2796315a47693bf278f08b41ca6703566)
2013-08-19 22:44:45 +01:00
Lionel Landwerlin
69247c10f3 cogl-gst: emit ready signal on sink only after the first frame is uploaded
Developers listening to the 'ready' signal on CoglGstVideoSink might
call process the current frame once the signal is triggered. We need
to ensure the first frame has been uploaded before letting people know
that the sink is ready.

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

(cherry picked from commit 53882aa0728c5540d8452045006a763e29d4306d)
2013-08-19 22:44:45 +01:00
Neil Roberts
71f6023e8a Fix the documented default value for --enable-cogl-path
As far as I can tell --enable-cogl-path is enabled by default but the
help string for it was suggesting otherwise.

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

(cherry picked from commit 9c75fc5463acf1cb51bf00d9914678013ed9d248)
2013-08-19 22:44:45 +01:00
Neil Roberts
05c0035ea6 Fix the help string for --enable-standalone
The help string had the wrong name presumably resulting from a cut and
paste error of the --enable-debug option.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
Reviewed-by: Damien Lespiau <damien.lespiau at intel.com>

(cherry picked from commit fb6a582ae41a5511c837846e8fbac46462fce93d)
2013-08-19 22:44:45 +01:00
Robert Bragg
04d943579b gl: bind position attribute to location 0
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>

(cherry picked from commit 992ef7b3b49ebb56adde2133bb36330c04133a3f)
2013-08-19 22:44:45 +01:00
Robert Bragg
1317a25a91 offscreen: rename _new_to_texture to _new_with_texture
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>

(cherry picked from commit ecc6d2f64481626992b2fe6cdfa7b999270b28f5)

Note: Since we can't break the 1.x api on this branch this keeps a
thin shim around cogl_offscreen_new_with_texture to implement
cogl_offscreen_new_to_texture with its synchronous allocation
semantics.
2013-08-19 22:44:44 +01:00
Adel Gadllah
64aa6092ce offscreen: Allocate the framebuffer in cogl_offscreen_new_to_texture_full
The API says that it should return NULL on failure but it does not do that
due to the lazy allocation.

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

https://bugzilla.gnome.org/show_bug.cgi?id=703174
2013-08-19 22:44:44 +01:00