[webkit-changes] [WebKit/WebKit] c26d9a: RemoteLayerBackingStore copies unnecessary pixels ...

mattwoodrow noreply at github.com
Thu May 11 18:12:04 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c26d9ad7d08d34a9c2d515fbe6781ae94bf3565f
      https://github.com/WebKit/WebKit/commit/c26d9ad7d08d34a9c2d515fbe6781ae94bf3565f
  Author: Matt Woodrow <mattwoodrow at apple.com>
  Date:   2023-05-11 (Thu, 11 May 2023)

  Changed paths:
    M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.h
    M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm

  Log Message:
  -----------
  RemoteLayerBackingStore copies unnecessary pixels from back buffer to front buffer.
https://bugs.webkit.org/show_bug.cgi?id=256621
<rdar://109179068>

Reviewed by Simon Fraser.

If the new front buffer is the old back buffer, then we only need to copy the area of pixels that we painted
last time in order to make it match the new back buffer. Take area, subtract the pixels we're going to overwrite
for this update, and only copy that area.
Uses IntRects as a pessimistic superset of the required area, rather than Regions, to ensure we don't spend extra time
clipping (which could potentially take longer than the saved time from smaller copies).

Also detects when we have a newly allocated buffer, which are cleared during allocation, and avoids clearing them a
second time.

* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::applySwappedBuffers):
(WebKit::RemoteLayerBackingStore::ensureFrontBuffer):
(WebKit::RemoteLayerBackingStore::drawInContext):

Canonical link: https://commits.webkit.org/263994@main




More information about the webkit-changes mailing list