[webkit-changes] [WebKit/WebKit] 3ed63d: [TextureMapper] Missing implementation of backingS...

Przemyslaw Gorszkowski noreply at github.com
Mon Jul 31 06:42:32 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3ed63da0ea8dcf64cb82bd1a61e79c38a2aeaae0
      https://github.com/WebKit/WebKit/commit/3ed63da0ea8dcf64cb82bd1a61e79c38a2aeaae0
  Author: Przemyslaw Gorszkowski <pgorszkowski at igalia.com>
  Date:   2023-07-31 (Mon, 31 Jul 2023)

  Changed paths:
    M Source/WebCore/page/linux/ResourceUsageThreadLinux.cpp
    M Source/WebCore/platform/graphics/nicosia/NicosiaBuffer.cpp
    M Source/WebCore/platform/graphics/nicosia/NicosiaBuffer.h
    M Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
    M Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h

  Log Message:
  -----------
  [TextureMapper] Missing implementation of backingStoreMemoryEstimate
https://bugs.webkit.org/show_bug.cgi?id=254910

Reviewed by Miguel Gomez.

The backingStores used by the CoordinatedGraphicsLayers are created during a layerFlush,
and they are freed in the next compositor cycle, after their content is uploaded into
a texture. Due to this, the life span of the Nicosia::Buffers is very short. As the
ResourceUsageThread samples the used memory every 500ms, it would be quite common that
the memory usage reported by the timeline would be zero. In order to avoid this,
the maximum memory usage is stored until the ResourceUsageThread is able to read it.
Thanks to this, the timeline is able to show the peak in the memory usage that reflects
the reality. It's not perfect though, as the peak will be shown in the timeline some ms
after it really happened, but it's the best approach we can do.

* Source/WebCore/page/linux/ResourceUsageThreadLinux.cpp:
(WebCore::ResourceUsageThread::platformSaveStateBeforeStarting):
(WebCore::ResourceUsageThread::platformCollectMemoryData):
* Source/WebCore/platform/graphics/nicosia/NicosiaBuffer.cpp:
(Nicosia::Buffer::resetMemoryUsage):
(Nicosia::Buffer::getMemoryUsage):
(Nicosia::Buffer::Buffer):
(Nicosia::Buffer::~Buffer):
* Source/WebCore/platform/graphics/nicosia/NicosiaBuffer.h:
* Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::backingStoreMemoryEstimate const):
* Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:

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




More information about the webkit-changes mailing list