-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GraphicsContext::drawNativeImage has redundant imageSize parameter
https://bugs.webkit.org/show_bug.cgi?id=266279 rdar://119551804 Reviewed by Matt Woodrow. NativeImage knows its size. The GraphicsContext::drawNativeImage has FloatRect sourceRect parameter to define the portion of the full size to use. The IntRect imageSize is probably a legacy argument used for partial images before sourceRect was introduced. All callsites but one use the full NativeImage size as the imageSize. The only non-full image draw in BitmapImage uses the same rect as the source rect. The function can be further simplified, but to make this patch easier to review make minimal compatible changes to GraphicsContextCG::drawNativeImageInternal. Reland: Harden against callers that call with sourceRect bigger than the actual source is. The previously used sourceRect.intersect(imageRect) was incorrect, as that would not adjust the respective destinationRect. * Source/WebCore/Modules/WebGPU/Implementation/WebGPUImpl.cpp: (WebCore::WebGPU::GPUImpl::paintToCanvas): * Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::drawImage): * Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::videoFrameToImage): * Source/WebCore/platform/graphics/BifurcatedGraphicsContext.cpp: (WebCore::BifurcatedGraphicsContext::drawNativeImageInternal): * Source/WebCore/platform/graphics/BifurcatedGraphicsContext.h: * Source/WebCore/platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::preTransformedNativeImageForCurrentFrame): (WebCore::drawNativeImage): * Source/WebCore/platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::drawNativeImage): (WebCore::GraphicsContext::drawImageBuffer): (WebCore::GraphicsContext::drawConsumingImageBuffer): * Source/WebCore/platform/graphics/GraphicsContext.h: (WebCore::GraphicsContext::drawNativeImage): (WebCore::GraphicsContext::drawNativeImageInternal): * Source/WebCore/platform/graphics/GraphicsContextGL.cpp: (WebCore::GraphicsContextGL::paintToCanvas): * Source/WebCore/platform/graphics/NativeImage.h: * Source/WebCore/platform/graphics/NullGraphicsContext.h: * Source/WebCore/platform/graphics/SourceImage.cpp: (WebCore::SourceImage::imageBuffer const): * Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput): * Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paintCurrentFrameInContext): * Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext): * Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContextCairo::drawNativeImageInternal): * Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.h: * Source/WebCore/platform/graphics/cairo/NativeImageCairo.cpp: (WebCore::NativeImage::draw): * Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp: (WebCore::GraphicsContextCG::drawNativeImageInternal): * Source/WebCore/platform/graphics/cg/GraphicsContextCG.h: * Source/WebCore/platform/graphics/cg/NativeImageCG.cpp: (WebCore::NativeImage::draw): * Source/WebCore/platform/graphics/cocoa/IconCocoa.mm: (WebCore::Icon::paint): * Source/WebCore/platform/graphics/cocoa/MediaPlayerPrivateWebM.mm: (WebCore::MediaPlayerPrivateWebM::paintCurrentFrameInContext): * Source/WebCore/platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp: (WebCore::DrawGlyphsRecorder::recordDrawImage): * Source/WebCore/platform/graphics/cv/VideoFrameCV.mm: (WebCore::VideoFrame::paintInContext): * Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::DrawNativeImage::apply const): * Source/WebCore/platform/graphics/displaylists/DisplayListItems.h: (WebCore::DisplayList::DrawNativeImage::DrawNativeImage): (WebCore::DisplayList::DrawNativeImage::imageIdentifier const): (WebCore::DisplayList::DrawNativeImage::imageSize const): Deleted. * Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::Recorder::drawNativeImageInternal): * Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h: * Source/WebCore/platform/graphics/displaylists/DisplayListRecorderImpl.cpp: (WebCore::DisplayList::RecorderImpl::recordDrawNativeImage): * Source/WebCore/platform/graphics/displaylists/DisplayListRecorderImpl.h: * Source/WebCore/platform/graphics/filters/software/FEImageSoftwareApplier.cpp: (WebCore::FEImageSoftwareApplier::apply const): * Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp: (Nicosia::CairoOperationRecorder::drawNativeImageInternal): * Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h: * Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp: (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame): * Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.cpp: (WebKit::RemoteDisplayListRecorder::drawNativeImage): * Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.h: * Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.messages.in: * Source/WebKit/GPUProcess/graphics/RemoteImageBuffer.cpp: (WebKit::RemoteImageBuffer::filteredNativeImage): * Source/WebKit/GPUProcess/media/RemoteImageDecoderAVFProxy.cpp: (WebKit::RemoteImageDecoderAVFProxy::createFrameImageAtIndex): * Source/WebKit/GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp: (WebKit::RemoteMediaPlayerManagerProxy::bitmapImageForCurrentTime): * Source/WebKit/Shared/API/c/cg/WKImageCG.cpp: (WKImageCreateFromCGImage): * Source/WebKit/Shared/DisplayListArgumentCoders.serialization.in: * Source/WebKit/Shared/ShareableBitmap.cpp: (WebKit::ShareableBitmap::createFromImageDraw): * Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.cpp: (WebKit::RemoteDisplayListRecorderProxy::recordDrawNativeImage): * Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.h: * Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::paintCurrentFrameInContext): * Source/WebKit/WebProcess/WebCoreSupport/ShareableBitmapUtilities.cpp: (WebKit::createShareableBitmap): * Source/WebKit/WebProcess/cocoa/TextTrackRepresentationCocoa.mm: (WebKit::WebTextTrackRepresentationCocoa::update): * Tools/TestWebKitAPI/Tests/WebCore/ImageBufferTests.cpp: (TestWebKitAPI::TEST_P): * Tools/TestWebKitAPI/Tests/WebCore/cg/GraphicsContextCGTests.mm: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/272333@main
- Loading branch information
1 parent
34d1661
commit f0cddec
Showing
51 changed files
with
76 additions
and
97 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
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
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.