Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GPU Process] To encode a CGImage, copy its pixels to a SharedMemory
https://bugs.webkit.org/show_bug.cgi?id=254794 rdar://106794138 Reviewed by Simon Fraser. Use CGImageGetDataProvider() to get the CGImage bytes. Copy these bytes to the SharedMemory. Encode some of the CGImage properties so the decoded CGImage matches the encoded one. These properties are BytesPerPixel, BytesPerRow and BitmapInfo Make sure WebProcess can create a PlatformImage out of the ShareableBitmap before sending the pixels to GPUProcess. Otherwise fall back to the old code path and draw the image to a BitmapContext backed by the SharedMemory. * Source/WebKit/Platform/Logging.h: * Source/WebKit/Shared/ShareableBitmap.cpp: (WebKit::ShareableBitmap::create): (WebKit::ShareableBitmap::createFromImageDraw): * Source/WebKit/Shared/ShareableBitmap.h: * Source/WebKit/Shared/cg/ShareableBitmapCG.cpp: (WebKit::ShareableBitmapConfiguration::ShareableBitmapConfiguration): (WebKit::ShareableBitmap::createFromImagePixels): * Source/WebKit/WebProcess/GPU/graphics/RemoteResourceCacheProxy.cpp: (WebKit::createShareableBitmapFromNativeImage): (WebKit::RemoteResourceCacheProxy::recordNativeImageUse): Canonical link: https://commits.webkit.org/262607@main
- Loading branch information
Showing
5 changed files
with
106 additions
and
34 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