Commit d564525
committed
Clean up some code in SharedDisplayListHandle
https://bugs.webkit.org/show_bug.cgi?id=219089
Reviewed by Geoff Garen.
Currently, `reservedCapacityAtStart` is defined as a constant 16 bytes, which is enough to encompass the
contents of the header structure in a shared display list handle (i.e. an 8-byte atomic for the lock, and
another 8 bytes for the unread count).
Instead of hard-coding this, we could simply make this a constexpr function that returns the size of
`DisplayListSharedMemoryHeader` (rounded up to ensure alignment of all display list item data).
No change in behavior.
* GPUProcess/graphics/RemoteRenderingBackend.cpp:
(WebKit::RemoteRenderingBackend::wakeUpAndApplyDisplayList):
(WebKit::RemoteRenderingBackend::didCreateSharedDisplayListHandle):
* Shared/SharedDisplayListHandle.h:
(WebKit::SharedDisplayListHandle::headerSize):
* WebProcess/GPU/graphics/DisplayListWriterHandle.cpp:
(WebKit::DisplayListWriterHandle::resetWritableOffsetIfPossible):
* WebProcess/GPU/graphics/DisplayListWriterHandle.h:
(WebKit::DisplayListWriterHandle::DisplayListWriterHandle):
* WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp:
(WebKit::RemoteRenderingBackendProxy::createItemBuffer):
Also add a static assert that the size of a newly allocated buffer is larger than the reserved header capacity.
Canonical link: https://commits.webkit.org/231718@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269969 268f45cc-cd09-0410-ab3c-d52691b4dbfc1 parent 986be9d commit d564525
6 files changed
Lines changed: 42 additions & 8 deletions
File tree
- Source/WebKit
- GPUProcess/graphics
- WebProcess/GPU/graphics
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
1 | 31 | | |
2 | 32 | | |
3 | 33 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
201 | | - | |
| 201 | + | |
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
246 | | - | |
| 246 | + | |
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | | - | |
| 71 | + | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| 242 | + | |
242 | 243 | | |
243 | | - | |
| 244 | + | |
244 | 245 | | |
245 | 246 | | |
246 | 247 | | |
| |||
0 commit comments