RESOLVED FIXED 109165
[WK2][EFL] Removal of non coordinated graphics code path from WK2 EFL
https://bugs.webkit.org/show_bug.cgi?id=109165
Summary [WK2][EFL] Removal of non coordinated graphics code path from WK2 EFL
Mikhail Pozdnyakov
Reported 2013-02-07 03:13:07 PST
SSIA. Please refer to webkit-efl ML for details: https://lists.webkit.org/pipermail/webkit-efl/2013-February/000497.html
Attachments
patch (30.57 KB, patch)
2013-02-07 03:28 PST, Mikhail Pozdnyakov
no flags
patch v2 (30.80 KB, patch)
2013-02-07 04:00 PST, Mikhail Pozdnyakov
no flags
patch v3 (31.16 KB, patch)
2013-02-07 05:02 PST, Mikhail Pozdnyakov
no flags
patch v4 (32.95 KB, patch)
2013-02-07 05:53 PST, Mikhail Pozdnyakov
no flags
Mikhail Pozdnyakov
Comment 1 2013-02-07 03:28:00 PST
Kenneth Rohde Christiansen
Comment 2 2013-02-07 03:30:45 PST
Comment on attachment 187044 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=187044&action=review > Source/WebKit2/UIProcess/API/efl/EvasGLContext.h:48 > - inline Evas_GL_Context* context() const { return m_context; } > + Evas_GL_Context* context() { return m_context; } why unrelated changed?
Mikhail Pozdnyakov
Comment 3 2013-02-07 03:53:32 PST
(In reply to comment #2) > (From update of attachment 187044 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=187044&action=review > > > Source/WebKit2/UIProcess/API/efl/EvasGLContext.h:48 > > - inline Evas_GL_Context* context() const { return m_context; } > > + Evas_GL_Context* context() { return m_context; } > > why unrelated changed? I just could not pass through :) but it's off course worth mentioning in change log
Mikhail Pozdnyakov
Comment 4 2013-02-07 04:00:07 PST
Created attachment 187050 [details] patch v2 updated changelog.
Kalyan
Comment 5 2013-02-07 04:47:22 PST
Comment on attachment 187050 [details] patch v2 View in context: https://bugs.webkit.org/attachment.cgi?id=187050&action=review > Source/WebKit2/UIProcess/API/efl/EwkView.h:156 > + void update(const WebCore::IntRect& rect = WebCore::IntRect()); should the semantics change?? we don't care about the rect and do a full update with coordinategraphics
Mikhail Pozdnyakov
Comment 6 2013-02-07 05:01:07 PST
(In reply to comment #5) > (From update of attachment 187050 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=187050&action=review > > > Source/WebKit2/UIProcess/API/efl/EwkView.h:156 > > + void update(const WebCore::IntRect& rect = WebCore::IntRect()); > > should the semantics change?? we don't care about the rect and do a full update with coordinategraphics Yeah, thanks for the catch!
Mikhail Pozdnyakov
Comment 7 2013-02-07 05:02:50 PST
Created attachment 187065 [details] patch v3 Took Kalyan's comment into consideration.
Mikhail Pozdnyakov
Comment 8 2013-02-07 05:53:19 PST
Created attachment 187079 [details] patch v4 Also renamed EwkView::update() to EwkView::scheduleUpdateDisplay.
Kalyan
Comment 9 2013-02-07 07:35:35 PST
(In reply to comment #8) > Created an attachment (id=187079) [details] > patch v4 > > Also renamed EwkView::update() to EwkView::scheduleUpdateDisplay. Should we name it something like scheduleSceneUpdate (to represent what we do in timer callback function). otherwise LGTM.
Kenneth Rohde Christiansen
Comment 10 2013-02-07 08:28:02 PST
Comment on attachment 187079 [details] patch v4 LGTM
Viatcheslav Ostapenko
Comment 11 2013-02-07 09:28:45 PST
Comment on attachment 187079 [details] patch v4 View in context: https://bugs.webkit.org/attachment.cgi?id=187079&action=review > Source/WebKit2/UIProcess/API/efl/EvasGLContext.h:48 > + Evas_GL_Context* context() { return m_context; } Why do you remove const here? Also inline doesn't make any harm. > Source/WebKit2/UIProcess/API/efl/EvasGLSurface.h:56 > + Evas_GL_Surface* surface() { return m_surface; } ditto
Chris Dumez
Comment 12 2013-02-07 09:38:13 PST
Comment on attachment 187079 [details] patch v4 View in context: https://bugs.webkit.org/attachment.cgi?id=187079&action=review >> Source/WebKit2/UIProcess/API/efl/EvasGLContext.h:48 >> + Evas_GL_Context* context() { return m_context; } > > Why do you remove const here? Also inline doesn't make any harm. It was discussed on the webkit-dev mailing list not too long ago that we should not make such methods const unless they return a const pointer. Since pointer being returned is not const, I think removing const is correct. However, I agree that keeping the inline statement does not hurt.
Viatcheslav Ostapenko
Comment 13 2013-02-07 10:47:53 PST
(In reply to comment #12) > (From update of attachment 187079 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=187079&action=review > > >> Source/WebKit2/UIProcess/API/efl/EvasGLContext.h:48 > >> + Evas_GL_Context* context() { return m_context; } > > > > Why do you remove const here? Also inline doesn't make any harm. > > It was discussed on the webkit-dev mailing list not too long ago that we should not make such methods const unless they return a const pointer. Since pointer being returned is not const, I think removing const is correct. However, I agree that keeping the inline statement does not hurt. As I remember, there was not conclusion. At least I didn't see any updates to webkit style or anywhere else. Honestly, I didn't see any reasonable points in this discussion in any case. Removing "const" hints the compiler, that object might change inside method and compiler will not optimize usage of this method. In this case compiler has the method body, so it will inline and optimize it in any case, so I don't like this just because it is unrelated change, but in general blindly removing consts is a bad idea.
Mikhail Pozdnyakov
Comment 14 2013-02-07 11:57:25 PST
(In reply to comment #13) > (In reply to comment #12) > > (From update of attachment 187079 [details] [details]) > > View in context: https://bugs.webkit.org/attachment.cgi?id=187079&action=review > > > > >> Source/WebKit2/UIProcess/API/efl/EvasGLContext.h:48 > > >> + Evas_GL_Context* context() { return m_context; } > > > > > > Why do you remove const here? Also inline doesn't make any harm. > > > > It was discussed on the webkit-dev mailing list not too long ago that we should not make such methods const unless they return a const pointer. Since pointer being returned is not const, I think removing const is correct. However, I agree that keeping the inline statement does not hurt. > > As I remember, there was not conclusion. At least I didn't see any updates to webkit style or anywhere else. Honestly, I didn't see any reasonable points in this discussion in any case. > Removing "const" hints the compiler, that object might change inside method and compiler will not optimize usage of this method. > In this case compiler has the method body, so it will inline and optimize it in any case, so I don't like this just because it is unrelated change, but in general blindly removing consts is a bad idea. Const methods are not used for compiler optimization but rather used to show logical constness! The ML discussion around this: https://lists.webkit.org/pipermail/webkit-dev/2012-October/022576.html. Having const in this particular case makes absolutely no sense.
Viatcheslav Ostapenko
Comment 15 2013-02-07 12:15:21 PST
> Const methods are not used for compiler optimization but rather used to show logical constness! Yes, it is used. > The ML discussion around this: https://lists.webkit.org/pipermail/webkit-dev/2012-October/022576.html. > > Having const in this particular case makes absolutely no sense. Yes, it is. For example, if there is several calls to const method, compiler might optimize it to single call and keep it in temporary variable. Compiler also could reorder calls to const methods if necessary. If the method is not const, it is not allowed because non-const method are assumed to change object state. > The ML discussion around this: https://lists.webkit.org/pipermail/webkit-dev/2012-October/022576.html. Yes, I know. I've seen it.
WebKit Review Bot
Comment 16 2013-02-07 13:21:50 PST
Comment on attachment 187079 [details] patch v4 Clearing flags on attachment: 187079 Committed r142169: <http://trac.webkit.org/changeset/142169>
WebKit Review Bot
Comment 17 2013-02-07 13:21:56 PST
All reviewed patches have been landed. Closing bug.
Mikhail Pozdnyakov
Comment 18 2013-02-07 15:23:21 PST
(In reply to comment #15) > > Const methods are not used for compiler optimization but rather used to show logical constness! > > Yes, it is used. > > > > The ML discussion around this: https://lists.webkit.org/pipermail/webkit-dev/2012-October/022576.html. > > > > Having const in this particular case makes absolutely no sense. > > Yes, it is. > For example, if there is several calls to const method, compiler might optimize it to single call and keep it in temporary variable. Compiler also could reorder calls to const methods if necessary. > If the method is not const, it is not allowed because non-const method are assumed to change object state. > > > The ML discussion around this: https://lists.webkit.org/pipermail/webkit-dev/2012-October/022576.html. > > Yes, I know. I've seen it. The definition is: "const member function - member function declared not to modify the state of the object for which it is called." (Bjarne Stroustrup: The C++ Programming Language (Special Edition)). Nothing is written about optimization. The fact that compiler might make optimizations for const methods does not mean that const methods should be treated as means of optimization. They should be used so that logical constness of the object is kept.
Note You need to log in before you can comment on or make changes to this bug.