Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 65713772d8209dc7799659f689e84a216859c8dc
https://github.com/WebKit/WebKit/commit/65713772d8209dc7799659f689e84a216859c8dc
Author: Kimmo Kinnunen <[email protected]>
Date: 2026-08-26 (Wed, 26 Aug 2026)
Changed paths:
M Source/WebCore/platform/graphics/GraphicsContextState.cpp
M Source/WebCore/platform/graphics/GraphicsContextState.h
M Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp
M Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h
M Source/WebCore/platform/graphics/displaylists/DisplayListRecorderImpl.cpp
M Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextProxy.cpp
Log Message:
-----------
DisplayList::Recorder has a copy of remote GraphicsContext state per level
https://bugs.webkit.org/show_bug.cgi?id=322168
rdar://185398807
Reviewed by Matt Woodrow.
DisplayList::Recorder would maintain the full GraphicsContext state
in its save state stack. This used for two reasons:
1. When GraphicsContext state changes, the recorder does not immediately
record the state change items. The record happens only when
an item is recorded that does actual work (draw, save, restore).
2. Upon restore, the level was popped from the stack and the new
top of the stack state entry would describe the state the remote was
in.
Fullfill the 1. with maintaining one "state currently committed to
recording" flag. So any GraphicsContext state changes on top of that
needs to be sent when encountering item for actual work.
The 2. is unneeded, as after restore(), the recorded and local
GraphicsContext state must match.
Related to 2.:
Record only "changes done in current state stack entry", in order to
speed up the state assign after restore(). Look at the changes
to know which properties were modified, so then copy those properties
back instead of the whole state object.
* Source/WebCore/platform/graphics/GraphicsContextState.cpp:
(WebCore::GraphicsContextState::copyPropertiesFrom):
(WebCore::GraphicsContextState::propertiesEqual const):
(WebCore::GraphicsContextState::copyLastChangesFrom): Deleted.
* Source/WebCore/platform/graphics/GraphicsContextState.h:
* Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::Recorder):
(WebCore::DisplayList::Recorder::updateStateForSave):
(WebCore::DisplayList::Recorder::updateStateForRestore):
(WebCore::DisplayList::Recorder::computeStateChanges):
(WebCore::DisplayList::Recorder::commitStateChanges):
(WebCore::DisplayList::Recorder::updateStateForBeginTransparencyLayer):
(WebCore::DisplayList::Recorder::pushStateForTransparencyLayer):
(WebCore::DisplayList::Recorder::updateStateForEndTransparencyLayer):
* Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h:
(WebCore::DisplayList::Recorder::ContextState::cloneForTransparencyLayer
const): Deleted.
* Source/WebCore/platform/graphics/displaylists/DisplayListRecorderImpl.cpp:
(WebCore::DisplayList::RecorderImpl::appendStateChangeItemIfNecessary):
* Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextProxy.cpp:
(WebKit::RemoteGraphicsContextProxy::appendStateChangeItemIfNecessary):
(WebKit::RemoteGraphicsContextProxy::inlineStrokeStateIfBatchable):
Canonical link: https://commits.webkit.org/319874@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications