Commit Graph

3351 Commits

Author SHA1 Message Date
Chun-wei Fan
93c90f1e05 cogl/cogl-gtype-private.h: Fix Build on non-GCC
Commit 1b2dd815 (Registers gtypes for all public objects and structs)
introduced GCCism's in its use of varargs, which broke the build of Cogl
on other non-GCC compilers, such as Visual Studio.

Define the COGL_GTYPE_DEFINE_BASE_CLASS and COGL_GTYPE_DEFINE_CLASS macros
using ISO-style varargs so that the build of Cogl can be fixed on non-GCC
compilers.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2014-04-22 12:17:46 +02:00
Chun-wei Fan
2e0989bbaf Visual Studio Builds: Avoid Implicit Link to SDL
Cogl, when built with the SDL winsys, includes the SDL headers in its
headers, which causes main() to be defined to SDL's main() wrapper on
Windows, which means that SDL2.lib and SDL2main.lib need to be linked to
every single program that links to Cogl with the SDL winsys.

Avoid this behavior by defining SDL_MAIN_HANDLED in the CFLAGS of the
sample and test programs, and let people know that this is the case.
2014-04-17 10:33:55 +08:00
Chun-wei Fan
6feaaf2915 MSVC Builds: Don't Link to SDL Automatically
Remove #pragma directives that causes any applications that use Cogl to
link to the SDL libraries when Cogl was built with the SDL winsys.  This is
mainly due to the availability of both SDL-1.x and SDL-2.x support in the
SDL winsys, where different libraries are linked for SDL-1.x and SDL-2.x.

To avoid having to link to the SDL/SDL2 libraries when the application code
is not directly using SDL/SDL2, define SDL_MAIN_HANDLED in the CFLAGS so
that SDL's wrapper main() implementation will not be used when the
application is being built.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit c3035912833eabe1f6dadbea23c78e595aac79dc)
2014-04-16 12:39:20 +02:00
Chun-wei Fan
b2d74eed58 Update cogl.symbols and cogl-path.symbols
In Lionel's work for supporting introspection better for Cogl, a number of
public symbols were added for Cogl and Cogl-Path, so add these symbols to
cogl.symbols and cogl-path.symbols so that they can be exported, which will
fix the build of the Cogl conformance test and the introspection files
for the Windows-based builds.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2014-04-16 12:32:16 +02:00
Chun-wei Fan
3e494a13f8 Visual Studio Builds: Update .def Files Generation
Define COGL_HAS_GTYPE_SUPPORT during the preprocessing of the .symbols
files so that the _get_gtype symbols can be exported.
2014-04-07 12:39:31 +08:00
Chun-wei Fan
39d30a35a7 Visual Studio Builds: Update README.txt's
Let people know that for Visual Studio builds GLib is a hard requirement,
and let the people also know that SDL-2.x is now used for builds supporting
the SDL winsys.  Also let people know that current situation regarding
building and linking Cogl applications with the SDL winsys built in.
2014-04-07 10:30:19 +08:00
Neil Roberts
ea9fb36ea7 Post-release version bump to 1.18.1 2014-03-21 18:23:17 +00:00
Neil Roberts
bbbeee98f4 Release 1.18.0 (relase) 2014-03-21 18:10:29 +00:00
Neil Roberts
8cea403681 Updates NEWS for the 1.18.0 release 2014-03-21 18:07:51 +00:00
Neil Roberts
94002eaf7c mingw: Try adding a -w64 suffix when searching for a suitable compiler
On 64-bit fedora the 32-bit MinGW compiler is called
i686-w64-mingw32-gcc which wasn't being picked up by the
mingw-fetch-depdencies script.

Reviewed-by: Robert Bragg <robert.bragg@intel.com>
(cherry picked from commit f5f0342315e524523c50549e91eb9ff1683ab558)
2014-03-21 17:38:32 +00:00
Neil Roberts
2e6156ef5e Don't use the internal _G_DEFINE_TYPE_EXTENDED_CLASS_INIT macro
This macro is internal to gobject so using it risks breaking Cogl if
glib changes its API. Instead we just use its expansion. Note that
glib provides two expansions for this depending on the glib version
but this only uses the one for older versions.

