Changeset 139030 in webkit


Ignore:
Timestamp:
Jan 7, 2013 8:58:03 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[EFL][WebGL] Crash of WebKitTestRunner when running webgl layout tests
https://bugs.webkit.org/show_bug.cgi?id=105936

Patch by Viatcheslav Ostapenko <sl.ostapenko@samsung.com> on 2013-01-07
Reviewed by Laszlo Gombos.

If canvas window becomes invalid don't create pixmap from it and don't
use it for painting.

Improves stability of existing webgl layout tests.

  • platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp:

(WebCore::GraphicsSurfacePrivate::createPixmap):
(WebCore::GraphicsSurfacePrivate::size):
(WebCore::GraphicsSurface::platformGetTextureID):
(WebCore::GraphicsSurface::platformPaintToTextureMapper):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r139029 r139030  
     12013-01-07  Viatcheslav Ostapenko  <sl.ostapenko@samsung.com>
     2
     3        [EFL][WebGL] Crash of WebKitTestRunner when running webgl layout tests
     4        https://bugs.webkit.org/show_bug.cgi?id=105936
     5
     6        Reviewed by Laszlo Gombos.
     7
     8        If canvas window becomes invalid don't create pixmap from it and don't
     9        use it for painting.
     10
     11        Improves stability of existing webgl layout tests.
     12
     13        * platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp:
     14        (WebCore::GraphicsSurfacePrivate::createPixmap):
     15        (WebCore::GraphicsSurfacePrivate::size):
     16        (WebCore::GraphicsSurface::platformGetTextureID):
     17        (WebCore::GraphicsSurface::platformPaintToTextureMapper):
     18
    1192013-01-07  Hajime Morrita  <morrita@google.com>
    220
  • trunk/Source/WebCore/platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp

    r138614 r139030  
    238238    {
    239239        XWindowAttributes attr;
    240         XGetWindowAttributes(m_display, winId, &attr);
     240        if (!XGetWindowAttributes(m_display, winId, &attr))
     241            return;
     242        m_size = IntSize(attr.width, attr.height);
    241243
    242244        XRenderPictFormat* format = XRenderFindVisualFormat(m_display, attr.visual);
     
    342344        if (m_size.isEmpty()) {
    343345            XWindowAttributes attr;
    344             XGetWindowAttributes(m_display, m_surface, &attr);
    345             const_cast<GraphicsSurfacePrivate*>(this)->m_size = IntSize(attr.width, attr.height);
     346            if (XGetWindowAttributes(m_display, m_surface, &attr))
     347                const_cast<GraphicsSurfacePrivate*>(this)->m_size = IntSize(attr.width, attr.height);
    346348        }
    347349        return m_size;
     
    411413{
    412414    if (!m_texture) {
     415        GLXPixmap pixmap = m_private->glxPixmap();
     416        if (!pixmap)
     417            return 0;
     418
    413419        glGenTextures(1, &m_texture);
    414420        glBindTexture(GL_TEXTURE_2D, m_texture);
     
    417423        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
    418424        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
    419         pGlXBindTexImageEXT(m_private->display(), m_private->glxPixmap(), GLX_FRONT_EXT, 0);
     425        pGlXBindTexImageEXT(m_private->display(), pixmap, GLX_FRONT_EXT, 0);
    420426    }
    421427
     
    437443{
    438444    TextureMapperGL* texMapGL = static_cast<TextureMapperGL*>(textureMapper);
     445    IntSize size = m_private->size();
     446    if (size.isEmpty())
     447        return;
     448    uint32_t texture = platformGetTextureID();
     449    if (!texture)
     450        return;
    439451    TransformationMatrix adjustedTransform = transform;
    440     adjustedTransform.multiply(TransformationMatrix::rectToRect(FloatRect(FloatPoint::zero(), m_private->size()), targetRect));
     452    adjustedTransform.multiply(TransformationMatrix::rectToRect(FloatRect(FloatPoint::zero(), size), targetRect));
    441453    TextureMapperGL::Flags flags = m_private->textureIsYInverted() ? TextureMapperGL::ShouldFlipTexture : 0;
    442454    flags |= TextureMapperGL::ShouldBlend;
    443     texMapGL->drawTexture(platformGetTextureID(), flags, m_private->size(), targetRect, adjustedTransform, opacity, mask);
     455    texMapGL->drawTexture(texture, flags, size, targetRect, adjustedTransform, opacity, mask);
    444456}
    445457
Note: See TracChangeset for help on using the changeset viewer.