Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TextureMapper] Missing implementation of backingStoreMemoryEstimate #14286

Commits on Jul 31, 2023

  1. [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
    pgorszkowski-igalia authored and magomez committed Jul 31, 2023
    Configuration menu
    Copy the full SHA
    3ed63da View commit details
    Browse the repository at this point in the history