Reviewed-by: Robert Bragg <robert.bragg@intel.com>
2014-03-21 17:16:34 +00:00
Neil Roberts
a972024ed7 cogl-gst-video-sink: Fix a call to g_return_val_if_fail
cogl_gst_video_sink_get_natural_size was using g_return_val_if_fail
but its return type is void. For some reason GCC doesn't complain
about this but it causes a compile error on clang.
2014-03-21 15:30:30 +00:00
Neil Roberts
1e2a65daee Revert "cogl-gst: add missing Cogl introspection dependency"
The pkg-config file might not necessarily be installed yet so I don't
think it makes sense to try and include it when running g-ir-scanner.
Presumably it should pick up the headers from source directory instead
of the installed directory. It seems to build without this patch so
let's just revert it.

This reverts commit d9c8570f14.
2014-03-21 15:20:11 +00:00
Lionel Landwerlin
263f6502c7 onscreen: make closure types visible to introspection
Reviewed-by: Neil Roberts <neil@linux.intel.com>
2014-03-21 14:28:27 +00:00
Lionel Landwerlin
12ece8e4a1 examples: add gjs example
Reviewed-by: Neil Roberts <neil@linux.intel.com>
2014-03-21 14:28:27 +00:00
Lionel Landwerlin
b7017ed5b0 example: add emscripten files to dist
Reviewed-by: Neil Roberts <neil@linux.intel.com>
2014-03-21 14:28:27 +00:00
Lionel Landwerlin
3aee3f63c4 cogl-gtype: add missing gtype macros in intermediate macros
Reviewed-by: Neil Roberts <neil@linux.intel.com>
2014-03-21 14:28:27 +00:00
Lionel Landwerlin
d9c8570f14 cogl-gst: add missing Cogl introspection dependency
Reviewed-by: Neil Roberts <neil@linux.intel.com>
2014-03-21 14:28:20 +00:00
Lionel Landwerlin
1b2dd815b4 Registers gtypes for all public objects and structs
This adds much more comprehensive support for gobject-introspection
based bindings by registering all objects as fundamental types that
inherit from CoglObject, and all structs as boxed types.

Co-Author: Robert Bragg <robert@linux.intel.com>

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2014-03-20 18:27:12 +00:00
Chun-wei Fan
bb10532f4b cogl-pango-pipeline-cache.c: Include forgotten header
The private header is needed as the cogl_texture_get_format API was made
private, so that C4013 (implicit declaration of ...) warnings/errors can
be avoided

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2014-03-20 18:00:01 +00:00
Chun-wei Fan
fabd5a5b1e Update cogl-path.symbols
One symbol was missed when the cogl-path code was split out from Cogl...

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2014-03-20 18:00:01 +00:00
Chun-wei Fan
a4d2c78e2b Update cogl.symbols
Remove the symbols that are now in cogl-path (where cogl-path.symbols
already include), and add the symbols that were added to the Cogl API.

Also add internal symbols as required by cogl-path and cogl-pango.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2014-03-20 18:00:00 +00:00
Chun-wei Fan
001cffd783 cogl/cogl-renderer.c: Avoid Clash with Newer Windows SDKs
The DriverCallback is a function that is defined by the Windows SDK 8.0+
headers, which was initially used for device driver development.  The use
of DriverCallback would cause a clash, causing things to break when built
with newer Windows SDKs, so rename DriverCallback to CoglDriverCallback to
avoid this problem.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2014-03-20 17:56:52 +00:00
Neil Roberts
ed06915e61 cogl-gst-plugin: Fix the license name in the plugin description
In commit 1b83ef938f the license in the plugin description was changed
from “LGPL” to “MIT”. GStreamer strictly whitelists the names of the
licenses and the correct name for the MIT license is “MIT/X11” so it
was rejecting the plugin.

Reviewed-by: Robert Bragg <robert.bragg@intel.com>
(cherry picked from commit ceec0bddb858588c1f04c50dd6cbda9eb044c4cc)
2014-03-20 17:44:38 +00:00
Robert Bragg
804082abd3 Expose EGL context/display and GLX context
To help facilitate integration with third party frameworks this exposes
the EGL context and display to applications as well as the GLX context.
(Note that the GLX display is already available via
cogl_xlib_renderer_get_display())

This adds a new top-level <cogl/cogl-glx.h> header that needs to be
included explicitly to access the glx specific api.

Anyone using these apis will be responsible for checking that Cogl
is indeed using EGL or GLX by calling cogl_renderer_get_winsys_id()

