Bug 100745 - [EFL][WK2][AC] Use smart pointers for Evas_GL types
Summary: [EFL][WK2][AC] Use smart pointers for Evas_GL types
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit EFL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-30 04:03 PDT by Chris Dumez
Modified: 2012-10-31 18:39 PDT (History)
8 users (show)

See Also:


Attachments
Patch (20.57 KB, patch)
2012-10-30 06:22 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (21.92 KB, patch)
2012-10-31 06:24 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (21.84 KB, patch)
2012-10-31 06:59 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2012-10-30 04:03:37 PDT
We recently started using smart pointers in WK2 EFL port. However, the accelerated compositing code is still using raw pointers for Evas_GL* objects.
We should fix this.
Comment 1 Chris Dumez 2012-10-30 06:22:12 PDT
Created attachment 171433 [details]
Patch
Comment 2 Chris Dumez 2012-10-31 05:38:49 PDT
Any feedback on this patch please?
Comment 3 Kenneth Rohde Christiansen 2012-10-31 06:01:22 PDT
Comment on attachment 171433 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=171433&action=review

> Source/WebKit2/UIProcess/API/efl/EvasGLSurface.cpp:33
> +EvasGLSurface::EvasGLSurface(Evas_GL* evasGl, Evas_GL_Surface* surface)

Maybe call this passSurface as you pass ownership?

> Source/WebKit2/UIProcess/API/efl/EvasGLSurface.h:46
> +        return adoptPtr(new EvasGLSurface(evasGl, surface));

// Sets m_evasGL.

I suppose we should use GL and not Gl in accordance with style guide

> Source/WebKit2/UIProcess/API/efl/EvasGLSurface.h:55
> +    Evas_GL* m_evasGl;

What are you using this for? Ah it is being set by the ctor.

> Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:254
> +        evas_gl_make_current(m_evasGl.get(), m_evasGlSurface->surface(), m_evasGlContext->context());

wouldn't ->get() not be more consistent? hmm I see that won't work as it already exists.
Comment 4 Chris Dumez 2012-10-31 06:24:36 PDT
Created attachment 171633 [details]
Patch

Take Kenneth's feedback into consideration.
Comment 5 Kenneth Rohde Christiansen 2012-10-31 06:48:40 PDT
Comment on attachment 171633 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=171633&action=review

> Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:471
> +    evas_gl_native_surface_get(m_evasGL.get(), m_evasGLSurface->surface(), &nativeSurface);
>      evas_object_image_native_surface_set(sd->image, &nativeSurface);
>  
> -    evas_gl_make_current(m_evasGl, m_evasGlSurface, m_evasGlContext);
> +    evas_gl_make_current(m_evasGL.get(), m_evasGLSurface->surface(), m_evasGLContext->context());

why not call evasGL() instead of m_evasGL.get().

> Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:473
> +    Evas_GL_API* gl = evas_gl_api_get(evasGL());

like here we  are doing so
Comment 6 Chris Dumez 2012-10-31 06:59:45 PDT
Created attachment 171645 [details]
Patch

Take Kenneth's feedback into consideration.

Good point, it looks nicer and more consistent.
Comment 7 WebKit Review Bot 2012-10-31 09:48:54 PDT
Comment on attachment 171645 [details]
Patch

Clearing flags on attachment: 171645

Committed r133041: <http://trac.webkit.org/changeset/133041>
Comment 8 WebKit Review Bot 2012-10-31 09:48:59 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 Gyuyoung Kim 2012-10-31 18:39:25 PDT
Comment on attachment 171645 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=171645&action=review

Sorry for late comments. But, it seems to me there are some nits.

> Source/WebKit2/PlatformEfl.cmake:45
> +    UIProcess/API/efl/EvasGLContext.cpp

Wrong alphabetical order.

> Source/WebKit2/PlatformEfl.cmake:46
> +    UIProcess/API/efl/EvasGLSurface.cpp

ditto.

> Source/WebKit2/UIProcess/API/efl/EvasGLSurface.cpp:35
> +    , m_surface(passSurface)

passSurface ? I think surface is just enough.

> Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:493
> +        EINA_LOG_DOM_WARN(_ewk_log_dom, "Failed to create GLContext.");

We already define WARN macro for this.

> Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:499
> +        EINA_LOG_DOM_WARN(_ewk_log_dom, "Failed to create GLSurface.");

ditto.