Finish encoding/decoding support for DisplayList::SetState
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Dec 2019 22:53:28 +0000 (22:53 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Dec 2019 22:53:28 +0000 (22:53 +0000)
commit62c690298772b6fdcb0442c855f5fb6a506cd0fc
tree82ccb5456232c817612db5b1b75d130d03850cb6
parentb03fb4f43635d2ab4c2e985ae9474f47c7aa07f9
Finish encoding/decoding support for DisplayList::SetState
https://bugs.webkit.org/show_bug.cgi?id=205018

Reviewed by Tim Horton.

Source/WebCore:

Finishes encoding and decoding support for the `SetState` display list item. See below for more details.

* platform/graphics/Gradient.h:
(WebCore::Gradient::ColorStop::encode const):
(WebCore::Gradient::ColorStop::decode):
(WebCore::Gradient::LinearData::encode const):
(WebCore::Gradient::LinearData::decode):
(WebCore::Gradient::RadialData::encode const):
(WebCore::Gradient::RadialData::decode):
(WebCore::Gradient::ConicData::encode const):
(WebCore::Gradient::ConicData::decode):
(WebCore::Gradient::encode const):
(WebCore::Gradient::decode):

Introduce encoding and decoding support for WebCore::Gradient, and all of its constituent data members.

* platform/graphics/GraphicsContext.h:

Remove ShadowColorChange, which was unused; instead, shadow color changes are indicated by the ShadowChange
flag, which also encompasses shadow offset and blur.

* platform/graphics/Image.h:

Move DisplayList::ImageHandle to ImageHandle in Image.h, so that it can be referenced in the encode/decode
methods of WebCore::Pattern.

* platform/graphics/Pattern.h:
(WebCore::Pattern::encode const):
(WebCore::Pattern::decode):

Introduce encoding and decoding support for WebCore::Pattern.

* platform/graphics/displaylists/DisplayListItems.cpp:
(WebCore::DisplayList::FillRectWithGradient::FillRectWithGradient):

Implement encode and decode for FillRectWithGradient, now that we're able to encode and decode Gradients.

* platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::SetState::encode const):
(WebCore::DisplayList::SetState::decode):

Encode the remaining data members of a GraphicsContextStateChange's state. These are: strokeGradient,
strokePattern, fillGradient, fillPattern, shadowOffset, shadowBlur, shadowColor (which was not previously being
encoded due to ShadowColorChange never being set), strokeThickness, textDrawingMode, strokeStyle, fillRule,
compositeOperator, blendMode, imageInterpolationQuality, shouldAntialias, shouldSmoothFonts,
shouldSubpixelQuantizeFonts and shadowsIgnoreTransforms.

(WebCore::DisplayList::FillRectWithGradient::encode const):
(WebCore::DisplayList::FillRectWithGradient::decode):
(WebCore::DisplayList::Item::encode const):
(WebCore::DisplayList::Item::decode):
(WebCore::DisplayList::FillRectWithGradient::FillRectWithGradient): Deleted.

Source/WebKit:

Replaces WebCore::DisplayList::ImageHandle with just WebCore::ImageHandle. See WebCore ChangeLog for more
details.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<ImageHandle>::encode):
(IPC::ArgumentCoder<ImageHandle>::decode):
(IPC::ArgumentCoder<DisplayList::ImageHandle>::encode): Deleted.
(IPC::ArgumentCoder<DisplayList::ImageHandle>::decode): Deleted.
* Shared/WebCoreArgumentCoders.h:

LayoutTests:

Rebaseline several display list layout tests.

* displaylists/layer-dispay-list-expected.txt:
* platform/mac-wk1/displaylists/extent-includes-shadow-expected.txt:
* platform/mac-wk1/displaylists/extent-includes-transforms-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@253302 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
LayoutTests/ChangeLog
LayoutTests/displaylists/layer-dispay-list-expected.txt
LayoutTests/platform/mac-wk1/displaylists/extent-includes-shadow-expected.txt
LayoutTests/platform/mac-wk1/displaylists/extent-includes-transforms-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/Gradient.h
Source/WebCore/platform/graphics/GraphicsContext.h
Source/WebCore/platform/graphics/Image.h
Source/WebCore/platform/graphics/Pattern.h
Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp
Source/WebCore/platform/graphics/displaylists/DisplayListItems.h
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebCoreArgumentCoders.cpp
Source/WebKit/Shared/WebCoreArgumentCoders.h