⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 283308 in webkit


Ignore:
Timestamp:
Sep 30, 2021, 5:47:13 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

GraphicsContextGLAttributes::hasFenceSync should be a property of GraphicsContextGLOpenGL
https://bugs.webkit.org/show_bug.cgi?id=230939

Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2021-09-30
Reviewed by Antti Koivisto.

Move hasFenceSync from GraphicsContextGLAttributes to GraphicsContextGLOpenGL.

No new tests, a refactor.

  • platform/graphics/GraphicsContextGLAttributes.h:
  • platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:

(WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):
(WebCore::GraphicsContextGLOpenGL::prepareForDisplay):

  • platform/graphics/opengl/GraphicsContextGLOpenGL.h:
Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r283307 r283308  
     12021-09-30  Kimmo Kinnunen  <kkinnunen@apple.com>
     2
     3        GraphicsContextGLAttributes::hasFenceSync should be a property of GraphicsContextGLOpenGL
     4        https://bugs.webkit.org/show_bug.cgi?id=230939
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Move hasFenceSync from GraphicsContextGLAttributes to GraphicsContextGLOpenGL.
     9
     10        No new tests, a refactor.
     11
     12        * platform/graphics/GraphicsContextGLAttributes.h:
     13        * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
     14        (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):
     15        (WebCore::GraphicsContextGLOpenGL::prepareForDisplay):
     16        * platform/graphics/opengl/GraphicsContextGLOpenGL.h:
     17
    1182021-09-30  Youenn Fablet  <youenn@apple.com>
    219
  • trunk/Source/WebCore/platform/graphics/GraphicsContextGLAttributes.h

    r281124 r283308  
    6565#if PLATFORM(COCOA)
    6666    bool useMetal { true };
    67     bool hasFenceSync { false };
    6867#endif
    6968#if ENABLE(WEBXR)
  • trunk/Source/WebCore/platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm

    r283301 r283308  
    357357    }
    358358    if (contextAttributes().useMetal) {
    359         // The implementation uses GLsync objects. Enable the functionality for WebGL 1.0 contexts
    360         // that use OpenGL ES 2.0.
     359        // GraphicsContextGLOpenGL uses sync objects to throttle display on Metal implementations.
     360        // OpenGL sync objects are not signaling upon completion on Catalina-era drivers, so
     361        // OpenGL cannot use this method of throttling. OpenGL drivers typically implement
     362        // some sort of internal throttling.
    361363        if (extensions.supports("GL_ARB_sync"_s)) {
    362             attrs.hasFenceSync = true;
     364            m_useFenceSyncForDisplayRateLimit = true;
    363365            extensions.ensureEnabled("GL_ARB_sync"_s);
    364             setContextAttributes(attrs);
    365366        }
    366367    }
     
    839840    markLayerComposited();
    840841
    841     if (contextAttributes().useMetal && contextAttributes().hasFenceSync) {
    842         // OpenGL sync objects are not signaling upon completion on Catalina-era drivers.
    843         // OpenGL drivers typically implement some sort of internal throttling.
     842    if (m_useFenceSyncForDisplayRateLimit) {
    844843        bool success = waitAndUpdateOldestFrame();
    845844        UNUSED_VARIABLE(success); // FIXME: implement context lost.
  • trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.h

    r283238 r283308  
    797797#endif
    798798#if USE(ANGLE)
     799    bool m_useFenceSyncForDisplayRateLimit = false;
    799800    static constexpr size_t maxPendingFrames = 3;
    800801    size_t m_oldestFrameCompletionFence { 0 };
Note: See TracChangeset for help on using the changeset viewer.