[webkit-changes] [WebKit/WebKit] 0c499e: [Skia] Cleanup / refactor AcceleratedBufferPool

Nikolas Zimmermann noreply at github.com
Mon Feb 19 12:21:24 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0c499e9e1049c4d57593a538d5f0ebfb3f74a687
      https://github.com/WebKit/WebKit/commit/0c499e9e1049c4d57593a538d5f0ebfb3f74a687
  Author: Nikolas Zimmermann <nzimmermann at igalia.com>
  Date:   2024-02-19 (Mon, 19 Feb 2024)

  Changed paths:
    M Source/WebCore/platform/Skia.cmake
    M Source/WebCore/platform/SourcesSkia.txt
    A Source/WebCore/platform/graphics/skia/SkiaAcceleratedBufferPool.cpp
    A Source/WebCore/platform/graphics/skia/SkiaAcceleratedBufferPool.h
    M Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h
    M Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayerSkia.cpp
    M Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp
    M Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h

  Log Message:
  -----------
  [Skia] Cleanup / refactor AcceleratedBufferPool
https://bugs.webkit.org/show_bug.cgi?id=269650

Reviewed by Carlos Garcia Campos.

Move AcceleratedBufferPool out of CoordinatedGraphicsLayerSkia.cpp into
Source/WebCore/platform/graphics/skia/SkiaAcceleratedBufferPool.* -
rename the class to SkiaAcceleratedBufferPool.

AcceleratedBufferPools destructor contains code to cleanup the GL
resources - this was never called as the class was managed as a
singleton. SkiaAcceleratedBufferPool is instead owned by
CopositingCoordinator. It allocates the pool if GPU rendering is used
and properly destructs it in the invalidate() method, which is called
during LayerTreeHost destruction. This ensures that we don't leave
around unclaimed resources.

* Source/WebCore/platform/Skia.cmake:
* Source/WebCore/platform/SourcesSkia.txt:
* Source/WebCore/platform/graphics/skia/SkiaAcceleratedBufferPool.cpp: Added.
(WebCore::SkiaAcceleratedBufferPool::SkiaAcceleratedBufferPool):
(WebCore::SkiaAcceleratedBufferPool::~SkiaAcceleratedBufferPool):
(WebCore::SkiaAcceleratedBufferPool::acquireBuffer):
(WebCore::SkiaAcceleratedBufferPool::createAcceleratedBuffer):
(WebCore::SkiaAcceleratedBufferPool::scheduleReleaseUnusedBuffers):
(WebCore::SkiaAcceleratedBufferPool::releaseUnusedBuffersTimerFired):
* Source/WebCore/platform/graphics/skia/SkiaAcceleratedBufferPool.h: Added.
(WebCore::SkiaAcceleratedBufferPool::Entry::Entry):
(WebCore::SkiaAcceleratedBufferPool::Entry::markIsInUse):
(WebCore::SkiaAcceleratedBufferPool::Entry::canBeReleased const):
* Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
* Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayerSkia.cpp:
(WebCore::CoordinatedGraphicsLayer::paintTile):
(WebCore::AcceleratedBufferPool::singleton): Deleted.
(WebCore::AcceleratedBufferPool::AcceleratedBufferPool): Deleted.
(WebCore::AcceleratedBufferPool::~AcceleratedBufferPool): Deleted.
(WebCore::AcceleratedBufferPool::acquireBuffer): Deleted.
(WebCore::AcceleratedBufferPool::Entry::Entry): Deleted.
(WebCore::AcceleratedBufferPool::Entry::markIsInUse): Deleted.
(WebCore::AcceleratedBufferPool::Entry::canBeReleased const): Deleted.
(WebCore::AcceleratedBufferPool::createAcceleratedBuffer): Deleted.
(WebCore::AcceleratedBufferPool::scheduleReleaseUnusedBuffers): Deleted.
(WebCore::AcceleratedBufferPool::releaseUnusedBuffersTimerFired): Deleted.
* Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
(WebKit::skiaForceUseCpuRendering):
(WebKit::CompositingCoordinator::CompositingCoordinator):
(WebKit::CompositingCoordinator::invalidate):
* Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:

Canonical link: https://commits.webkit.org/274990@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