-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GPU Process] REGRESSION: display-p3 stroke color in canvas crashes the webpage #19383
Conversation
EWS run on previous version of this PR (hash b970fd8) |
b970fd8
to
276ed08
Compare
EWS run on previous version of this PR (hash 276ed08) |
276ed08
to
aa1dc22
Compare
EWS run on current version of this PR (hash aa1dc22) |
Color color() const { return { m_colorData }; } | ||
const SRGBA<uint8_t>& colorData() const { return m_colorData; } | ||
SetInlineFillColor(SRGBA<uint8_t> colorData) | ||
: m_colorData(*Color(colorData).tryGetAsPackedInline()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bouncing between SRGBA<uint8_t>
, Color
and PackedColor::RGBA
doesn't seem great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this is correct. I think we should have a direct conversion from SRGBA<uint8_t>
to PackedColor::RGBA
. We need the opposite of SRGBA<uint8_t> asSRGBA(PackedColor::RGBA color)
. I will address this in a separate patch.
…he webpage https://bugs.webkit.org/show_bug.cgi?id=263387 rdar://117226767 Reviewed by Simon Fraser. Recording the inline path data items is enabled only if the state stroke has an inline color or if the stroke color was not changed since last time the state was committed. A crash will happen when the current stroke color is not inline (display-p3 for example) and it has been committed to the destination context in GPUP but the stroke thickness was changed. The item SetInlineStrokeColor tries to get the inline data a non inline color although the current stroke color is not inline and it has not changed. So the crash happens. The fix is to merge the inline stroke changes into one DisplayList item named SetInlineStroke. It has two optional members: the inline color data and the thickness. Each member will be set only if it was changed since last commit. For representing the color in SetInlineStroke, PackedColor::RGBA will be used instead of SRGBA<uint8_t> since it is easier to be encoded. * LayoutTests/fast/canvas/canvas-line-no-change-display-p3-stroke-expected.html: Added. * LayoutTests/fast/canvas/canvas-line-no-change-display-p3-stroke.html: Added. * Source/WebCore/platform/graphics/Color.h: (WebCore::Color::tryGetAsPackedInline const): * Source/WebCore/platform/graphics/displaylists/DisplayListItem.h: * Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::SetInlineStroke::apply const): (WebCore::DisplayList::SetInlineStroke::dump const): (WebCore::DisplayList::SetInlineStrokeColor::apply const): Deleted. (WebCore::DisplayList::SetInlineStrokeColor::dump const): Deleted. (WebCore::DisplayList::SetStrokeThickness::apply const): Deleted. (WebCore::DisplayList::SetStrokeThickness::dump const): Deleted. * Source/WebCore/platform/graphics/displaylists/DisplayListItems.h: (WebCore::DisplayList::SetInlineFillColor::SetInlineFillColor): (WebCore::DisplayList::SetInlineFillColor::color const): (WebCore::DisplayList::SetInlineFillColor::colorData const): (WebCore::DisplayList::SetInlineStroke::SetInlineStroke): (WebCore::DisplayList::SetInlineStroke::color const): (WebCore::DisplayList::SetInlineStroke::colorData const): (WebCore::DisplayList::SetInlineStroke::thickness const): (WebCore::DisplayList::SetInlineStrokeColor::SetInlineStrokeColor): Deleted. (WebCore::DisplayList::SetInlineStrokeColor::color const): Deleted. (WebCore::DisplayList::SetInlineStrokeColor::colorData const): Deleted. (WebCore::DisplayList::SetStrokeThickness::SetStrokeThickness): Deleted. (WebCore::DisplayList::SetStrokeThickness::thickness const): Deleted. * Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::Recorder::appendStateChangeItem): (WebCore::DisplayList::Recorder::buildSetInlineStroke): (WebCore::DisplayList::Recorder::strokePath): * Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h: * Source/WebCore/platform/graphics/displaylists/DisplayListRecorderImpl.cpp: (WebCore::DisplayList::RecorderImpl::recordSetInlineFillColor): (WebCore::DisplayList::RecorderImpl::recordSetInlineStroke): (WebCore::DisplayList::RecorderImpl::recordStrokeLineWithColorAndThickness): (WebCore::DisplayList::RecorderImpl::recordSetInlineStrokeColor): Deleted. (WebCore::DisplayList::RecorderImpl::recordSetStrokeThickness): Deleted. * Source/WebCore/platform/graphics/displaylists/DisplayListRecorderImpl.h: * Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.cpp: (WebKit::RemoteDisplayListRecorder::setInlineFillColor): (WebKit::RemoteDisplayListRecorder::setInlineStroke): (WebKit::RemoteDisplayListRecorder::strokeLineWithColorAndThickness): (WebKit::RemoteDisplayListRecorder::setInlineStrokeColor): Deleted. (WebKit::RemoteDisplayListRecorder::setStrokeThickness): Deleted. * Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.h: * Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.messages.in: * Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in: * Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.cpp: (WebKit::RemoteDisplayListRecorderProxy::recordSetInlineFillColor): (WebKit::RemoteDisplayListRecorderProxy::recordSetInlineStroke): (WebKit::RemoteDisplayListRecorderProxy::recordStrokeLineWithColorAndThickness): (WebKit::RemoteDisplayListRecorderProxy::recordSetInlineStrokeColor): Deleted. (WebKit::RemoteDisplayListRecorderProxy::recordSetStrokeThickness): Deleted. * Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.h: * Tools/TestWebKitAPI/Tests/WebCore/DisplayListTests.cpp: (TestWebKitAPI::TEST): * Tools/TestWebKitAPI/Tests/WebCore/cg/DisplayListTestsCG.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/269664@main
aa1dc22
to
922c037
Compare
Committed 269664@main (922c037): https://commits.webkit.org/269664@main Reviewed commits have been landed. Closing PR #19383 and removing active labels. |
922c037
aa1dc22