Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[GPU Process] Pattern should hold SourceImage which can be converted …
…to a NativeImage only when needed https://bugs.webkit.org/show_bug.cgi?id=232411 <rdar://problem/84998738> Reviewed by Darin Adler. Source/WebCore: Make Pattern hold a SourceImage and add getters to retrieve a NativeImage and an ImageBuffer. In these getters the SourceImage will either return the current image source or get one from the other if needed. * html/canvas/CanvasPattern.cpp: (WebCore::CanvasPattern::create): (WebCore::CanvasPattern::CanvasPattern): * html/canvas/CanvasPattern.h: * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::createPattern): * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::buildArrayForCanvasPattern): * platform/graphics/NativeImage.h: Make NativeImage a thread-safe RefCounted and make its destruction happen on the main thread. This is similar to what we do for ImageBuffer. And the reason for this is the message handler in the GPUProcess may create NativeImages on the main thread as the SourceImages for the Patterns of the SetState item. These NativeImages will be deleted in the replaying thread after applying the SetState item. * platform/graphics/Pattern.cpp: (WebCore::Pattern::create): (WebCore::Pattern::Pattern): * platform/graphics/Pattern.h: (WebCore::Pattern::encode const): (WebCore::Pattern::decode): Add encoding and decoding mehods for Pattern which will be called from SetState::encode() and SetState::decode(). * platform/graphics/SourceImage.cpp: (WebCore::SourceImage::nativeImage const): (WebCore::SourceImage::imageBuffer const): (WebCore::SourceImage::size const): (WebCore::SourceImage::nativeImage): Deleted. (WebCore::SourceImage::imageBuffer): Deleted. * platform/graphics/SourceImage.h: Make SourceImage keep the image source it was created with. Get a temporary image source if it is different from what is stored in m_imageVariant. * platform/graphics/cairo/PatternCairo.cpp: (WebCore::Pattern::createPlatformPattern const): * platform/graphics/cg/PatternCG.cpp: (WebCore::Pattern::createPlatformPattern const): * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::SetState::SetState): (WebCore::DisplayList::SetState::apply): * platform/graphics/displaylists/DisplayListItems.h: (WebCore::DisplayList::SetState::stateChange): (WebCore::DisplayList::SetState::encode const): (WebCore::DisplayList::SetState::decode): (WebCore::DisplayList::SetState::strokePatternParameters const): Deleted. (WebCore::DisplayList::SetState::fillPatternParameters const): Deleted. (WebCore::DisplayList::SetState::strokePatternImageIdentifier const): Deleted. (WebCore::DisplayList::SetState::fillPatternImageIdentifier const): Deleted. Simplify SetState by deleting the PatternData members. Replace these members by the strokePattern and fillPattern since these patterns can be encoded and decoded. * platform/graphics/displaylists/DisplayListReplayer.cpp: (WebCore::DisplayList::applySetStateItem): * platform/graphics/displaylists/DisplayListResourceHeap.h: Add the helper LocalResourceHeap::getSourceImage() to be used by applySetStateItem(). * platform/graphics/filters/software/FETileSoftwareApplier.cpp: (WebCore::FETileSoftwareApplier::apply const): * rendering/RenderLayerBacking.cpp: (WebCore::patternForDescription): * rendering/svg/RenderSVGResourcePattern.cpp: (WebCore::RenderSVGResourcePattern::buildPattern): Source/WebKit: Add the helpers QualifiedResourceHeap::getSourceImage() and RemoteResourceCache::cachedSourceImage() which will be used by RemoteDisplayListRecorder::setState() to replace the RenderingResourceIdentifier of the pattern's tileImage by an actual SourceImage. * GPUProcess/graphics/QualifiedResourceHeap.h: (WebKit::QualifiedResourceHeap::getSourceImage const): * GPUProcess/graphics/RemoteDisplayListRecorder.cpp: (WebKit::RemoteDisplayListRecorder::setState): (WebKit::RemoteDisplayListRecorder::drawFilteredImageBuffer): (WebKit::RemoteDisplayListRecorder::setStateWithQualifiedIdentifiers): Deleted. * GPUProcess/graphics/RemoteResourceCache.cpp: (WebKit::RemoteResourceCache::cachedSourceImage const): * GPUProcess/graphics/RemoteResourceCache.h: LayoutTests: Unskip layout tests for gpu process because they are fixed by this change. * gpu-process/TestExpectations: Canonical link: https://commits.webkit.org/246617@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288865 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
26 changed files
with
300 additions
and
201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.