WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
136220
[GTK] Add WaylandSurface
https://bugs.webkit.org/show_bug.cgi?id=136220
Summary
[GTK] Add WaylandSurface
Zan Dobersek
Reported
2014-08-25 04:11:14 PDT
[GTK] Add WaylandSurface
Attachments
Patch
(6.50 KB, patch)
2014-08-25 04:32 PDT
,
Zan Dobersek
no flags
Details
Formatted Diff
Diff
Patch
(7.45 KB, patch)
2014-08-25 13:14 PDT
,
Zan Dobersek
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from webkit-ews-14 for mac-mountainlion-wk2
(585.12 KB, application/zip)
2014-08-25 19:20 PDT
,
Build Bot
no flags
Details
Patch
(7.54 KB, patch)
2014-08-26 01:43 PDT
,
Zan Dobersek
mrobinson
: review+
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Zan Dobersek
Comment 1
2014-08-25 04:32:22 PDT
Created
attachment 237077
[details]
Patch
WebKit Commit Bot
Comment 2
2014-08-25 04:33:22 PDT
Attachment 237077
[details]
did not pass style-queue: ERROR: Source/WebCore/platform/graphics/wayland/WaylandSurface.h:33: Alphabetical sorting problem. [build/include_order] [4] ERROR: Source/WebCore/platform/graphics/wayland/WaylandSurface.h:34: Alphabetical sorting problem. [build/include_order] [4] Total errors found: 2 in 3 files If any of these errors are false positives, please file a bug against check-webkit-style.
Martin Robinson
Comment 3
2014-08-25 13:00:03 PDT
Comment on
attachment 237077
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=237077&action=review
> Source/WebCore/platform/graphics/wayland/WaylandSurface.cpp:43 > +const struct wl_callback_listener WaylandSurface::m_frameListener = { > + // frame_callback > + [](void*, struct wl_callback* callback, uint32_t) > + { > + if (callback) > + wl_callback_destroy(callback); > + } > +};
Why make this a lambda instead of simply a static method or function?
Zan Dobersek
Comment 4
2014-08-25 13:14:23 PDT
Created
attachment 237103
[details]
Patch
WebKit Commit Bot
Comment 5
2014-08-25 13:15:33 PDT
Attachment 237103
[details]
did not pass style-queue: ERROR: Source/WebCore/platform/graphics/wayland/WaylandSurface.h:33: Alphabetical sorting problem. [build/include_order] [4] ERROR: Source/WebCore/platform/graphics/wayland/WaylandSurface.h:34: Alphabetical sorting problem. [build/include_order] [4] Total errors found: 2 in 4 files If any of these errors are false positives, please file a bug against check-webkit-style.
Zan Dobersek
Comment 6
2014-08-25 13:25:04 PDT
Comment on
attachment 237077
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=237077&action=review
>> Source/WebCore/platform/graphics/wayland/WaylandSurface.cpp:43 >> +}; > > Why make this a lambda instead of simply a static method or function?
It's more C++-like, and the functions are short enough to fit into a lambda. I find them prettier as they don't pollute class declarations like static methods would, and they don't feel unrelated to the class like standalone functions would, but that is a matter of personal taste. This still generates a separate function, just like a static method or a standalone function would.
Martin Robinson
Comment 7
2014-08-25 13:32:11 PDT
Comment on
attachment 237077
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=237077&action=review
>>> Source/WebCore/platform/graphics/wayland/WaylandSurface.cpp:43 >>> +}; >> >> Why make this a lambda instead of simply a static method or function? > > It's more C++-like, and the functions are short enough to fit into a lambda. I find them prettier as they don't pollute class declarations like static methods would, and they don't feel unrelated to the class like standalone functions would, but that is a matter of personal taste. > > This still generates a separate function, just like a static method or a standalone function would.
I'm not sure it makes sense to do this here, since you don't need to use it as a lambda. Making a function with a name is less confusing. The new features are cool, but we don't *have* to use them if it doesn't fit. :)
Build Bot
Comment 8
2014-08-25 19:20:42 PDT
Comment on
attachment 237103
[details]
Patch
Attachment 237103
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-queues.appspot.com/results/4532765248716800
New failing tests: accessibility/accessibility-node-memory-management.html compositing/absolute-inside-out-of-view-fixed.html animations/added-while-suspended.html canvas/philip/tests/2d.canvas.readonly.html http/tests/appcache/404-manifest.html animations/3d/change-transform-in-end-event.html
Build Bot
Comment 9
2014-08-25 19:20:46 PDT
Created
attachment 237125
[details]
Archive of layout-test-results from webkit-ews-14 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-14 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.5
Zan Dobersek
Comment 10
2014-08-26 00:53:40 PDT
Comment on
attachment 237077
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=237077&action=review
>>>> Source/WebCore/platform/graphics/wayland/WaylandSurface.cpp:43 >>>> +}; >>> >>> Why make this a lambda instead of simply a static method or function? >> >> It's more C++-like, and the functions are short enough to fit into a lambda. I find them prettier as they don't pollute class declarations like static methods would, and they don't feel unrelated to the class like standalone functions would, but that is a matter of personal taste. >> >> This still generates a separate function, just like a static method or a standalone function would. > > I'm not sure it makes sense to do this here, since you don't need to use it as a lambda. Making a function with a name is less confusing. The new features are cool, but we don't *have* to use them if it doesn't fit. :)
I'd argue that lambdas are generally used because they can be used -- they weren't available before C++11 and in this specific use case static methods or functions were used instead, working equally well. The biggest disadvantage of lambdas as used here is that you don't have a named function and have to use an additional comment to make it clear what function this lambda represents. What I do like about this approach is that lambdas in this static private member initialization can directly access private members on an object of this class. I find this more attractive than having some number of static private methods on a class and using those, but only if the actual function body is short enough so that everything remains readable. I'll switch back to static methods to push this patch forward.
Zan Dobersek
Comment 11
2014-08-26 01:43:17 PDT
Created
attachment 237140
[details]
Patch
WebKit Commit Bot
Comment 12
2014-08-26 01:45:06 PDT
Attachment 237140
[details]
did not pass style-queue: ERROR: Source/WebCore/platform/graphics/wayland/WaylandSurface.h:33: Alphabetical sorting problem. [build/include_order] [4] ERROR: Source/WebCore/platform/graphics/wayland/WaylandSurface.h:34: Alphabetical sorting problem. [build/include_order] [4] Total errors found: 2 in 4 files If any of these errors are false positives, please file a bug against check-webkit-style.
Martin Robinson
Comment 13
2014-08-26 08:29:41 PDT
Comment on
attachment 237140
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=237140&action=review
Looks good. Glad to see this moving forward. Please make these few small changes before landing.
> Source/WebCore/PlatformGTK.cmake:438 > + platform/graphics/wayland/WaylandSurface.cpp > ${DERIVED_SOURCES_WEBCORE_DIR}/WebKitGtkWaylandClientProtocol.c
The WebKit CMake style specifies that there should be a blank line between files in different directories.
> Source/WebCore/platform/graphics/wayland/WaylandSurface.h:49 > + void resize(int, int);
You should specify the variable names here or pass IntSize.
> Source/WebCore/platform/graphics/wayland/WaylandSurface.h:56 > + static const struct wl_callback_listener m_frameListener;
This doesn't need to be a static member of the class. It's enough to make it static in the source file.
> Source/WebCore/platform/graphics/wayland/WaylandSurface.h:57 > + static void frameCallback(void*, struct wl_callback*, uint32_t);
Ditto.
Zan Dobersek
Comment 14
2014-08-27 23:09:37 PDT
Committed
r173052
: <
http://trac.webkit.org/changeset/173052
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug