Bug 282380
Summary: | [GTK][WPE][Skia] WebKitTestRunner asserts when generating pixel test dumps in SKIA_DEBUG enabled builds | ||
---|---|---|---|
Product: | WebKit | Reporter: | Nikolas Zimmermann <zimmermann> |
Component: | WPE WebKit | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | bugs-noreply, cgarcia |
Priority: | P2 | ||
Version: | WebKit Local Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Nikolas Zimmermann
WebKitTestRunner asserts when generating pixel test dumps in SKIA_DEBUG enabled builds:
Running e.g. run-test-runner --wpe --release --no-timeout --pixel-tests -- $PWD/LayoutTests/css3/filters/animation-from-initial-values-with-color-matrix.html:
Content-Type: text/plain
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x584
...
/host/home/nzimmermann/Software/GitRepositories/WebKit/Source/ThirdParty/skia/include/core/SkPixmap.h:327: fatal error: "check(1 == fInfo.bytesPerPixel())"
Backtrace:
* thread #1, name = 'WebKitTestRunne', stop reason = signal SIGILL: illegal operand
* frame #0: 0x00006339ad5ae550 WebKitTestRunner`sk_abort_no_print() at SkMemory_malloc.cpp:60:5
frame #1: 0x00006339ad3be4c7 WebKitTestRunner`SkPixmap::addr8(this=0x00007fffdde430c0) const::'lambda'()::operator()() const at SkPixmap.h:327:329
frame #2: 0x00006339ad3be457 WebKitTestRunner`WTR::TestInvocation::dumpPixelsAndCompareWithExpected(WTR::TestInvocation::SnapshotResultType, OpaqueWKArray const*, OpaqueWKImage const*) [inlined] SkPixmap::addr8(this=0x00007fffdde430f0) const at SkPixmap.h:327:120
frame #3: 0x00006339ad3be452 WebKitTestRunner`WTR::TestInvocation::dumpPixelsAndCompareWithExpected(WTR::TestInvocation::SnapshotResultType, OpaqueWKArray const*, OpaqueWKImage const*) [inlined] WTR::computeSHA1HashStringForPixmap[abi:cxx11](pixmap=0x00007fffdde430f0) at TestInvocationSkia.cpp:51:37
frame #4: 0x00006339ad3be452 WebKitTestRunner`WTR::TestInvocation::dumpPixelsAndCompareWithExpected(this=0x00007f87d403c7c0, snapshotType=<unavailable>, repaintRects=<unavailable>, webImage=<unavailable>) at TestInvocationSkia.cpp:104:25
frame #5: 0x00006339ad3a077b WebKitTestRunner`WTR::TestInvocation::dumpResults(this=0x00007f87d403c7c0) at TestInvocation.cpp:0
frame #6: 0x00006339ad3a03dd WebKitTestRunner`WTR::TestInvocation::invoke(this=0x00007f87d403c7c0) at TestInvocation.cpp:212:5
frame #7: 0x00006339ad38631d WebKitTestRunner`WTR::TestController::runTest(this=0x00007fffdde43590, inputLine=<unavailable>) at TestController.cpp:1718:26
frame #8: 0x00006339ad37ea3c WebKitTestRunner`WTR::TestController::TestController(int, char const**) [inlined] WTR::TestController::run(this=0x00007fffdde43590) at TestController.cpp:1776:18```
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Nikolas Zimmermann
`SkPixmap::addr8()` can only be used on pixmaps that use 1 byte for the color -- we use 4 bytes (RGBA).
Nikolas Zimmermann
Easiest way to fix:
```
diff --git a/Tools/WebKitTestRunner/skia/TestInvocationSkia.cpp b/Tools/WebKitTestRunner/skia/TestInvocationSkia.cpp
index b6d7e81cf7a7..39ec9b69f03c 100644
--- a/Tools/WebKitTestRunner/skia/TestInvocationSkia.cpp
+++ b/Tools/WebKitTestRunner/skia/TestInvocationSkia.cpp
@@ -44,12 +44,12 @@ namespace WTR {
static std::string computeSHA1HashStringForPixmap(const SkPixmap& pixmap)
{
size_t pixelsWidth = pixmap.width();
- size_t pixelsHight = pixmap.height();
+ size_t pixelsHeight = pixmap.height();
size_t bytesPerRow = pixmap.info().minRowBytes();
SHA1 sha1;
- const auto* bitmapData = pixmap.addr8();
- for (size_t row = 0; row < pixelsHight; ++row) {
+ const auto* bitmapData = reinterpret_cast<const uint8_t*>(pixmap.addr32());
+ for (size_t row = 0; row < pixelsHeight; ++row) {
sha1.addBytes(std::span { bitmapData, 4 * pixelsWidth });
bitmapData += bytesPerRow;
```
Nikolas Zimmermann
Easiest way to fix:
```
diff --git a/Tools/WebKitTestRunner/skia/TestInvocationSkia.cpp b/Tools/WebKitTestRunner/skia/TestInvocationSkia.cpp
index b6d7e81cf7a7..39ec9b69f03c 100644
--- a/Tools/WebKitTestRunner/skia/TestInvocationSkia.cpp
+++ b/Tools/WebKitTestRunner/skia/TestInvocationSkia.cpp
@@ -44,12 +44,12 @@ namespace WTR {
static std::string computeSHA1HashStringForPixmap(const SkPixmap& pixmap)
{
size_t pixelsWidth = pixmap.width();
- size_t pixelsHight = pixmap.height();
+ size_t pixelsHeight = pixmap.height();
size_t bytesPerRow = pixmap.info().minRowBytes();
SHA1 sha1;
- const auto* bitmapData = pixmap.addr8();
- for (size_t row = 0; row < pixelsHight; ++row) {
+ const auto* bitmapData = reinterpret_cast<const uint8_t*>(pixmap.addr32());
+ for (size_t row = 0; row < pixelsHeight; ++row) {
sha1.addBytes(std::span { bitmapData, 4 * pixelsWidth });
bitmapData += bytesPerRow;
```