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

Changeset 203498 in webkit


Ignore:
Timestamp:
Jul 21, 2016, 12:29:39 AM (10 years ago)
Author:
commit-queue@webkit.org
Message:

[Threaded Compositor] Flickering when zooming in/out in maps.google.com
​https://bugs.webkit.org/show_bug.cgi?id=154069

Patch by Miguel Gomez <​magomez@igalia.com> on 2016-07-21
Reviewed by Carlos Garcia Campos.

Add a new extra buffer to GraphicsContext3D when using the Threaded Compositor,
so it doesn't have to reuse the buffers that are still waiting for composition.

Covered by existing tests.

  • platform/graphics/GraphicsContext3D.h:

Add a new texture to use for the rendering. Remove the compositor fbo we were using.

  • platform/graphics/cairo/GraphicsContext3DCairo.cpp:

(WebCore::GraphicsContext3D::GraphicsContext3D):
Initialize the new texture and remove the previous fbo related code.
(WebCore::GraphicsContext3D::~GraphicsContext3D):
Properly destroy the new texture and remove the previous fbo related code.

  • platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:

(WebCore::GraphicsContext3D::reshapeFBOs):
Allocate the new texture and remove the previous fbo allocation.

  • platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:

(WebCore::GraphicsContext3D::prepareTexture):
Use a single fbo with three textures instead of two fbos with a texture each.
Rotate the three textures usage so:

  • m_texture becomes m_compositorTexture to be pushed to the compositor.
  • m_intermediateTexture becomes m_texture to receive the next rendering.
  • m_compositorTexture becomes m_intermediateTexture.

And add a glFlush() to ensure that the gl commands are sent to the pipeline.

  • platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:

(WebCore::GraphicsContext3D::reshapeFBOs):
Allocate the new texture.

Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r203497 r203498  
     12016-07-21  Miguel Gomez  <magomez@igalia.com>
     2
     3        [Threaded Compositor] Flickering when zooming in/out in maps.google.com
     4        https://bugs.webkit.org/show_bug.cgi?id=154069
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        Add a new extra buffer to GraphicsContext3D when using the Threaded Compositor,
     9        so it doesn't have to reuse the buffers that are still waiting for composition.
     10
     11        Covered by existing tests.
     12
     13        * platform/graphics/GraphicsContext3D.h:
     14        Add a new texture to use for the rendering. Remove the compositor fbo we were using.
     15        * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
     16        (WebCore::GraphicsContext3D::GraphicsContext3D):
     17        Initialize the new texture and remove the previous fbo related code.
     18        (WebCore::GraphicsContext3D::~GraphicsContext3D):
     19        Properly destroy the new texture and remove the previous fbo related code.
     20        * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
     21        (WebCore::GraphicsContext3D::reshapeFBOs):
     22        Allocate the new texture and remove the previous fbo allocation.
     23        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
     24        (WebCore::GraphicsContext3D::prepareTexture):
     25        Use a single fbo with three textures instead of two fbos with a texture each.
     26        Rotate the three textures usage so:
     27        - m_texture becomes m_compositorTexture to be pushed to the compositor.
     28        - m_intermediateTexture becomes m_texture to receive the next rendering.
     29        - m_compositorTexture becomes m_intermediateTexture.
     30        And add a glFlush() to ensure that the gl commands are sent to the pipeline.
     31        * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
     32        (WebCore::GraphicsContext3D::reshapeFBOs):
     33        Allocate the new texture.
     34
    1352016-07-21  Carlos Garcia Campos  <cgarcia@igalia.com>
    236
  • trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h

    r199819 r203498  
    14231423    GC3Duint m_fbo;
    14241424#if USE(COORDINATED_GRAPHICS_THREADED)
    1425     GC3Duint m_compositorFBO;
     1425    GC3Duint m_intermediateTexture;
    14261426#endif
    14271427
  • trunk/Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp

    r200940 r203498  
    8686    , m_fbo(0)
    8787#if USE(COORDINATED_GRAPHICS_THREADED)
    88     , m_compositorFBO(0)
     88    , m_intermediateTexture(0)
    8989#endif
    9090    , m_depthStencilBuffer(0)
    … …  
    114114
    115115#if USE(COORDINATED_GRAPHICS_THREADED)
    116         ::glGenFramebuffers(1, &m_compositorFBO);
    117116        ::glGenTextures(1, &m_compositorTexture);
    118117        ::glBindTexture(GL_TEXTURE_2D, m_compositorTexture);
    … …  
    121120        ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
    122121        ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
     122
     123        ::glGenTextures(1, &m_intermediateTexture);
     124        ::glBindTexture(GL_TEXTURE_2D, m_intermediateTexture);
     125        ::glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
     126        ::glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
     127        ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
     128        ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
     129
    123130        ::glBindTexture(GL_TEXTURE_2D, 0);
    124131#endif
    … …  
    190197    ::glDeleteFramebuffers(1, &m_fbo);
    191198#if USE(COORDINATED_GRAPHICS_THREADED)
    192     ::glDeleteFramebuffers(1, &m_compositorFBO);
     199    ::glDeleteTextures(1, &m_intermediateTexture);
    193200#endif
    194201}
  • trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp

    r194933 r203498  
    178178        ::glBindTexture(GL_TEXTURE_2D, 0);
    179179#if USE(COORDINATED_GRAPHICS_THREADED)
    180         ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_compositorFBO);
    181         ::glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, m_compositorTexture, 0);
    182         attachDepthAndStencilBufferIfNeeded(internalDepthStencilFormat, width, height);
    183         ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
     180        ::glBindTexture(GL_TEXTURE_2D, m_intermediateTexture);
     181        ::glTexImage2D(GL_TEXTURE_2D, 0, m_internalColorFormat, width, height, 0, colorFormat, GL_UNSIGNED_BYTE, 0);
     182        ::glBindTexture(GL_TEXTURE_2D, 0);
    184183#endif
    185184    }
  • trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp

    r202242 r203498  
    237237
    238238#if USE(COORDINATED_GRAPHICS_THREADED)
    239     std::swap(m_fbo, m_compositorFBO);
    240239    std::swap(m_texture, m_compositorTexture);
    241 
    242     if (m_state.boundFBO != m_compositorFBO)
     240    std::swap(m_texture, m_intermediateTexture);
     241    ::glBindFramebuffer(GL_FRAMEBUFFER, m_fbo);
     242    ::glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, m_texture, 0);
     243    glFlush();
     244
     245    if (m_state.boundFBO != m_fbo)
    243246        ::glBindFramebufferEXT(GraphicsContext3D::FRAMEBUFFER, m_state.boundFBO);
    244247    else
  • trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp

    r183432 r203498  
    111111    }
    112112
     113#if USE(COORDINATED_GRAPHICS_THREADED)
     114        ::glBindTexture(GL_TEXTURE_2D, m_intermediateTexture);
     115        ::glTexImage2D(GL_TEXTURE_2D, 0, m_internalColorFormat, width, height, 0, colorFormat, GL_UNSIGNED_BYTE, 0);
     116        ::glBindTexture(GL_TEXTURE_2D, 0);
     117#endif
     118
    113119    Extensions3DOpenGLES* extensions = static_cast<Extensions3DOpenGLES*>(getExtensions());
    114120    if (extensions->isImagination() && m_attrs.antialias) {
Note: See TracChangeset for help on using the changeset viewer.