[webkit-changes] [WebKit/WebKit] b5e340: [CoordinatedGraphics] Setting the same image conte...

Carlos Garcia Campos noreply at github.com
Fri Jan 31 01:07:40 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b5e34083e2c1437c1484eaaec2fb5a558ad557f2
      https://github.com/WebKit/WebKit/commit/b5e34083e2c1437c1484eaaec2fb5a558ad557f2
  Author: Carlos Garcia Campos <cgarcia at igalia.com>
  Date:   2025-01-31 (Fri, 31 Jan 2025)

  Changed paths:
    M Source/WebCore/platform/graphics/NativeImage.h
    M Source/WebCore/platform/graphics/cairo/NativeImageCairo.cpp
    M Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp
    M Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedImageBackingStore.cpp
    M Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedImageBackingStore.h
    M Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayer.cpp
    M Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayer.h
    M Source/WebCore/platform/graphics/texmap/coordinated/GraphicsLayerCoordinated.cpp
    M Source/WebCore/platform/graphics/texmap/coordinated/GraphicsLayerCoordinated.h
    M Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp

  Log Message:
  -----------
  [CoordinatedGraphics] Setting the same image contents on a layer might cause an unnecessary flush
https://bugs.webkit.org/show_bug.cgi?id=286740

Reviewed by Miguel Gomez.

It can happen that the same image is set for a layer causing an
unnecessary flush (if nothing else changed) because we reset the pending
image on the first flush after being set.
This patch also removes the optimization of removing the layer contents
when the image is not visible, since the image will be clipped out
anyway, and it can cause problems with CSS 3D animations if the image
is not visible at the beginning of the animation.

* Source/WebCore/platform/graphics/NativeImage.h:
* Source/WebCore/platform/graphics/cairo/NativeImageCairo.cpp:
(WebCore::NativeImage::uniqueID const):
* Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp:
(WebCore::NativeImage::uniqueID const):
* Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedImageBackingStore.cpp:
(WebCore::CoordinatedImageBackingStore::isSameNativeImage):
(WebCore::CoordinatedImageBackingStore::uniqueIDForNativeImage): Deleted.
* Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedImageBackingStore.h:
* Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayer.cpp:
(WebCore::CoordinatedPlatformLayer::invalidateTarget):
(WebCore::CoordinatedPlatformLayer::setContentsImage):
(WebCore::CoordinatedPlatformLayer::updateContents):
(WebCore::CoordinatedPlatformLayer::purgeBackingStores):
(WebCore::CoordinatedPlatformLayer::flushCompositingState):
* Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayer.h:
(WebCore::CoordinatedPlatformLayer::hasPendingTilesCreation const):
(WebCore::CoordinatedPlatformLayer::hasImageBackingStore const): Deleted.
* Source/WebCore/platform/graphics/texmap/coordinated/GraphicsLayerCoordinated.cpp:
(WebCore::GraphicsLayerCoordinated::setContentsToImage):
(WebCore::GraphicsLayerCoordinated::usesContentsLayer const):
(WebCore::GraphicsLayerCoordinated::commitLayerChanges):
* Source/WebCore/platform/graphics/texmap/coordinated/GraphicsLayerCoordinated.h:

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



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list