This will enable GStreamer, for example, to be able to create a GL
context that shares resources with Cogl's context.

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

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2014-03-20 17:34:04 +00:00
Robert Bragg
081acdc146 move GLeglImageOES define into cogl-egl-private.h
This splits out the GLeglImageOES define in cogl-egl.h into a private
cogl-egl-private.h header and updates the guards in cogl-egl.h to be
consistent with other top-level headers where we need to be careful
about how __COGL_H_INSIDE__ is defined and undefined, esp when the
gobject introspection scanner is running.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2014-03-20 17:34:04 +00:00
Robert Bragg
dca992a160 egl: remove NativeWindowType/NativeDisplayType defines
This ensures we use EGLNativeWindowType and EGLNativeDisplayType
everywhere instead. The previous names come from EGL 1.2 but it seems
reasonable to require more recent EGL versions. If someone wanted to add
compatibility for EGL 1.2 later it would be straightforward to define
the new names to the old.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2014-03-20 17:34:04 +00:00
Robert Bragg
2beb7c40e0 sdl2: fix GL driver selection
SDL2 supports selecting between full OpenGL or OpenGL ES 1/2 but our
selection code was written before SDL 2.0 was officially released and
since then a new SDL_GL_CONTEXT_PROFILE_MASK attribute was added and
we have to explicitly set the SDL_GL_CONTEXT_MINOR_VERSION attribute.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2014-03-20 17:34:04 +00:00
Robert Bragg
849f691969 cogl-gst: add cogl_gst_video_sink_get_natural_size() api
This adds api for querying a "natural" width and height for a video
which has the correct aspect ratio for displaying on square, 1:1 pixels.

The natural size is the minimum size where downscaling is not required.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2014-03-20 17:34:04 +00:00
Robert Bragg
0e2771a4a4 basic-video-player: don't try and sample mipmap
Since we don't generate a mipmap chain for uploaded video frames this
avoids setting the min filter to COGL_PIPELINE_FILTER_LINEAR_MIPMAP_LINEAR.

Since COGL_PIPELINE_FILTER_LINEAR is the default and since it is also
dubious that cogl-basic-video-player is directly manipulating layers
that are conceptually internal to cogl-gst this removes the loop that
updates the filtering for cogl-gst layers.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2014-03-20 17:34:04 +00:00
Robert Bragg
9f8ab5d809 cogl-gst: allocate textures synchronously
This makes sure video textures being uploaded via
video_texture_new_from_data are allocated before the function returns.
This function create a CoglBitmap to wrap the data from gstreamer and by
allowing cogl to allocate the texture lazily it's possible that the data
being pointed to by the bitmap won't remain valid until we actually come
to allocate the texture.

Note: we don't simply use cogl_texture_2d_[sliced_]new_from_data() here
because we need to be able to call cogl_texture_set_premultiplied()
before allocating the texture.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2014-03-20 17:34:04 +00:00
Robert Bragg
ad9db72f74 Expose COGL_FEATURE_ID_BUFFER_AGE feature id
This adds a new COGL_FEATURE_ID_BUFFER_AGE feature id that can be used
to determine if cogl_onscreen_get_buffer_age() will ever return an age
other than 0. This should be used instead of querying the winsys feature
via cogl_clutter_winsys_has_feature().

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2014-03-20 17:34:04 +00:00
Robert Bragg
beebbfc625 glx-feature-functions: update misleading comment
Reviewed-by: Neil Roberts <neil@linux.intel.com>
2014-03-20 17:34:04 +00:00
Robert Bragg
3917690f5a egl: fix incorrect #ifdef guarding of features
We have an #ifdef EGL_WL_bind_wayland_display guard in
cogl-winsys-egl-feature-functions.h to avoid referencing wayland types
when the EGL header doesn't know about them, but somehow this guard also
ended up around the KHR_create_context and EXT_buffer age features too
even though they aren't wayland specific.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2014-03-20 17:34:01 +00:00
Neil Roberts
18b8035dcf Set COGL_WINSYS_FEATURE_BUFFER_AGE on EGL
This winsys feature flag is exposed via the deprecated
cogl_clutter_winsys_has_feature function and Clutter is curently
relying on it. Previously the EGL winsys was only setting the internal
COGL_EGL_WINSYS_FEATURE_BUFFER_AGE flag and there was no mapping to
the public flag. Therefore the feature would only be used on GLX. This
patch just adds the mapping.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit 8418e98b2b1b25515a961ad1bb9f0c4770d6eb1d)
2014-03-14 13:51:39 +00:00
Jasper St. Pierre
e7011f1910 cogl-winsys-egl-kms: Make sure to close our connection to DRM at shutdown
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit dcdba60e95ae7be1b0253d28686d1562c35374ba)
2014-03-12 17:29:27 +00:00
Jasper St. Pierre
0d91085193 cogl-winsys-egl-kms: Add cogl_kms_renderer_set_kms_fd
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit 7bc7ea4cb5e8134a3aeed9615477f4152b558509)

