RESOLVED FIXED Bug 180008
Use more Uint8ClampedArray& and constness in filter and image buffer code
https://bugs.webkit.org/show_bug.cgi?id=180008
Summary Use more Uint8ClampedArray& and constness in filter and image buffer code
Simon Fraser (smfr)
Reported 2017-11-24 14:26:01 PST
Use more Uint8ClampedArray& and constness in filter and image buffer code
Attachments
Patch (99.50 KB, patch)
2017-11-24 14:27 PST, Simon Fraser (smfr)
no flags
Archive of layout-test-results from ews103 for mac-elcapitan (2.12 MB, application/zip)
2017-11-24 15:25 PST, EWS Watchlist
no flags
Archive of layout-test-results from ews104 for mac-elcapitan-wk2 (2.53 MB, application/zip)
2017-11-24 15:36 PST, EWS Watchlist
no flags
Archive of layout-test-results from ews123 for ios-simulator-wk2 (2.11 MB, application/zip)
2017-11-24 15:51 PST, EWS Watchlist
no flags
Archive of layout-test-results from ews112 for mac-elcapitan (3.33 MB, application/zip)
2017-11-24 16:03 PST, EWS Watchlist
no flags
Patch (104.00 KB, patch)
2017-11-24 22:25 PST, Simon Fraser (smfr)
no flags
Patch (104.00 KB, patch)
2017-11-24 23:10 PST, Simon Fraser (smfr)
darin: review+
Patch (103.57 KB, patch)
2017-11-26 08:46 PST, Simon Fraser (smfr)
no flags
Simon Fraser (smfr)
Comment 1 2017-11-24 14:27:19 PST
EWS Watchlist
Comment 2 2017-11-24 14:29:44 PST
Attachment 327557 [details] did not pass style-queue: ERROR: Source/WebCore/platform/graphics/filters/FEConvolveMatrix.cpp:400: Declaration has space between type name and * in m_bias * 255 [whitespace/declaration] [3] Total errors found: 1 in 32 files If any of these errors are false positives, please file a bug against check-webkit-style.
EWS Watchlist
Comment 3 2017-11-24 15:25:51 PST
Comment on attachment 327557 [details] Patch Attachment 327557 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/5352446 New failing tests: css3/filters/filter-on-overflow-hidden.html
EWS Watchlist
Comment 4 2017-11-24 15:25:52 PST
Created attachment 327558 [details] Archive of layout-test-results from ews103 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews103 Port: mac-elcapitan Platform: Mac OS X 10.11.6
EWS Watchlist
Comment 5 2017-11-24 15:36:54 PST
Comment on attachment 327557 [details] Patch Attachment 327557 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/5352458 New failing tests: css3/filters/filter-on-overflow-hidden.html
EWS Watchlist
Comment 6 2017-11-24 15:36:55 PST
Created attachment 327559 [details] Archive of layout-test-results from ews104 for mac-elcapitan-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews104 Port: mac-elcapitan-wk2 Platform: Mac OS X 10.11.6
EWS Watchlist
Comment 7 2017-11-24 15:51:42 PST
Comment on attachment 327557 [details] Patch Attachment 327557 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: http://webkit-queues.webkit.org/results/5352475 New failing tests: css3/filters/filter-on-overflow-hidden.html
EWS Watchlist
Comment 8 2017-11-24 15:51:44 PST
Created attachment 327560 [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.12.6
EWS Watchlist
Comment 9 2017-11-24 16:03:47 PST
Comment on attachment 327557 [details] Patch Attachment 327557 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/5352513 New failing tests: css3/filters/effect-reference-hw.html css3/filters/effect-reference-ordering-hw.html css3/filters/filter-on-overflow-hidden.html css3/filters/effect-reference.html svg/filters/feGaussianBlur.svg svg/filters/feGaussianBlur-zero-deviation.svg css3/filters/effect-reference-ordering.html
EWS Watchlist
Comment 10 2017-11-24 16:03:48 PST
Created attachment 327561 [details] Archive of layout-test-results from ews112 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews112 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Simon Fraser (smfr)
Comment 11 2017-11-24 22:25:13 PST
EWS Watchlist
Comment 12 2017-11-24 22:28:19 PST
Attachment 327571 [details] did not pass style-queue: ERROR: Source/WebCore/platform/graphics/filters/FEConvolveMatrix.cpp:400: Declaration has space between type name and * in m_bias * 255 [whitespace/declaration] [3] Total errors found: 1 in 36 files If any of these errors are false positives, please file a bug against check-webkit-style.
Simon Fraser (smfr)
Comment 13 2017-11-24 23:10:55 PST
EWS Watchlist
Comment 14 2017-11-24 23:12:14 PST
Attachment 327572 [details] did not pass style-queue: ERROR: Source/WebCore/platform/graphics/filters/FEConvolveMatrix.cpp:400: Declaration has space between type name and * in m_bias * 255 [whitespace/declaration] [3] Total errors found: 1 in 36 files If any of these errors are false positives, please file a bug against check-webkit-style.
Darin Adler
Comment 15 2017-11-25 11:15:55 PST
Comment on attachment 327572 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=327572&action=review I probably would have used auto in quite a few places instead of writing out types > Source/WebCore/platform/graphics/cg/ImageBufferDataCG.cpp:485 > + RetainPtr<CGContextRef> sourceContext = adoptCF(CGBitmapContextCreate(reinterpret_cast<void*>(const_cast<uint8_t*>(srcRows)), width.unsafeGet(), height.unsafeGet(), 8, srcBytesPerRow, colorSpace, kCGImageAlphaPremultipliedLast)); The reinterpret_cast should not be needed here: the const_cast alone should be sufficient, because we can pass a uint8_t* as a void* without a cast. > Source/WebCore/platform/graphics/cg/ImageBufferDataCG.cpp:494 > + srcRows = const_cast<const uint8_t*>(destRows); A const_cast should not be needed to add const, only to remove it. We should be able to assign to a variable of type const uint8_t* with uint8_t* without a cast. > Source/WebCore/platform/graphics/cg/ImageBufferDataCG.cpp:542 > + src.data = reinterpret_cast<void*>(const_cast<uint8_t*>(srcRows)); The reinterpret_cast should not be needed here: the const_cast alone should be sufficient, because we can pass assign to a void* with a uint8_t* without a cast. > Source/WebCore/platform/graphics/cg/ImageBufferDataCG.cpp:571 > + srcRows = const_cast<const uint8_t*>(destRows); A const_cast should not be needed to add const, only to remove it. We should be able to assign to a variable of type const uint8_t* with uint8_t* without a cast. > Source/WebCore/platform/graphics/cpu/arm/filters/FECompositeArithmeticNEON.h:47 > + const uint32_t* sourcePixel = reinterpret_cast<uint32_t*>(source); I believe this won’t compile unless we change the type inside reinterpret_cast to "const uint32_t*", not just the type of the local.
Simon Fraser (smfr)
Comment 16 2017-11-26 08:46:01 PST
EWS Watchlist
Comment 17 2017-11-26 08:47:33 PST
Attachment 327585 [details] did not pass style-queue: ERROR: Source/WebCore/platform/graphics/filters/FEConvolveMatrix.cpp:400: Declaration has space between type name and * in m_bias * 255 [whitespace/declaration] [3] Total errors found: 1 in 36 files If any of these errors are false positives, please file a bug against check-webkit-style.
WebKit Commit Bot
Comment 18 2017-11-26 12:03:06 PST
Comment on attachment 327585 [details] Patch Clearing flags on attachment: 327585 Committed r225147: <https://trac.webkit.org/changeset/225147>
Radar WebKit Bug Importer
Comment 19 2017-11-26 15:14:29 PST
Note You need to log in before you can comment on or make changes to this bug.