[waffle] [PATCH v3 2/4] waffle: add support for building Waffle using NaCl toolchain

2015-01-04 Thread Tapani Pälli
Patch adds changes required to use NaCl compiler and libraries to build Waffle. Build can be configured to use specific version of the NaCl SDK, toolchain for the build needs to be selected with cmake variable CMAKE_TOOLCHAIN_FILE. Example command line to configure a build: cmake -Dwaffle_has_nac

[waffle] [PATCH v3 3/4] waffle: initial empty implementation of nacl backend

2015-01-04 Thread Tapani Pälli
Patch adds nacl platform skeleton. Only thing it does is that it creates a container that holds the 3D context object which is responsible for any communication required with browser. v2: cleanups, remove unnecessary casts, use c99 initializer (Emil Velikov) v3: additional code cleanups (Chad

[waffle] [PATCH v3 4/4] waffle: update man pages with nacl changes

2015-01-04 Thread Tapani Pälli
Signed-off-by: Tapani Pälli --- man/waffle_enum.3.xml | 1 + man/waffle_init.3.xml | 8 2 files changed, 9 insertions(+) diff --git a/man/waffle_enum.3.xml b/man/waffle_enum.3.xml index a96bd20..07edd6c 100644 --- a/man/waffle_enum.3.xml +++ b/man/waffle_enum.3.xml @@ -101,6 +101,7 @@ e

[waffle] [PATCH v3 0/4] Initial NaCl patches v3

2015-01-04 Thread Tapani Pälli
Hello; Here is v3 of nacl support patches with many changes and fixes here and there! Thanks for Emil and Chad for review, I think it looks a lot cleaner now. In case you want to try on Chrome, I also put 'demo' of gl_basic here: http://koti.kapsi.fi/~tpalli/nacl/ Note that you'll need to enabl

[waffle] [PATCH v3 1/4] examples: add waffle_has_x11_egl check for simple-x11-egl

2015-01-04 Thread Tapani Pälli
v2: remove redudant parenthesis (Chad) Signed-off-by: Tapani Pälli --- examples/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 281ef47..c700a72 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLis

[waffle] [PATCH 17/17] examples/gl_basic: Update to use waffle_window_create2()

2015-01-04 Thread Chad Versace
Tested on GLX, X11/EGL, Wayland, and GBM. Signed-off-by: Chad Versace --- examples/gl_basic.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/examples/gl_basic.c b/examples/gl_basic.c index 69418c8..6f57799 100644 --- a/examples/gl_basic.c +++ b/examples/gl_basic.c

[waffle] [PATCH 08/17] core: Add func wcore_attrib_list_from_int32 (v2)

2015-01-04 Thread Chad Versace
This function converts an int32_t attribute list to an intptr_t attribute list. It will be needed in the future when updating waffle_config_choose() to accept an intptr_t attribute list. Signed-off-by: Chad Versace --- src/waffle/core/wcore_attrib_list.c | 48

[waffle] [PATCH 03/17] core: Rename functions s/wcore_attrib_list/wcore_attrib_list32/

2015-01-04 Thread Chad Versace
When designing the original Waffle 1.0 API, I made a mistake when I chose to declare attribute lists as arrays of int32_t. Instead, they should have been arrays of intptr_t. A new public function, waffle_window_create2, will have a `const intptr_t attrib_list[]` parameter. Therefore waffle needs i

[waffle] [PATCH 09/17] waffle: Fix mismatch in waffle_window_create prototype

2015-01-04 Thread Chad Versace
The prototype differed between the public header and file waffle_window.c. This is solely a cosmetic change, because 'int' and 'int32_t' are the same on all platforms supported by Waffle. Signed-off-by: Chad Versace --- src/waffle/api/waffle_window.c | 2 +- 1 file changed, 1 insertion(+), 1 de

[waffle] [PATCH 14/17] core: Add func wcore_attrib_list_pop()

2015-01-04 Thread Chad Versace
This is useful for removing attributes as they are parsed. Signed-off-by: Chad Versace --- src/waffle/core/wcore_attrib_list.c | 40 + src/waffle/core/wcore_attrib_list.h | 6 ++ 2 files changed, 46 insertions(+) diff --git a/src/waffle/core/wcore_attrib

[waffle] [PATCH 12/17] core: Add attrib_list param to func (v2) wcore_platform::window::create

2015-01-04 Thread Chad Versace
This prepares for adding waffle_window_create2() to Waffle's public API, which will have an attrib_list parameter. No attributes are supported yet. Therefore this patch validates, at the top of each ${PLATFORM}_window_create(), that the attrib_list is empty. Signed-off-by: Chad Versace --- v2:

[waffle] [PATCH 16/17] tests/gl_basic: Update to use waffle_window_create2()

2015-01-04 Thread Chad Versace
Tested on GLX, X11/EGL, and Wayland. Signed-off-by: Chad Versace --- tests/functional/gl_basic_test.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/functional/gl_basic_test.c b/tests/functional/gl_basic_test.c index 0e932e3..19b0dac 100644 --- a/tests/functio

[waffle] [PATCH 07/17] core: Add arithmetic functions that detect overflow

2015-01-04 Thread Chad Versace
Define the function below. All act on size_t inputs. wcore_add_size wcore_iadd_size : in-place addition wcore_mul_size wcore_imul_size : in-place multiplication Future patches will use the functions to safely calculate the 'size' value given to malloc. Signed-off-by: Chad Versace

[waffle] [PATCH 06/17] core: Define intptr_t variants of wcore_attrib_list functions (v2)

2015-01-04 Thread Chad Versace
When designing the original Waffle 1.0 API, I made a mistake when I chose to declare attribute lists as arrays of int32_t. Instead, they should have been arrays of intptr_t. A new public function, waffle_window_create2, will have a `const intptr_t attrib_list[]` parameter. Therefore waffle needs i

[waffle] [PATCH 11/17] core: Add func wcore_error_bad_attribute

2015-01-04 Thread Chad Versace
This little helper function emits WAFFLE_ERROR_BAD_ATTRIBUTE with a default error message. Signed-off-by: Chad Versace --- src/waffle/core/wcore_error.c | 8 src/waffle/core/wcore_error.h | 4 2 files changed, 12 insertions(+) diff --git a/src/waffle/core/wcore_error.c b/src/waffl

[waffle] [PATCH 15/17] waffle: Add public func waffle_window_create2() (v2)

2015-01-04 Thread Chad Versace
Today, waffle_window() has only two parameters: width and height. Frank Henigman wants to extend Waffle's GBM backend with the ability to post window contents to the display. Multiple methods exist for posting content to the screen with the drm API, and that method should be configurable per waffl

[waffle] [PATCH 10/17] waffle: Fix signature of wcore_platform::window::create()

2015-01-04 Thread Chad Versace
Fix signature to match that of waffle_window_create(). The types of parameters 'width' and 'height' didn't match the public header. As a consequence, also fix the signature of ${PLATFORM}_window_create() for all platforms. Signed-off-by: Chad Versace --- src/waffle/android/droid_window.c | 4

[waffle] [PATCH 05/17] core: Define wcore_attrib_list funcs with type-generic template

2015-01-04 Thread Chad Versace
The current wcore_attrib_list functions work on int32_t attribute lists. A future commit will add variants that work on intptr_t attribute lists. To prevent code duplication, this patch moves the definition of all wcore_attrib_list32 functions into a type-generic macro, WCORE_ATTRIB_LIST_COMMON_FUN

[waffle] [PATCH 04/17] core: Change return type of wcore_attrib_list32_length

2015-01-04 Thread Chad Versace
Change from int32_t to size_t, because - Length is a measurement of unsigned "size". - In general, length values are often used in subsequent calculation of memory size which is passed to functions like malloc, whose input is size_t not int. - The cast from ptrdiff_t to int3

[waffle] [PATCH 13/17] core: Add func wcore_attrib_list_copy() (v2)

2015-01-04 Thread Chad Versace
This is useful for making a writable copy of a read-only attribute list. Signed-off-by: Chad Versace --- src/waffle/core/wcore_attrib_list.c | 37 + src/waffle/core/wcore_attrib_list.h | 3 +++ 2 files changed, 40 insertions(+) v2: - Correctly handle mal

[waffle] [PATCH 02/17] include: Deprecate waffle_attrib_list funcs

2015-01-04 Thread Chad Versace
It was a mistake when I decided to make Waffle's attribute lists 32-bit. Instead, the lists should have had type intptr_t[] to allow pointer input-output. To correct that original mistake, I will soon introduce some new public functions that have `intptr_t attrib_list[]` parameters. I'm deprecati

[waffle] [PATCH 00/17 v2] Add new public function waffle_window_create2 (v2)

2015-01-04 Thread Chad Versace
This patch series is available at git://github.com/chadversary/waffle refs/tags/waffle_window_create2-v02 Today, waffle_window() has only two parameters: width and height. Frank Henigman wants to extend Waffle's GBM backend with the ability to post window contents to the display. Multiple metho

[waffle] [PATCH 01/17] include: Define macro WAFFLE_DEPRECATED_1_06

2015-01-04 Thread Chad Versace
This macro annotates symbols as deprecated in Waffle 1.6. The compiler emits deprecation warnings only if the user enables the feature macro for the Waffle 1.6 API. Signed-off-by: Chad Versace --- include/waffle/waffle.h | 12 1 file changed, 12 insertions(+) diff --git a/include/w

Re: [waffle] [PATCH v2 2/4] waffle: add support for building Waffle using NaCl toolchain

2015-01-04 Thread Emil Velikov
On 31/12/14 18:36, Chad Versace wrote: > On 12/30/2014 11:30 PM, Tapani Pälli wrote: >> On 12/30/2014 12:53 AM, Emil Velikov wrote: >>> On 22/12/14 22:28, Chad Versace wrote: On 12/21/2014 07:53 AM, Emil Velikov wrote: > On 17 December 2014 at 10:17, Tapani Pälli wrote: >> Patch adds