Use more Uint8ClampedArray& and constness in filter and image buffer code
Created attachment 327557 [details] Patch
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.
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
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
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
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
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
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
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
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
Created attachment 327571 [details] Patch
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.
Created attachment 327572 [details] Patch
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.
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.
Created attachment 327585 [details] Patch
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.
Comment on attachment 327585 [details] Patch Clearing flags on attachment: 327585 Committed r225147: <https://trac.webkit.org/changeset/225147>
<rdar://problem/35690466>