NEW 187002
Templatize DisplayListItems and use std::tuple to store the arguments
https://bugs.webkit.org/show_bug.cgi?id=187002
Summary Templatize DisplayListItems and use std::tuple to store the arguments
Said Abou-Hallawa
Reported 2018-06-25 08:46:21 PDT
Make it easier to add new DisplayList item and make it more mechanical to record and replay back the DisplayListItems.
Attachments
Patch (153.73 KB, patch)
2018-06-25 09:44 PDT, Said Abou-Hallawa
no flags
Patch (160.18 KB, patch)
2018-06-25 10:14 PDT, Said Abou-Hallawa
no flags
Patch (160.18 KB, patch)
2018-06-25 10:34 PDT, Said Abou-Hallawa
no flags
Patch (160.32 KB, patch)
2018-06-25 10:48 PDT, Said Abou-Hallawa
no flags
Patch (160.41 KB, patch)
2018-06-27 14:34 PDT, Said Abou-Hallawa
no flags
Patch (160.43 KB, patch)
2018-06-27 15:14 PDT, Said Abou-Hallawa
no flags
Patch (160.40 KB, patch)
2018-06-27 15:48 PDT, Said Abou-Hallawa
no flags
Archive of layout-test-results from ews102 for mac-sierra (2.47 MB, application/zip)
2018-06-27 17:02 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews104 for mac-sierra-wk2 (1.43 MB, application/zip)
2018-06-27 17:05 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews123 for ios-simulator-wk2 (10.50 MB, application/zip)
2018-06-27 17:29 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews116 for mac-sierra (3.84 MB, application/zip)
2018-06-27 17:41 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews205 for win-future (12.82 MB, application/zip)
2018-06-27 20:31 PDT, EWS Watchlist
no flags
Patch (160.62 KB, patch)
2018-07-13 20:22 PDT, Said Abou-Hallawa
no flags
Patch (160.62 KB, patch)
2018-07-13 20:59 PDT, Said Abou-Hallawa
no flags
Archive of layout-test-results from ews106 for mac-sierra-wk2 (932.38 KB, application/zip)
2018-07-13 21:58 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews102 for mac-sierra (2.55 MB, application/zip)
2018-07-13 22:12 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews126 for ios-simulator-wk2 (2.39 MB, application/zip)
2018-07-13 22:51 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews113 for mac-sierra (3.33 MB, application/zip)
2018-07-13 22:54 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews204 for win-future (12.78 MB, application/zip)
2018-07-14 08:50 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews200 for win-future (12.78 MB, application/zip)
2018-07-14 09:33 PDT, EWS Watchlist
no flags
Patch (160.65 KB, patch)
2018-07-17 10:41 PDT, Said Abou-Hallawa
no flags
Patch (160.66 KB, patch)
2018-07-17 10:47 PDT, Said Abou-Hallawa
no flags
Patch (161.51 KB, patch)
2018-07-17 11:22 PDT, Said Abou-Hallawa
no flags
Patch (161.76 KB, patch)
2018-07-17 11:45 PDT, Said Abou-Hallawa
no flags
Archive of layout-test-results from ews101 for mac-sierra (2.32 MB, application/zip)
2018-07-17 12:50 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews112 for mac-sierra (3.04 MB, application/zip)
2018-07-17 13:47 PDT, EWS Watchlist
no flags
Patch (163.49 KB, patch)
2018-07-17 14:01 PDT, Said Abou-Hallawa
no flags
Patch (164.19 KB, patch)
2018-07-17 14:08 PDT, Said Abou-Hallawa
no flags
Archive of layout-test-results from ews103 for mac-sierra (2.30 MB, application/zip)
2018-07-17 15:25 PDT, EWS Watchlist
no flags
Patch (166.47 KB, patch)
2018-07-17 15:26 PDT, Said Abou-Hallawa
no flags
Patch (166.57 KB, patch)
2018-07-25 18:28 PDT, Said Abou-Hallawa
ews-watchlist: commit-queue-
Archive of layout-test-results from ews206 for win-future (12.92 MB, application/zip)
2018-07-26 14:37 PDT, EWS Watchlist
no flags
Said Abou-Hallawa
Comment 1 2018-06-25 09:44:03 PDT
Said Abou-Hallawa
Comment 2 2018-06-25 10:14:44 PDT
Said Abou-Hallawa
Comment 3 2018-06-25 10:34:43 PDT
Said Abou-Hallawa
Comment 4 2018-06-25 10:48:48 PDT
Simon Fraser (smfr)
Comment 5 2018-06-25 11:05:35 PDT
Comment on attachment 343513 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=343513&action=review I'm not convinced this is worthwhile. If we frequently added new drawing items it could be, but the list is pretty stable. > LayoutTests/displaylists/extent-includes-shadow-expected.txt:4 > - (x 0.00) > - (y 0.00)) > + (arguments(0) 0.00) > + (arguments(1) 0.00)) This seems like a distinct downside of this approach: you can't easily identify the properties in dumps any more.
Said Abou-Hallawa
Comment 6 2018-06-25 12:26:49 PDT
Comment on attachment 343513 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=343513&action=review I don't think the list of ListDisplayItems is fixed. In the patch https://bugs.webkit.org/attachment.cgi?id=335043&action=review, I add seven new items. To get the form controls working, we will need to add more items. Please also notice that <https://trac.webkit.org/changeset/229672>, a new recorder and new set of DisplayListItems were added to the Cairo port. A similar but more verbose approach was taken by this patch. The dump() functions in this patch, don't even print the arguments. They just print the function name. >> LayoutTests/displaylists/extent-includes-shadow-expected.txt:4 >> + (arguments(1) 0.00)) > > This seems like a distinct downside of this approach: you can't easily identify the properties in dumps any more. This can be fixed by passing the parameters' names as template parameters along with the types. I just did not do because I felt it is not worthy. But I can do it if this will make this patch worthy.
Said Abou-Hallawa
Comment 7 2018-06-27 14:34:20 PDT
Said Abou-Hallawa
Comment 8 2018-06-27 15:14:41 PDT
Said Abou-Hallawa
Comment 9 2018-06-27 15:48:16 PDT
zalan
Comment 10 2018-06-27 15:50:40 PDT
(In reply to Said Abou-Hallawa from comment #8) > Created attachment 343758 [details] > Patch When you are in a lldb session, does this change make debugging/printing variables more difficult?
EWS Watchlist
Comment 11 2018-06-27 17:02:07 PDT
Comment on attachment 343762 [details] Patch Attachment 343762 [details] did not pass mac-ews (mac): Output: https://webkit-queues.webkit.org/results/8364123 New failing tests: inspector/canvas/recording-webgl.html displaylists/extent-includes-shadow.html displaylists/extent-includes-transforms.html
EWS Watchlist
Comment 12 2018-06-27 17:02:09 PDT
Created attachment 343772 [details] Archive of layout-test-results from ews102 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews102 Port: mac-sierra Platform: Mac OS X 10.12.6
EWS Watchlist
Comment 13 2018-06-27 17:05:46 PDT
Comment on attachment 343762 [details] Patch Attachment 343762 [details] did not pass mac-wk2-ews (mac-wk2): Output: https://webkit-queues.webkit.org/results/8364237 Number of test failures exceeded the failure limit.
EWS Watchlist
Comment 14 2018-06-27 17:05:48 PDT
Created attachment 343773 [details] Archive of layout-test-results from ews104 for mac-sierra-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews104 Port: mac-sierra-wk2 Platform: Mac OS X 10.12.6
EWS Watchlist
Comment 15 2018-06-27 17:29:05 PDT
Comment on attachment 343762 [details] Patch Attachment 343762 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: https://webkit-queues.webkit.org/results/8364109 Number of test failures exceeded the failure limit.
EWS Watchlist
Comment 16 2018-06-27 17:29:07 PDT
Created attachment 343777 [details] Archive of layout-test-results from ews123 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews123 Port: ios-simulator-wk2 Platform: Mac OS X 10.13.4
EWS Watchlist
Comment 17 2018-06-27 17:41:24 PDT
Comment on attachment 343762 [details] Patch Attachment 343762 [details] did not pass mac-debug-ews (mac): Output: https://webkit-queues.webkit.org/results/8364342 New failing tests: fast/events/dropzone-001.html displaylists/extent-includes-shadow.html fast/events/drag-and-drop.html displaylists/extent-includes-transforms.html legacy-animation-engine/animations/play-state.html
EWS Watchlist
Comment 18 2018-06-27 17:41:26 PDT
Created attachment 343778 [details] Archive of layout-test-results from ews116 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews116 Port: mac-sierra Platform: Mac OS X 10.12.6
EWS Watchlist
Comment 19 2018-06-27 20:30:51 PDT
Comment on attachment 343762 [details] Patch Attachment 343762 [details] did not pass win-ews (win): Output: https://webkit-queues.webkit.org/results/8365652 New failing tests: http/tests/preload/onload_event.html
EWS Watchlist
Comment 20 2018-06-27 20:31:03 PDT
Created attachment 343787 [details] Archive of layout-test-results from ews205 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: ews205 Port: win-future Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
Simon Fraser (smfr)
Comment 21 2018-06-28 08:30:07 PDT
I still don't think this is a useful direction to go in. You fixed logging these classes, but debugging them is still going to be painful.
Said Abou-Hallawa
Comment 22 2018-06-29 07:29:12 PDT
(In reply to Simon Fraser (smfr) from comment #21) > I still don't think this is a useful direction to go in. You fixed logging > these classes, but debugging them is still going to be painful. I don't think this is true unless I misunderstood the purpose of these classes or I misunderstood what you meant by "painful debugging". My understanding is these classes have very short life cycle and have very specific purpose. They are meant to pack some arguments when recording and unpack them when replaying back. I think the most useful way to debug them is through dumping the whole DisplayList. This is where, optimization opportunities could be found. Although I do not expect someone will debug inside these classes, you can still step inside the functions and set breakpoints as you wish. The only difference is there is one create() function and one apply() function in which we dispatch the call to GraphicsContext. If this is not what you want, you can set the breakpoint in DisplayListRecorder API, which are the creators of these classes. And you can set the breakpoint in the GraphicsContext functions which will be called from the apply() method of these classes. Also you can watch the item's contents the same way as you do today. Here is the expansion of the FillRect item in the Xcode watch window: this WebCore::DisplayList::FillRect * 0x11d60ae70 0x000000011d60ae70 WebCore::DisplayList::FillRectBase WebCore::DisplayList::FillRectBase WebCore::DisplayList::GeometryItem WebCore::DisplayList::GeometryItem WebCore::DisplayList::Item WebCore::DisplayList::Item WTF::RefCounted<WebCore::DisplayList::Item> WTF::RefCounted<WebCore::DisplayList::Item> m_type WebCore::DisplayList::ItemType FillRect m_extent std::optional<WebCore::FloatRect> WebCore::DisplayList::GraphicsItem<void (WebCore::GraphicsContext::*)(const WebCore::FloatRect &), void (WebCore::GraphicsContext::*)(const WebCore::FloatRect &), WebCore::FloatRect> WebCore::DisplayList::GraphicsItem<void (WebCore::GraphicsContext::*)(const WebCore::FloatRect &), void (WebCore::GraphicsContext::*)(const WebCore::FloatRect &), WebCore::FloatRect> m_arguments std::__1::tuple<WebCore::FloatRect> size=1 [0] WebCore::FloatRect m_location WebCore::FloatPoint m_x float 10 m_y float 10 m_size WebCore::FloatSize m_width float 55 m_height float 50 There are three extra nodes' levels using the new code: two because of the multiple inheritance and one because of packing all the arguments in std::tuple. If this is what you considered to be "painful debugging" I can collapse the class hierarchy although I would consider this a little bit unclean design. Alternatively I could add an Xcode extension to view these classes the way we want. For me this change is useful and worthwhile. 1. It eliminates 1300 lines of code. The old code is 2400 lines and the new is 1100 lines (DisplayListItems.h and DisplayListItems.cpp). 2. It makes adding and changing an item easier just in one place. It makes all the dump strings in one place. 3. It makes the relationship between the items and GraphicsContext more strongly typed. The types of the arguments have to match the types of the GraphicsContext function.
Said Abou-Hallawa
Comment 23 2018-06-29 07:29:50 PDT
(In reply to zalan from comment #10) > (In reply to Said Abou-Hallawa from comment #8) > > Created attachment 343758 [details] > > Patch > When you are in a lldb session, does this change make debugging/printing > variables more difficult? No. It should not.
Said Abou-Hallawa
Comment 24 2018-07-13 20:22:47 PDT
Said Abou-Hallawa
Comment 25 2018-07-13 20:59:16 PDT
EWS Watchlist
Comment 26 2018-07-13 21:58:37 PDT
Comment on attachment 345019 [details] Patch Attachment 345019 [details] did not pass mac-wk2-ews (mac-wk2): Output: https://webkit-queues.webkit.org/results/8533348 Number of test failures exceeded the failure limit.
EWS Watchlist
Comment 27 2018-07-13 21:58:39 PDT
Created attachment 345022 [details] Archive of layout-test-results from ews106 for mac-sierra-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews106 Port: mac-sierra-wk2 Platform: Mac OS X 10.12.6
EWS Watchlist
Comment 28 2018-07-13 22:12:42 PDT
Comment on attachment 345019 [details] Patch Attachment 345019 [details] did not pass mac-ews (mac): Output: https://webkit-queues.webkit.org/results/8533432 New failing tests: fast/events/drag-display-none-element.html inspector/canvas/recording-webgl.html displaylists/extent-includes-shadow.html http/tests/misc/acid3.html displaylists/extent-includes-transforms.html
EWS Watchlist
Comment 29 2018-07-13 22:12:43 PDT
Created attachment 345024 [details] Archive of layout-test-results from ews102 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews102 Port: mac-sierra Platform: Mac OS X 10.12.6
EWS Watchlist
Comment 30 2018-07-13 22:51:45 PDT
Comment on attachment 345019 [details] Patch Attachment 345019 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: https://webkit-queues.webkit.org/results/8533460 Number of test failures exceeded the failure limit.
EWS Watchlist
Comment 31 2018-07-13 22:51:47 PDT
Created attachment 345026 [details] Archive of layout-test-results from ews126 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews126 Port: ios-simulator-wk2 Platform: Mac OS X 10.13.4
EWS Watchlist
Comment 32 2018-07-13 22:54:31 PDT
Comment on attachment 345019 [details] Patch Attachment 345019 [details] did not pass mac-debug-ews (mac): Output: https://webkit-queues.webkit.org/results/8533600 New failing tests: fast/events/dropzone-001.html displaylists/extent-includes-shadow.html fast/events/drag-and-drop.html displaylists/extent-includes-transforms.html legacy-animation-engine/animations/play-state.html
EWS Watchlist
Comment 33 2018-07-13 22:54:33 PDT
Created attachment 345027 [details] Archive of layout-test-results from ews113 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews113 Port: mac-sierra Platform: Mac OS X 10.12.6
EWS Watchlist
Comment 34 2018-07-14 08:50:25 PDT
Comment on attachment 345019 [details] Patch Attachment 345019 [details] did not pass win-ews (win): Output: https://webkit-queues.webkit.org/results/8536639 New failing tests: editing/pasteboard/drag-link-with-data-transfer-adds-trusted-link-to-pasteboard.html
EWS Watchlist
Comment 35 2018-07-14 08:50:36 PDT
Created attachment 345035 [details] Archive of layout-test-results from ews204 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: ews204 Port: win-future Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
EWS Watchlist
Comment 36 2018-07-14 09:32:50 PDT
Comment on attachment 345019 [details] Patch Attachment 345019 [details] did not pass win-ews (win): Output: https://webkit-queues.webkit.org/results/8536815 New failing tests: http/tests/security/video-poster-cross-origin-crash2.html
EWS Watchlist
Comment 37 2018-07-14 09:33:02 PDT
Created attachment 345036 [details] Archive of layout-test-results from ews200 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: ews200 Port: win-future Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
Said Abou-Hallawa
Comment 38 2018-07-17 10:41:17 PDT
Said Abou-Hallawa
Comment 39 2018-07-17 10:47:00 PDT
Said Abou-Hallawa
Comment 40 2018-07-17 11:22:53 PDT
Said Abou-Hallawa
Comment 41 2018-07-17 11:45:39 PDT
EWS Watchlist
Comment 42 2018-07-17 12:50:36 PDT
Comment on attachment 345175 [details] Patch Attachment 345175 [details] did not pass mac-ews (mac): Output: https://webkit-queues.webkit.org/results/8565875 New failing tests: displaylists/replay-skip-clipped-rect.html displaylists/extent-includes-shadow.html displaylists/extent-includes-transforms.html displaylists/layer-dispay-list.html
EWS Watchlist
Comment 43 2018-07-17 12:50:38 PDT
Created attachment 345183 [details] Archive of layout-test-results from ews101 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews101 Port: mac-sierra Platform: Mac OS X 10.12.6
EWS Watchlist
Comment 44 2018-07-17 13:47:17 PDT
Comment on attachment 345175 [details] Patch Attachment 345175 [details] did not pass mac-debug-ews (mac): Output: https://webkit-queues.webkit.org/results/8566148 New failing tests: displaylists/replay-skip-clipped-rect.html displaylists/extent-includes-shadow.html displaylists/extent-includes-transforms.html displaylists/layer-dispay-list.html
EWS Watchlist
Comment 45 2018-07-17 13:47:19 PDT
Created attachment 345187 [details] Archive of layout-test-results from ews112 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews112 Port: mac-sierra Platform: Mac OS X 10.12.6
Said Abou-Hallawa
Comment 46 2018-07-17 14:01:36 PDT
Said Abou-Hallawa
Comment 47 2018-07-17 14:08:41 PDT
EWS Watchlist
Comment 48 2018-07-17 15:25:19 PDT
Comment on attachment 345191 [details] Patch Attachment 345191 [details] did not pass mac-ews (mac): Output: https://webkit-queues.webkit.org/results/8567242 New failing tests: displaylists/extent-includes-shadow.html displaylists/extent-includes-transforms.html
EWS Watchlist
Comment 49 2018-07-17 15:25:21 PDT
Created attachment 345196 [details] Archive of layout-test-results from ews103 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews103 Port: mac-sierra Platform: Mac OS X 10.12.6
Said Abou-Hallawa
Comment 50 2018-07-17 15:26:37 PDT
Radar WebKit Bug Importer
Comment 51 2018-07-24 12:56:53 PDT
Jon Lee
Comment 52 2018-07-24 21:22:55 PDT
Comment on attachment 345197 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=345197&action=review > Source/WebCore/ChangeLog:24 > + -- GraphicsItem: It's a template class which takes a pointer to a GraphicsContext Given this is another base class, "GraphicsItem" is confusing because it makes it sound like Item is its superclass. > Source/WebCore/platform/graphics/displaylists/DisplayListItems.h:181 > + void iterarte(Functor&& functor) const Do you mean iterate? If it's a naming conflict, a slightly more verbose name should be preferred.
Said Abou-Hallawa
Comment 53 2018-07-25 18:28:12 PDT
Said Abou-Hallawa
Comment 54 2018-07-25 18:31:11 PDT
Comment on attachment 345197 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=345197&action=review >> Source/WebCore/ChangeLog:24 >> + -- GraphicsItem: It's a template class which takes a pointer to a GraphicsContext > > Given this is another base class, "GraphicsItem" is confusing because it makes it sound like Item is its superclass. I renamed it to GraphicsApplier. >> Source/WebCore/platform/graphics/displaylists/DisplayListItems.h:181 >> + void iterarte(Functor&& functor) const > > Do you mean iterate? If it's a naming conflict, a slightly more verbose name should be preferred. Yes it is typo. I renamed it to iterateOverArguments().
EWS Watchlist
Comment 55 2018-07-26 14:36:49 PDT
Comment on attachment 345808 [details] Patch Attachment 345808 [details] did not pass win-ews (win): Output: https://webkit-queues.webkit.org/results/8665116 New failing tests: http/tests/security/local-video-source-from-remote.html
EWS Watchlist
Comment 56 2018-07-26 14:37:01 PDT
Created attachment 345872 [details] Archive of layout-test-results from ews206 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: ews206 Port: win-future Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
Note You need to log in before you can comment on or make changes to this bug.