[waffle] [PATCH 5/7] nacl: add implementation for waffle_make_current

Tapani Pälli tapani.palli at intel.com
Tue Feb 3 22:23:59 PST 2015



On 02/03/2015 05:48 PM, Emil Velikov wrote:
> On 23 January 2015 at 07:59, Tapani Pälli <tapani.palli at intel.com> wrote:
>> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
>> ---
>>   src/waffle/nacl/nacl_container.cpp | 17 +++++++++++++++++
>>   src/waffle/nacl/nacl_container.h   |  1 +
>>   src/waffle/nacl/nacl_platform.c    |  2 +-
>>   3 files changed, 19 insertions(+), 1 deletion(-)
>>
>> diff --git a/src/waffle/nacl/nacl_container.cpp b/src/waffle/nacl/nacl_container.cpp
>> index bca39eb..abd64fd 100644
>> --- a/src/waffle/nacl/nacl_container.cpp
>> +++ b/src/waffle/nacl/nacl_container.cpp
>> @@ -135,6 +135,16 @@ nacl_resize(struct nacl_container *nc, int32_t width, int32_t height)
>>       return true;
>>   }
>>
>> +static bool
>> +nacl_makecurrent(waffle::nacl_container *nc)
>> +{
>> +    if (!nc)
>> +        return false;
>> +
>> +    nc->glSetCurrentContextPPAPI(nc->ctx.pp_resource());
>> +    return true;
>> +}
>> +
> [...]
>> diff --git a/src/waffle/nacl/nacl_platform.c b/src/waffle/nacl/nacl_platform.c
>> index b4df9d9..20a9739 100644
>> --- a/src/waffle/nacl/nacl_platform.c
>> +++ b/src/waffle/nacl/nacl_platform.c
>> @@ -68,7 +68,7 @@ nacl_platform_make_current(struct wcore_platform *wc_self,
>>                              struct wcore_window *wc_window,
>>                              struct wcore_context *wc_ctx)
>>   {
>> -    return false;
>> +    return nacl_makecurrent(nacl_platform(wc_self)->nacl);
> If I understood you correctly - in order to drop the current ctx one needs
>
> nc->glSetCurrentContextPPAPI(0);
>
> On the other hand, as wc_window/wc_ctx are NULL you'll still try to
> bind the ctx in nc->ctx.
> Is this some platform limitation ?

Nope, I forgot the NULL case! Thanks!

> -Emil
> _______________________________________________
> waffle mailing list
> waffle at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/waffle
>


More information about the waffle mailing list