Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 46f3b534eca4e044d22613ced4ef05f0c4c45f0c
      
https://github.com/WebKit/WebKit/commit/46f3b534eca4e044d22613ced4ef05f0c4c45f0c
  Author: Nikolas Zimmermann <[email protected]>
  Date:   2026-03-05 (Thu, 05 Mar 2026)

  Changed paths:
    M Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
    M Source/WebCore/platform/graphics/skia/SkiaGPUAtlas.cpp
    M Source/WebCore/platform/graphics/skia/SkiaGPUAtlas.h
    M Source/WebCore/platform/graphics/skia/SkiaImageAtlasLayout.h
    M Source/WebCore/platform/graphics/skia/SkiaImageAtlasLayoutBuilder.cpp
    M Source/WebCore/platform/graphics/skia/SkiaImageAtlasLayoutBuilder.h
    M Source/WebCore/platform/graphics/skia/SkiaPaintingEngine.cpp
    M Source/WebCore/platform/graphics/skia/SkiaPaintingEngine.h
    M Source/WebCore/platform/graphics/skia/SkiaRecordingResult.cpp
    M Source/WebCore/platform/graphics/skia/SkiaRecordingResult.h

  Log Message:
  -----------
  [GTK][WPE] Add single-entry GPU atlas cache to SkiaPaintingEngine
https://bugs.webkit.org/show_bug.cgi?id=309005

Reviewed by Carlos Garcia Campos.

Relanding 308627@main after addressing the performance regression.

When the image set is unchanged between frames, reuse the GPU atlas from
the previous frame instead of allocating new textures, uploading pixels
and re-creating the atlas.

A WTF::Hasher-based fingerprint of the raster image pointer set is
computed incrementally in SkiaImageAtlasLayoutBuilder::collectRasterImage()
as images are collected during recording. The fingerprint is compared at
cache-lookup time for O(1) validation. Atlas refs are only stored in the
cache after seeing the same fingerprint twice in a row, so workloads
where the image set changes every frame (e.g. MotionMark/Images) never
cache any GPU atlases.

The SkiaGPUAtlas layout member is changed from a bare reference to
Ref<const SkiaImageAtlasLayout> so cached atlases can safely outlive
the SkiaRecordingResult that created them.

Covered by existing tests.

* Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp:
(WebCore::GraphicsContextSkia::endRecording):
* Source/WebCore/platform/graphics/skia/SkiaGPUAtlas.cpp:
(WebCore::SkiaGPUAtlas::uploadImages):
* Source/WebCore/platform/graphics/skia/SkiaGPUAtlas.h:
* Source/WebCore/platform/graphics/skia/SkiaImageAtlasLayout.h:
* Source/WebCore/platform/graphics/skia/SkiaImageAtlasLayoutBuilder.cpp:
(WebCore::SkiaImageAtlasLayoutBuilder::collectRasterImage):
* Source/WebCore/platform/graphics/skia/SkiaImageAtlasLayoutBuilder.h:
(WebCore::SkiaImageAtlasLayoutBuilder::imageSetFingerprint const):
* Source/WebCore/platform/graphics/skia/SkiaPaintingEngine.cpp:
(WebCore::SkiaPaintingEngine::tryReuseCachedAtlases):
(WebCore::SkiaPaintingEngine::record):
* Source/WebCore/platform/graphics/skia/SkiaPaintingEngine.h:
* Source/WebCore/platform/graphics/skia/SkiaRecordingResult.cpp:
(WebCore::SkiaRecordingResult::SkiaRecordingResult):
* Source/WebCore/platform/graphics/skia/SkiaRecordingResult.h:

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



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

Reply via email to