WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED WONTFIX
220937
[GPU Process] Move encoding and decoding Gradient and Pattern to WebKit
https://bugs.webkit.org/show_bug.cgi?id=220937
Summary
[GPU Process] Move encoding and decoding Gradient and Pattern to WebKit
Said Abou-Hallawa
Reported
2021-01-25 11:17:01 PST
This will simplify the header files Gradient.h and Pattern.h. This will also make encoding and decoding these objects consistent with NativeImage and Font.
Attachments
Patch
(31.21 KB, patch)
2021-01-25 11:23 PST
,
Said Abou-Hallawa
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Said Abou-Hallawa
Comment 1
2021-01-25 11:23:37 PST
Created
attachment 418314
[details]
Patch
Tim Horton
Comment 2
2021-01-25 11:31:42 PST
This seems like a step in the wrong direction, no? For other GPUProcess things (DisplayListItems etc.) and other modern types we've been keeping the encoders adjacent to the types they encode.
Said Abou-Hallawa
Comment 3
2021-01-25 11:44:30 PST
The plan is to send Gradient and Pattern from WebProcess to GPUProcess as IPC::GradientReference and IPC::PatternReference via sendMessage(). I am not sure how this can be implemented if we keep the encoding and decoding as methods of Gradient and Pattern.
Sam Weinig
Comment 4
2021-01-25 12:49:40 PST
(In reply to Said Abou-Hallawa from
comment #3
)
> The plan is to send Gradient and Pattern from WebProcess to GPUProcess as > IPC::GradientReference and IPC::PatternReference via sendMessage(). > > I am not sure how this can be implemented if we keep the encoding and > decoding as methods of Gradient and Pattern.
What are GradientReferences and PatternReferences and how do they work?
Said Abou-Hallawa
Comment 5
2021-01-25 12:55:49 PST
(In reply to Sam Weinig from
comment #4
)
> (In reply to Said Abou-Hallawa from
comment #3
) > > The plan is to send Gradient and Pattern from WebProcess to GPUProcess as > > IPC::GradientReference and IPC::PatternReference via sendMessage(). > > > > I am not sure how this can be implemented if we keep the encoding and > > decoding as methods of Gradient and Pattern. > > What are GradientReferences and PatternReferences and how do they work?
Because of limitation/bugs in messages.py we can't process templates in the messages.in files. For example to send an IPC messages with Ref<Font> as an argument we have to make this definition in FontReference.h: using FontReference = Ref<WebCore::Font>; Then we can use it in RemoteRenderingBackend.messages.in: CacheFont(IPC::FontReference font) GradientReferences and PatternReferences will be the same as FontReference.
Sam Weinig
Comment 6
2021-01-26 14:21:58 PST
(In reply to Said Abou-Hallawa from
comment #5
)
> (In reply to Sam Weinig from
comment #4
) > > (In reply to Said Abou-Hallawa from
comment #3
) > > > The plan is to send Gradient and Pattern from WebProcess to GPUProcess as > > > IPC::GradientReference and IPC::PatternReference via sendMessage(). > > > > > > I am not sure how this can be implemented if we keep the encoding and > > > decoding as methods of Gradient and Pattern. > > > > What are GradientReferences and PatternReferences and how do they work? > > Because of limitation/bugs in messages.py we can't process templates in the > messages.in files. For example to send an IPC messages with Ref<Font> as an > argument we have to make this definition in FontReference.h: > > using FontReference = Ref<WebCore::Font>; > > Then we can use it in RemoteRenderingBackend.messages.in: > > CacheFont(IPC::FontReference font) > > GradientReferences and PatternReferences will be the same as FontReference.
Sorry, I wasn't clear in my question. What it does mean to have a GradientReference? Will you be uniquing gradients, sending over the data once, and then sending an identifier? Since this code you are referring to does not exist yet, you need to be clear about what exactly you are describing.
Said Abou-Hallawa
Comment 7
2021-01-29 08:57:44 PST
(In reply to Sam Weinig from
comment #6
)
> (In reply to Said Abou-Hallawa from
comment #5
) > > (In reply to Sam Weinig from
comment #4
) > > > (In reply to Said Abou-Hallawa from
comment #3
) > > > > The plan is to send Gradient and Pattern from WebProcess to GPUProcess as > > > > IPC::GradientReference and IPC::PatternReference via sendMessage(). > > > > > > > > I am not sure how this can be implemented if we keep the encoding and > > > > decoding as methods of Gradient and Pattern. > > > > > > What are GradientReferences and PatternReferences and how do they work? > > > > Because of limitation/bugs in messages.py we can't process templates in the > > messages.in files. For example to send an IPC messages with Ref<Font> as an > > argument we have to make this definition in FontReference.h: > > > > using FontReference = Ref<WebCore::Font>; > > > > Then we can use it in RemoteRenderingBackend.messages.in: > > > > CacheFont(IPC::FontReference font) > > > > GradientReferences and PatternReferences will be the same as FontReference. > > Sorry, I wasn't clear in my question. What it does mean to have a > GradientReference? Will you be uniquing gradients, sending over the data > once, and then sending an identifier? Since this code you are referring to > does not exist yet, you need to be clear about what exactly you are > describing.
Yes your expectation is correct: "uniquing gradients, sending over the data once, and then sending an identifier". Ideally we do not want to create gradients or patterns in WebP but because DOM rendering can still happen in WebP, we have to have two copies of the gradient: one is in WebP and the second is in GPUP. For the GPUP gradient and patterns, SetState::encode() and SetState::decode() will deal with the identifiers only. Replayer::applyItem() will resolve the identifiers to the actual cached objects. Please see the implementation of these functions in
https://bugs.webkit.org/attachment.cgi?id=416597&action=review
.
Sam Weinig
Comment 8
2021-01-29 11:09:11 PST
(In reply to Said Abou-Hallawa from
comment #7
)
> (In reply to Sam Weinig from
comment #6
) > > (In reply to Said Abou-Hallawa from
comment #5
) > > > (In reply to Sam Weinig from
comment #4
) > > > > (In reply to Said Abou-Hallawa from
comment #3
) > > > > > The plan is to send Gradient and Pattern from WebProcess to GPUProcess as > > > > > IPC::GradientReference and IPC::PatternReference via sendMessage(). > > > > > > > > > > I am not sure how this can be implemented if we keep the encoding and > > > > > decoding as methods of Gradient and Pattern. > > > > > > > > What are GradientReferences and PatternReferences and how do they work? > > > > > > Because of limitation/bugs in messages.py we can't process templates in the > > > messages.in files. For example to send an IPC messages with Ref<Font> as an > > > argument we have to make this definition in FontReference.h: > > > > > > using FontReference = Ref<WebCore::Font>; > > > > > > Then we can use it in RemoteRenderingBackend.messages.in: > > > > > > CacheFont(IPC::FontReference font) > > > > > > GradientReferences and PatternReferences will be the same as FontReference. > > > > Sorry, I wasn't clear in my question. What it does mean to have a > > GradientReference? Will you be uniquing gradients, sending over the data > > once, and then sending an identifier? Since this code you are referring to > > does not exist yet, you need to be clear about what exactly you are > > describing. > > Yes your expectation is correct: "uniquing gradients, sending over the data > once, and then sending an identifier".
Ok, in that case, I think keeping the default encoding/decoding in WebCore would be the best way to go. Then, where ever does the uniquing (be it in WebCore or WebKit) can use that encoder for the initial encode / decode.
Radar WebKit Bug Importer
Comment 9
2021-02-01 11:17:13 PST
<
rdar://problem/73837500
>
Said Abou-Hallawa
Comment 10
2021-02-03 15:42:59 PST
(In reply to Sam Weinig from
comment #8
)
> (In reply to Said Abou-Hallawa from
comment #7
) > > (In reply to Sam Weinig from
comment #6
) > > > (In reply to Said Abou-Hallawa from
comment #5
) > > > > (In reply to Sam Weinig from
comment #4
) > > > > > (In reply to Said Abou-Hallawa from
comment #3
) > > > > > > The plan is to send Gradient and Pattern from WebProcess to GPUProcess as > > > > > > IPC::GradientReference and IPC::PatternReference via sendMessage(). > > > > > > > > > > > > I am not sure how this can be implemented if we keep the encoding and > > > > > > decoding as methods of Gradient and Pattern. > > > > > > > > > > What are GradientReferences and PatternReferences and how do they work? > > > > > > > > Because of limitation/bugs in messages.py we can't process templates in the > > > > messages.in files. For example to send an IPC messages with Ref<Font> as an > > > > argument we have to make this definition in FontReference.h: > > > > > > > > using FontReference = Ref<WebCore::Font>; > > > > > > > > Then we can use it in RemoteRenderingBackend.messages.in: > > > > > > > > CacheFont(IPC::FontReference font) > > > > > > > > GradientReferences and PatternReferences will be the same as FontReference. > > > > > > Sorry, I wasn't clear in my question. What it does mean to have a > > > GradientReference? Will you be uniquing gradients, sending over the data > > > once, and then sending an identifier? Since this code you are referring to > > > does not exist yet, you need to be clear about what exactly you are > > > describing. > > > > Yes your expectation is correct: "uniquing gradients, sending over the data > > once, and then sending an identifier". > > Ok, in that case, I think keeping the default encoding/decoding in WebCore > would be the best way to go. > > Then, where ever does the uniquing (be it in WebCore or WebKit) can use that > encoder for the initial encode / decode.
This is the code of encoding the pattern in WebCore: void Pattern::encode(Encoder& encoder) const { ImageHandle imageHandle; imageHandle.image = m_tileImage.ptr(); encoder << imageHandle; encoder << m_patternSpaceTransformation; encoder << m_repeatX; encoder << m_repeatY; } But the image is encoded by ArgumentCoder<ImageHandle>::encode() which is in WebKit.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug