[webkit-changes] [WebKit/WebKit] c50a18: [GPU Process] To encode a CGImage, copy its pixels...

Said Abou-Hallawa noreply at github.com
Tue Apr 4 20:12:55 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c50a18ba16263493f64ba1ce8c88d759ac769636
      https://github.com/WebKit/WebKit/commit/c50a18ba16263493f64ba1ce8c88d759ac769636
  Author: Said Abou-Hallawa <said at apple.com>
  Date:   2023-04-04 (Tue, 04 Apr 2023)

  Changed paths:
    M Source/WebKit/Platform/Logging.h
    M Source/WebKit/Shared/ShareableBitmap.cpp
    M Source/WebKit/Shared/ShareableBitmap.h
    M Source/WebKit/Shared/cg/ShareableBitmapCG.cpp
    M Source/WebKit/WebProcess/GPU/graphics/RemoteResourceCacheProxy.cpp

  Log Message:
  -----------
  [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




More information about the webkit-changes mailing list