Changeset 181138 in webkit


Ignore:
Timestamp:
Mar 5, 2015 10:16:04 PM (9 years ago)
Author:
Carlos Garcia Campos
Message:

REGRESSION(r180924): ASSERTION FAILED: !from.isEmpty() in WebCore::TransformationMatrix::rectToRect
https://bugs.webkit.org/show_bug.cgi?id=142345

Reviewed by Martin Robinson.

This was caused by r180924 that postpones the creation of the
TextureMapper, which could cause that a layer has not yet a size
when TextureMapper::paint() is called. This patch moves the
creation of the TextureMapper to
LayerTreeHostGtk::setNativeSurfaceHandleForCompositing(), so that
it's created as soon as it's possible to create. This method is
called by the drawing area right after creating the
LayerTreeHostGtk if it already have a handler, or when the handle
is received from the UI process.

  • WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:

(WebKit::LayerTreeHostGtk::initialize): Remove the
nsureTextureMapper call because at this point the layer context ID
is always 0, so it's impossible to create the TextureMapper.
(WebKit::LayerTreeHostGtk::compositeLayersToContext): Remove the
ensureTextureMapper call from here too, since at this point, if we
have a context, we should also have a TextureMapper. Add an ASSERT
right before using the TextureMapper.
(WebKit::LayerTreeHostGtk::setNativeSurfaceHandleForCompositing):
Create the TextureMapper here.
(WebKit::LayerTreeHostGtk::ensureTextureMapper): Deleted.

  • WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r181099 r181138  
     12015-03-05  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        REGRESSION(r180924): ASSERTION FAILED: !from.isEmpty() in WebCore::TransformationMatrix::rectToRect
     4        https://bugs.webkit.org/show_bug.cgi?id=142345
     5
     6        Reviewed by Martin Robinson.
     7
     8        This was caused by r180924 that postpones the creation of the
     9        TextureMapper, which could cause that a layer has not yet a size
     10        when TextureMapper::paint() is called. This patch moves the
     11        creation of the TextureMapper to
     12        LayerTreeHostGtk::setNativeSurfaceHandleForCompositing(), so that
     13        it's created as soon as it's possible to create. This method is
     14        called by the drawing area right after creating the
     15        LayerTreeHostGtk if it already have a handler, or when the handle
     16        is received from the UI process.
     17
     18        * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
     19        (WebKit::LayerTreeHostGtk::initialize): Remove the
     20        nsureTextureMapper call because at this point the layer context ID
     21        is always 0, so it's impossible to create the TextureMapper.
     22        (WebKit::LayerTreeHostGtk::compositeLayersToContext): Remove the
     23        ensureTextureMapper call from here too, since at this point, if we
     24        have a context, we should also have a TextureMapper. Add an ASSERT
     25        right before using the TextureMapper.
     26        (WebKit::LayerTreeHostGtk::setNativeSurfaceHandleForCompositing):
     27        Create the TextureMapper here.
     28        (WebKit::LayerTreeHostGtk::ensureTextureMapper): Deleted.
     29        * WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
     30
    1312015-03-05  Anders Carlsson  <andersca@apple.com>
    232
  • trunk/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp

    r180924 r181138  
    9393}
    9494
    95 void LayerTreeHostGtk::ensureTextureMapper()
    96 {
    97     if (m_textureMapper)
    98         return;
    99 
    100     ASSERT(m_isValid);
    101     m_textureMapper = TextureMapper::create(TextureMapper::OpenGLMode);
    102     static_cast<TextureMapperGL*>(m_textureMapper.get())->setEnableEdgeDistanceAntialiasing(true);
    103     downcast<GraphicsLayerTextureMapper>(*m_rootLayer).layer().setTextureMapper(m_textureMapper.get());
    104 }
    105 
    10695void LayerTreeHostGtk::initialize()
    10796{
     
    125114    m_rootLayer->addChild(m_nonCompositedContentLayer.get());
    126115    m_nonCompositedContentLayer->setNeedsDisplay();
    127 
    128     // The creation of the TextureMapper needs an active OpenGL context.
    129     if (!makeContextCurrent())
    130         return;
    131 
    132     ensureTextureMapper();
    133     scheduleLayerFlush();
    134116}
    135117
     
    297279        return;
    298280
    299     ensureTextureMapper();
    300 
    301281    // The window size may be out of sync with the page size at this point, and getting
    302282    // the viewport parameters incorrect, means that the content will be misplaced. Thus
     
    310290    }
    311291
     292    ASSERT(m_textureMapper);
    312293    m_textureMapper->beginPainting();
    313294    downcast<GraphicsLayerTextureMapper>(*m_rootLayer).layer().paint();
     
    345326void LayerTreeHostGtk::scheduleLayerFlush()
    346327{
    347     if (!m_layerFlushSchedulingEnabled)
     328    if (!m_layerFlushSchedulingEnabled || !m_textureMapper)
    348329        return;
    349330
     
    388369{
    389370    m_layerTreeContext.contextID = handle;
     371
     372    // The creation of the TextureMapper needs an active OpenGL context.
     373    if (!makeContextCurrent())
     374        return;
     375
     376    ASSERT(m_isValid);
     377    ASSERT(!m_textureMapper);
     378    m_textureMapper = TextureMapper::create(TextureMapper::OpenGLMode);
     379    static_cast<TextureMapperGL*>(m_textureMapper.get())->setEnableEdgeDistanceAntialiasing(true);
     380    downcast<GraphicsLayerTextureMapper>(*m_rootLayer).layer().setTextureMapper(m_textureMapper.get());
     381
     382    scheduleLayerFlush();
    390383}
    391384
  • trunk/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.h

    r180924 r181138  
    8888
    8989    bool makeContextCurrent();
    90     void ensureTextureMapper();
    9190
    9291    LayerTreeContext m_layerTreeContext;
Note: See TracChangeset for help on using the changeset viewer.