Commit Graph

3291 Commits

Author SHA1 Message Date
Marco Trevisan (Treviño)
7c71a06936 mir: fix mir surface recreation on resize, bind and update pointers
don't try to read from free'd memory allocation, copy stuff before
deinitializing the old onscreen.

Also, don't try to resize a foreign surface.
2014-12-09 20:22:53 +01:00
Marco Trevisan (Treviño)
a9a923c6f3 mir: correctly init/clear mutex and use prgname for surface 2014-12-09 20:16:36 +01:00
Marco Trevisan (Treviño)
1016fb64de mir: return proper surface / connection only when valid, without failing 2014-12-09 20:13:39 +01:00
Marco Trevisan (Treviño)
a144087085 mir: release surfaces on errors 2014-11-21 18:00:49 +01:00
Marco Trevisan (Treviño)
6aaeab0460 mir: add public method to resize a cogl onscreen
This will internally recreate a new surface with proper parameters
2014-11-21 18:00:10 +01:00
Marco Trevisan (Treviño)
bd6bfccc40 cogl.h: include mir renderer if the platform is supported 2014-11-20 19:11:05 +01:00
Marco Trevisan (Treviño)
77e28d4a77 mir: only allow to set foreign surfaces with hardware buffer
And return a CoglBool accordingly.
2014-11-20 07:18:26 +01:00
Marco Trevisan (Treviño)
8e6997db44 mir: return whether a foreign connection has been set or not 2014-11-20 07:17:19 +01:00
Marco Trevisan (Treviño)
e06a0b3d10 mir: release a connection on error 2014-11-18 22:16:38 +01:00
Marco Trevisan (Treviño)
b26466ad54 mir: improve error logging 2014-11-18 22:11:24 +01:00
Marco Trevisan (Treviño)
e5fd82e2a1 mir: use standard c types 2014-11-18 16:28:17 +01:00
Marco Trevisan (Treviño)
1cbc1c67a0 mir: add support for Mir Outputs 2014-11-17 18:50:30 +01:00
Marco Trevisan (Treviño)
a948c25116 mir: update the framebuffer size on resize events
We need to use a mutex as mir handles these on
different threads, also using an event idle prevents
to get initialization errors on cogl side.
2014-11-17 17:47:23 +01:00
Marco Trevisan (Treviño)
62f3f56d29 mir: set last state after initializing the surface 2014-11-17 17:45:59 +01:00
Marco Trevisan (Treviño)
1b9380ef3c mir: add support for foreign surfaces 2014-11-17 16:08:59 +01:00
Marco Trevisan (Treviño)
a3ae538c45 mir: add support for foreign display 2014-11-17 15:59:29 +01:00
Marco Trevisan (Treviño)
672eff0c6c cogl: add Mir EGL platform 2014-11-17 15:49:20 +01:00
Adel Gadllah
bf3954ebe3 cogl-kms-display: Fix doc comment 2014-10-03 11:50:37 +02:00
Sebastian Rasmussen
2dd2a3d9e7 Updated Swedish translation 2014-09-19 19:04:26 +00:00
Seong-ho Cho
3c39c95a46 Updated Korean translation 2014-09-12 13:53:00 +09:00
Owen W. Taylor
0d7d4fe14e examples/cogl-texture-pixmap-x11: Add a --stereo command line option
If --stereo is passed, then the texture pixmap is created as a stereo
texture pixmap, and also, if passed in conjunction with --gears,
glxgears is also run with the -stereo option.

Reviewed-by: Robert Bragg <robert.bragg@intel.com>
2014-07-17 19:27:21 -04:00
Owen W. Taylor
7f3960e94d examples/cogl-x11-tfp: Add a --gears option to run glxgears
If --gears is passed on the command line, glxgears is run, and
is used for the source window rather than drawing solid rectangles
into a window we create outselves.

Reviewed-by: Robert Bragg <robert.bragg@intel.com>
2014-07-17 19:27:17 -04:00
Owen W. Taylor
4d8771a8c2 CoglTexturePixmapX11: add support for stereo content
Add cogl_texture_pixmap_x11_new_left() and
cogl_texture_pixmap_x11_new_right() (which takes the left texture
as an argument) for texture pixmap rendering with stereo content.
The underlying GLXPixmap is created using a stereo visual and shared
between the left and right textures.

Reviewed-by: Robert Bragg <robert.bragg@intel.com>
2014-07-17 19:27:13 -04:00
Owen W. Taylor
1b5beef5e5 Add a simple example of stereo drawing
Add a new example that draws a triangle floating in the air in
front of the screen.

Reviewed-by: Robert Bragg <robert.bragg@intel.com>
2014-07-17 19:27:10 -04:00
Owen W. Taylor
d16df5a5aa Add support for setting up stereo CoglOnscreens
If we want to show quad-buffer stereo with Cogl, we need to pick an
appropriate fbconfig for creating the CoglOnscreen objects. Add
cogl_onscreen_template_set_stereo_enabled() to indicate whether
stereo support is needed.

Add cogl_framebuffer_get_stereo_mode() to see if a framebuffer was
created with stereo support.

Add cogl_framebuffer_get_stereo_mode() to pick whether to draw to
the left, right, or both buffers.

Reviewed-by: Robert Bragg <robert.bragg@intel.com>
2014-07-17 19:27:05 -04:00
Robert Bragg
775fcbaaaf Post-release version bump to 1.18.3 2014-07-04 15:42:25 +01:00
Robert Bragg
58dec43a93 Release 1.18.2 (release) 2014-07-04 14:25:54 +01:00
Robert Bragg
8e1ed4fc91 Updates NEWS for the 1.18.2 release 2014-07-04 14:25:49 +01:00
Owen W. Taylor
157c1a090c examples/cogl-x11-tfp: Fix compilation
Fix a couple of minor compilation problems from a bad rebase - a
missing label and a missing variable.
2014-07-03 14:07:32 -04:00
Owen W. Taylor
baa2fba8e2 examples/cogl-x11-tfp.c: Handle WM_DELETE_WINDOW
Clean up cleanly when closed rather than dying with an X Error -
we do this by advertising support for the WM_DELETE_WINDOW protocol
and handling the client message.

