Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: afbd4f014569daae52e242ac90282b49ae9952b9 https://github.com/WebKit/WebKit/commit/afbd4f014569daae52e242ac90282b49ae9952b9 Author: Kimmo Kinnunen <kkinnu...@apple.com> Date: 2023-09-20 (Wed, 20 Sep 2023)
Changed paths: M Source/WebCore/platform/graphics/GraphicsContext.cpp M Source/WebCore/platform/graphics/RenderingMode.cpp M Source/WebCore/platform/graphics/RenderingMode.h M Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp M Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h Log Message: ----------- GraphicsContext::createImageBuffer should not create ImageBuffers that are backed by display lists https://bugs.webkit.org/show_bug.cgi?id=261406 rdar://115283169 Reviewed by Antti Koivisto. Remove the polymorphic feature where DisplayList::Recorder could create a DisplayList::ImageBuffer in response to GraphicsContext::createImageBuffer. The calling code which creates ImageBuffers is never agnostic to whether the created buffer is backed by a display list or not. If the calling code intends to use the drawing as a display list, it needs to access the list. This is done by calling DisplayList::Recorder::displayList() explicitly through Recorder, not through ImageBuffer interface. Even if the target GraphicsContext would be a DisplayList::Recorder, creating a new image buffer as a display list and drawing that to the target would end up resulting a bitmap drawn to the target. This means that there was no benefit, only harm, to creating the ImageBuffer as a display list. The intended feature was probably to obtain a master display list with the drawing commands that contain also cached sub areas as drawing commands. This was never realized with current code, as the semantics of the interfaces of ImageBuffer and a display list are different. Most notably items are composed differently: image buffer starts as cleared, but the above intention of the API was probably to support compositing subtrees in a nice way. The alternatives that work within the abstractions are the "begin transparency layer" for uncached subtrees and explicit DisplayList::Recorder for cached subtrees. Does not remove RenderingMethod enum because currently it affects the "local or remote" decision via holding it with std::optional. This will be addressed in the future. * Source/WebCore/platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::createImageBuffer const): * Source/WebCore/platform/graphics/RenderingMode.cpp: (WebCore::operator<<): * Source/WebCore/platform/graphics/RenderingMode.h: * Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::Recorder::createImageBuffer const): Deleted. * Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h: Canonical link: https://commits.webkit.org/268193@main _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes