Bug 129676 - [EFL] Replace GraphicsContext3D with Evas_GL in AcceleratedCompositingContext.
Summary: [EFL] Replace GraphicsContext3D with Evas_GL in AcceleratedCompositingContext.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit EFL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Linux
: P2 Normal
Assignee: Hyowon Kim
URL:
Keywords:
Depends on: 129797
Blocks: 79766 129853 129875
  Show dependency treegraph
 
Reported: 2014-03-04 03:06 PST by Hyowon Kim
Modified: 2014-03-11 01:44 PDT (History)
8 users (show)

See Also:


Attachments
Patch (7.37 KB, patch)
2014-03-04 16:54 PST, Hyowon Kim
no flags Details | Formatted Diff | Diff
Patch (7.42 KB, patch)
2014-03-04 21:10 PST, Hyowon Kim
no flags Details | Formatted Diff | Diff
Patch (7.49 KB, patch)
2014-03-05 20:02 PST, Hyowon Kim
no flags Details | Formatted Diff | Diff
Patch (7.52 KB, patch)
2014-03-05 20:37 PST, Hyowon Kim
no flags Details | Formatted Diff | Diff
Patch (7.49 KB, patch)
2014-03-06 22:36 PST, Hyowon Kim
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hyowon Kim 2014-03-04 03:06:37 PST
As the GraphicsContext3D instance is created by TextureMapperGL, 
this patch removes the uses of GraphicsContext3D for AcceleratedCompositingContext 
and adds an EFL specific context using Evas_GL.
Comment 1 Hyowon Kim 2014-03-04 16:54:17 PST
Created attachment 225831 [details]
Patch
Comment 2 Gyuyoung Kim 2014-03-04 18:17:45 PST
Comment on attachment 225831 [details]
Patch

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

> Source/WebKit/efl/ChangeLog:3
> +        [EFL] Replace GraphicsContext3D with Evas_GL in AcceleratedCompositingContext.

Could you explain why we need to replace GraphicsContext3D with Evas_GL ? Any benefit ?

> Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.cpp:69
> +    int width = 0;

Please use Evas_Coord to be used by evas_object_geometry_get()

e.g. Evas_Coord width, height;

> Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.h:44
> +    bool resize(const IntSize&);

Why should this function be public ?
Comment 3 Hyowon Kim 2014-03-04 21:10:00 PST
Created attachment 225851 [details]
Patch
Comment 4 Hyowon Kim 2014-03-04 21:11:30 PST
(In reply to comment #2)
> (From update of attachment 225831 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=225831&action=review
> 
> > Source/WebKit/efl/ChangeLog:3
> > +        [EFL] Replace GraphicsContext3D with Evas_GL in AcceleratedCompositingContext.
> 
> Could you explain why we need to replace GraphicsContext3D with Evas_GL ? Any benefit ?

TextureMapperGL has its own GraphicsContext3D created by  createForCurrentGLContext(). So AcceleratedCompositingContext doesn't need to create and set it to TextureMapperGL anymore.
But, we should do 'makeCurrentContext' by using a platform specific context before createForCurrentGLContext().
This patch removes GraphicsContext3D related codes in AcceleratedCompositingContext and adds EvasGLContext/Surface to it instead.

> > Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.cpp:69
> > +    int width = 0;
> 
> Please use Evas_Coord to be used by evas_object_geometry_get()
> 
> e.g. Evas_Coord width, height;

Done.

> > Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.h:44
> > +    bool resize(const IntSize&);
> 
> Why should this function be public ?

If webview size is changed, we will have to resize the EvasGLSurface.
Comment 5 Gyuyoung Kim 2014-03-05 01:45:01 PST
Comment on attachment 225851 [details]
Patch

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

> TextureMapperGL has its own GraphicsContext3D created by  createForCurrentGLContext(). So AcceleratedCompositingContext doesn't need to create and set it to  TextureMapperGL anymore.
But, we should do 'makeCurrentContext' by using a platform specific context before createForCurrentGLContext().

It would be good if you write this reason to ChangeLog.


This patch removes GraphicsContext3D related codes in AcceleratedCompositingContext and adds EvasGLContext/Surface to it instead.

> Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.h:44
> +    bool resize(const IntSize&);

> > > Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.h:44
> > > +    bool resize(const IntSize&);
> > 
> > Why should this function be public ?
> 
> If webview size is changed, we will have to resize the EvasGLSurface.

I don't see well. So, you may call it from other places in future, right ?

> Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.h:61
> +    OwnPtr<Evas_GL> m_evasGL;

Please use c++11 (e.g. std::unique_ptr<>) instead of OwnPtr.
Comment 6 Hyowon Kim 2014-03-05 20:02:06 PST
Created attachment 225944 [details]
Patch
Comment 7 Hyowon Kim 2014-03-05 20:06:34 PST
(In reply to comment #5)

> It would be good if you write this reason to ChangeLog.

Done. 

> > > > Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.h:44
> > > > +    bool resize(const IntSize&);
> > > 
> > > Why should this function be public ?
> > 
> > If webview size is changed, we will have to resize the EvasGLSurface.
> 
> I don't see well. So, you may call it from other places in future, right ?

Right.
 
> > Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.h:61
> > +    OwnPtr<Evas_GL> m_evasGL;
> 
> Please use c++11 (e.g. std::unique_ptr<>) instead of OwnPtr.

I think we should file a new bug to replace OwnPtr<> with unique_ptr<> for EFL objects.
I can't use unique_ptr<> for Evas_GL right now, 
because we have to add a custom deleter like deleteOwnedPtr() for OwnPtr<>.
Fixing this is out of this patch's scope, don't you think?
Comment 8 Hyowon Kim 2014-03-05 20:37:44 PST
Created attachment 225946 [details]
Patch
Comment 9 Ryuan Choi 2014-03-05 22:14:17 PST
Comment on attachment 225946 [details]
Patch

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

> Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.cpp:65
> +    m_evasGLContext = WebKit::EvasGLContext::create(m_evasGL.get());

Hmm, at least, I think that we should fix it before landed this.

EvasGLContext is in WebCore/
I believe that EvasGLContext should be in WebCore namespace.
Comment 10 Gyuyoung Kim 2014-03-05 23:10:36 PST
Comment on attachment 225946 [details]
Patch

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

r- based on review comments.

> Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.h:61
> +    OwnPtr<Evas_GL> m_evasGL;

OwnPtr is being replaced by C+11 (e.g. std::unique_ptr) So, it would be good if you start to use it in this patch.

Loot at the meta bug.

Convert OwnPtr and PassOwnPtr uses to std::unique_ptr
https://bugs.webkit.org/show_bug.cgi?id=128007
Comment 11 Gyuyoung Kim 2014-03-05 23:12:34 PST
(In reply to comment #7)

> > > Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.h:61
> > > +    OwnPtr<Evas_GL> m_evasGL;
> > 
> > Please use c++11 (e.g. std::unique_ptr<>) instead of OwnPtr.
> 
> I think we should file a new bug to replace OwnPtr<> with unique_ptr<> for EFL objects.
> I can't use unique_ptr<> for Evas_GL right now, 
> because we have to add a custom deleter like deleteOwnedPtr() for OwnPtr<>.
> Fixing this is out of this patch's scope, don't you think?

Ah, I missed to read this comment. If there is additional work to use it, please file a new bug for it.
Comment 12 Hyowon Kim 2014-03-06 17:03:24 PST
> > Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.cpp:65
> > +    m_evasGLContext = WebKit::EvasGLContext::create(m_evasGL.get());
> 
> Hmm, at least, I think that we should fix it before landed this.
> 
> EvasGLContext is in WebCore/
> I believe that EvasGLContext should be in WebCore namespace.

Good point. Done. #129797
Comment 13 Hyowon Kim 2014-03-06 17:42:15 PST
(In reply to comment #11)
> (In reply to comment #7)
> 
> > > > Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.h:61
> > > > +    OwnPtr<Evas_GL> m_evasGL;
> > > 
> > > Please use c++11 (e.g. std::unique_ptr<>) instead of OwnPtr.
> > 
> > I think we should file a new bug to replace OwnPtr<> with unique_ptr<> for EFL objects.
> > I can't use unique_ptr<> for Evas_GL right now, 
> > because we have to add a custom deleter like deleteOwnedPtr() for OwnPtr<>.
> > Fixing this is out of this patch's scope, don't you think?
> 
> Ah, I missed to read this comment. If there is additional work to use it, please file a new bug for it.

I've added another bug for it. bug 129853
Comment 14 Hyowon Kim 2014-03-06 22:36:19 PST
Created attachment 226087 [details]
Patch
Comment 15 Gyuyoung Kim 2014-03-06 23:05:45 PST
Comment on attachment 226087 [details]
Patch

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

LGTM except for my small comment.

> Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.h:44
> +    bool resize(const IntSize&);

I think it would be good to keep it as *private* until using by other classes.
Comment 16 Ryuan Choi 2014-03-07 18:18:26 PST
Committed r165314: <http://trac.webkit.org/changeset/165314>
Comment 17 Ryuan Choi 2014-03-07 18:20:09 PST
Comment on attachment 226087 [details]
Patch

clearing flags. I landed manually after moved resize() to private section like gyuyoung mentioned.