Reviewed-by: Robert Bragg <robert.bragg@intel.com>
2014-07-03 13:35:39 -04:00
Owen W. Taylor
a4bc66325e examples/cogl-x11-tfp.c: Wait for the window to be mapped
Wait for the main window (and hence the window we create within
the main window to redirect) to be mapped and become viewable
before we try to call XCompositeNameWindowPixmap() -
XComposeNameWindowPixmap() produces a BadMatch error on a
non-viewable window.

Reviewed-by: Robert Bragg <robert.bragg@intel.com>
2014-07-03 13:35:02 -04:00
Adel Gadllah
d9afc6dada kms-winsys: Add api that tells cogl to ignore a crtc
An application might for whatever reason want to control a specific output
directly and have cogl only swap the other outputs if any. So add an api that
allows setting a crtc to be ignored.

https://bugzilla.gnome.org/show_bug.cgi?id=730536
2014-06-30 20:26:05 +02:00
Adel Gadllah
fe183554ca kms_winsys: Add cogl_kms_renderer_get_gbm api
Applications might want to get the underlying gbm device so add a getter for it.

https://bugzilla.gnome.org/show_bug.cgi?id=730536
2014-06-30 20:25:52 +02:00
Neil Roberts
52a646abc5 Use the EGL_KHR_surfacless_context extension
The surfaceless context extension can be used to bind a context
without a surface. We can use this to avoid creating a dummy surface
when the CoglContext is first created. Otherwise we have to have the
dummy surface so that we can bind it before the first onscreen is
created.

The main awkward part of this patch is that theoretically according to
the GL and GLES spec if you first bind a context without a surface
then the default state for glDrawBuffers is GL_NONE instead of
GL_BACK. In practice Mesa doesn't seem to do this but we need to be
robust against a GL implementation that does. Therefore we track when
the CoglContext is first used with a CoglOnscreen and force the
glDrawBuffers state to be GL_BACK.

There is a further awkward part in that GLES2 doesn't actually have a
glDrawBuffers state but GLES3 does. GLES3 also defaults to GL_NONE in
this case so if GLES3 is available then we have to be sure to set the
state to GL_BACK. As far as I can tell that actually makes GLES3
incompatible with GLES2 because in theory if the application is not
aware of GLES3 then it should be able to assume the draw buffer is
always GL_BACK.

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

Conflicts:
	cogl/winsys/cogl-winsys-egl-kms.c
	cogl/winsys/cogl-winsys-egl-x11.c
2014-06-17 13:31:03 +01:00
Neil Roberts
eb7c37812a Add a COGL_EXT_IN_GLES3 option to specify extensions that are in GLES3
Some features that were previously available as an extension in GLES2
are now in core in GLES3 so we should be able to specify that with the
gles_availability mask of COGL_EXT_BEGIN so that GL implementations
advertising GLES3 don't have to additionally advertise the extension
for us to take advantage of it.

Reviewed-by: Robert Bragg <robert.bragg@intel.com>
(cherry picked from commit 4d892cd97558da61ba526f947ac0555ebab632d2)
2014-06-17 13:26:20 +01:00
Chun-wei Fan
f735220a9b MSVC 2010+ Projects: Update "Installation" Process
Currently, due to the way that Visual Studio 2010+ projects are handled,
the "install" project does not re-build upon changes to the sources, as it
does not believe that its dependencies have changed, although the changed
sources are automatically recompiled.  This means that if a part or more
of the solution does not build, or if the sources need some other fixes
or enhancements, the up-to-date build is not copied automatically, which
can be misleading.

Improve on the situation by forcing the "install" project to trigger its
rebuild, so that the updated binaries can be copied.  This does trigger an
MSBuild warning, but having that warning is way better than not having an
up-to-date build, especially during testing and development.
2014-06-09 18:43:12 +08:00
Felix Riemann
5556241b67 atlas-texture: Keep reference on potential destination atlas
When a new CoglAtlasTexture tries to fit into an existing CoglAtlas
it should make sure the atlas stays valid while it expands.

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

Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit 2eec9758f67e9073371c2edd63379324849373c4)
2014-05-19 12:47:09 +01:00
Kristian Høgsberg
22378d572b cogl-winsys-egl-kms: Call swap notify handler even when pageflip ioctl fails
This can happen when we dpms off the output or when login1 takes away
drm master status from our drm fd.  In either case, we need to call
the swap notify handler so that the compositor dosn't get stuck waiting
for that notification.  The compositor should stop repainting shortly in
both cases, as it's either going into dpms off mode or vt switching away.

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

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2014-04-30 16:41:09 +01:00
Kristian Høgsberg
8fb9cea451 cogl-winsys-egl-kms: Never set EGL_PLATFORM
This environment variable predates the reliable platform detection in mesa
and typically just causes crashes when the specified platform doesn't
match what's passed in.  Aside from being unecessary and problematic
it also leaks into the GNOME session, preventing clients from
automatically detecting the wayland platform.

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

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2014-04-30 16:41:06 +01:00
Emanuele Aina
27dbf700d6 framebuffer: Fix linkage from C++ applications
Prevent Cogl function names from being mangled when a C++ compiler is
being used by adding some missing COGL_{BEGIN,END}_DECLS guards.

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

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2014-04-22 12:14:56 +01:00
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