Conflicts:
	cogl/winsys/cogl-winsys-egl-kms.c
2014-03-12 17:29:21 +00:00
Jasper St. Pierre
76cdaabc15 cogl-winsys-egl-wayland: Report an error if we can't find the globals we need
Instead of spinning forever, do a roundtrip, which guarantees that the
global messages have been sent by the time we read the sync message.

If the proper globals aren't initialized yet, error out immediately. This
does mean that users can't use CoglOnscreen with foreign custom surface
types without xdg_shell, but when a use case comes for this, we'll
investigate then...

Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit af9057d35f331e2c9509958fb40627917c477b80)
2014-03-12 14:41:01 +00:00
Chun-wei Fan
c1286307a3 build/win32/vs9/Makefile.am: Remove Non-Existing Entry
A project file was removed, which was not updated in Makefile.am, so make
up for that.
2014-03-12 15:41:09 +08:00
Wylmer Wang
3d56732853 Updated Chinese (China) translation 2014-03-08 12:36:07 +00:00
Chun-wei Fan
4730782a20 Visual Studio 2010 Projects: Add a PlatformToolset Tag
This adds a PlatformToolset tag in order to make upgrading the projects to
Visual Studio 2012/2013 formats easier, especially when done with a script.
The script, for example, can change the value inside these tags
apporpriately to do the upgrade job quite easily.
2014-03-06 19:14:38 +08:00
Chun-wei Fan
efbd121f10 Visual Studio 2010 Builds: Fix Header Installation
Some headers were deprecated and therefore moved, so update for that.
2014-03-04 15:34:33 +08:00
Chun-wei Fan
0b96d15315 Visual C++ 2008 Builds: Fix Installation of Binaries
The *.dll, *.exe and *.lib files weren't being copied in the *_SDL configs
as the project looked for them in the wrong place.  Correct that problem.
2014-03-04 15:28:52 +08:00
Chun-wei Fan
206ea0de6b Update the Visual Studio 2010 Projects
This updates the Visual Studio 2010 Projects in the following ways,
similar to the recent changes to the Visual Studio 2008 projects:

-Make all the copying of the pre-configured header files custom build
 rules, so that it is cleaner when people clean their builds, and the files
 can be re-copied when updated.
-Split up the property sheets, so to ease future maintenance
-Make the cogl-path library built as a DLL
-Build and link against SDL-2.x for SDL builds
-Make everything except the .sln file and the README.txt file use UNIX line
 endings, for easier maintenance.
-Merge cogl_sdl.sln and install-sdl.vcxproj into cogl.sln and
 install.vcxproj respectively.
-Update build of the conformance test to not use COGL_COMPILATION, and make
 it link to cogl-path.
2014-03-03 17:48:31 +08:00
Chun-wei Fan
b616877516 build/win32/vs9/cogl.sln: Update
Make the install project depend on cogl-path, so that we are certain that
the cogl-path DLL gets "installed".
2014-03-03 16:59:03 +08:00
Chun-wei Fan
4b40a8fe83 MSVC 2008 Builds: Split Up the Property Sheets
Split up the property sheets, so that it is easier to maintain, and update
the project files accordingly.  Also clean up the project files by
finishing up the merge of the *_sdl.vcproj items into their regular
counterparts, and dropping all the *_sdl.* files.

Make use of UNIX line endings for all the MSVC 2008 build files, except the
.sln file and the README.txt files, for easier maintenance.
2014-03-03 15:18:54 +08:00
Chun-wei Fan
ab16d26e8f MSVC 2008 Builds: Link Conformance Test to cogl-path
We need to link the conformance test executable to cogl-path, so make that
project depend on the cogl-path project, so that it will link to it as
well.
2014-03-03 13:52:45 +08:00
Chun-wei Fan
2568182506 MSVC 2008 Builds: Build the SDL-2.x example
...instead of the SDL-1.x example.  The SDL-1.x example is not going to run
well against Cogl built against SDL-2.x.
2014-03-03 11:10:46 +08:00
Chun-wei Fan
e69dd84004 build/win32/vs9/cogl.vsprops: Update Header Installation
Update the headers "installation" as some headers have been made
deprecated.
2014-02-27 18:43:12 +08:00
Chun-wei Fan
a4bf3c6f88 MSVC 2008 Projects: Build cogl-path as a DLL
So that it will be like what is done in the autotools builds now.  Also
clean up the cogl-path and cogl-pango projects.
2014-02-27 18:29:39 +08:00