Changeset 140825 in webkit


Ignore:
Timestamp:
Jan 25, 2013 6:39:22 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[TexMap] Flickering after transitions on Apple HTML5 demo
https://bugs.webkit.org/show_bug.cgi?id=102501

Patch by Alexander Paschenko <alexander.pashenko@lge.com> on 2013-01-25
Reviewed by Noam Rosenthal.

The problem is caused by inconsistent state of TextureMapperLayer's transformation matrix
and opacity data during and after the end of animation.
This patch solves the problem by introducing three additional private flags
to TextureMapperLayer:
m_shouldUpdateCurrentTransformFromGraphicsLayer,
m_shouldUpdateCurrentOpacityFromGraphicsLayer, and
m_shouldUpdateCurrentFiltersFromGraphicsLayer.
The latter has been introduced in order to avoid similar future problems
with m_currentFilters.
On these flags' basis, TextureMapperLayer is able to decide whether to update
its inner state or not.
These flags themselves are set based on GraphicsLayerTextureMapper's changeMask
which indicates what details of the state have been changed since the last sync.

No new tests - this doesn't expose any testable surface.
Eyes-only check has been made to ensure that the problem is gone now.

  • platform/graphics/texmap/TextureMapperLayer.cpp:

(WebCore::TextureMapperLayer::setAnimatedTransform):
sets m_shouldUpdateCurrentTransformFromGraphicsLayer to false and
updates m_currentTransform based on the updated state from GraphicsLayerAnimation.
(WebCore):
(WebCore::TextureMapperLayer::setAnimatedOpacity):
sets m_shouldUpdateCurrentOpacityFromGraphicsLayer to false and
updates m_currentOpacity based on the updated state from GraphicsLayerAnimation.
(WebCore::TextureMapperLayer::setAnimatedFilters):
sets m_shouldUpdateCurrentFiltersFromGraphicsLayer to false and
updates m_currentFilters based on the updated state from GraphicsLayerAnimation.
(WebCore::TextureMapperLayer::flushCompositingStateForThisLayerOnly):
sets m_shouldUpdateCurrent* flags based on GLTM's changeMask. Also illegal modification
of m_currentTransform that caused flickering has been removed from this method.
(WebCore::TextureMapperLayer::syncAnimations): updates m_currentTransform and/or
m_currentOpacity and/or m_currentFilters if corresponding flags allow to do so.

  • platform/graphics/texmap/TextureMapperLayer.h:

(WebCore::TextureMapperLayer::TextureMapperLayer): aforementioned flags
get initialized in ctor.
(TextureMapperLayer): aforementioned flags are declared in the class.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r140823 r140825  
     12013-01-25  Alexander Paschenko  <alexander.pashenko@lge.com>
     2
     3        [TexMap] Flickering after transitions on Apple HTML5 demo
     4        https://bugs.webkit.org/show_bug.cgi?id=102501
     5
     6        Reviewed by Noam Rosenthal.
     7
     8        The problem is caused by inconsistent state of TextureMapperLayer's transformation matrix
     9        and opacity data during and after the end of animation.
     10        This patch solves the problem by introducing three additional private flags
     11        to TextureMapperLayer:
     12        m_shouldUpdateCurrentTransformFromGraphicsLayer,
     13        m_shouldUpdateCurrentOpacityFromGraphicsLayer, and
     14        m_shouldUpdateCurrentFiltersFromGraphicsLayer.
     15        The latter has been introduced in order to avoid similar future problems
     16        with m_currentFilters.
     17        On these flags' basis, TextureMapperLayer is able to decide whether to update
     18        its inner state or not.
     19        These flags themselves are set based on GraphicsLayerTextureMapper's changeMask
     20        which indicates what details of the state have been changed since the last sync.
     21
     22        No new tests - this doesn't expose any testable surface.
     23        Eyes-only check has been made to ensure that the problem is gone now.
     24
     25        * platform/graphics/texmap/TextureMapperLayer.cpp:
     26        (WebCore::TextureMapperLayer::setAnimatedTransform):
     27        sets m_shouldUpdateCurrentTransformFromGraphicsLayer to false and
     28        updates m_currentTransform based on the updated state from GraphicsLayerAnimation.
     29        (WebCore):
     30        (WebCore::TextureMapperLayer::setAnimatedOpacity):
     31        sets m_shouldUpdateCurrentOpacityFromGraphicsLayer to false and
     32        updates m_currentOpacity based on the updated state from GraphicsLayerAnimation.
     33        (WebCore::TextureMapperLayer::setAnimatedFilters):
     34        sets m_shouldUpdateCurrentFiltersFromGraphicsLayer to false and
     35        updates m_currentFilters based on the updated state from GraphicsLayerAnimation.
     36        (WebCore::TextureMapperLayer::flushCompositingStateForThisLayerOnly):
     37        sets m_shouldUpdateCurrent* flags based on GLTM's changeMask. Also illegal modification
     38        of m_currentTransform that caused flickering has been removed from this method.
     39        (WebCore::TextureMapperLayer::syncAnimations): updates m_currentTransform and/or
     40        m_currentOpacity and/or m_currentFilters if corresponding flags allow to do so.
     41        * platform/graphics/texmap/TextureMapperLayer.h:
     42        (WebCore::TextureMapperLayer::TextureMapperLayer): aforementioned flags
     43        get initialized in ctor.
     44        (TextureMapperLayer): aforementioned flags are declared in the class.
     45
     46
    1472013-01-25  Marja Hölttä  <marja@chromium.org>
    248
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp

    r140821 r140825  
    297297}
    298298
    299 #if ENABLE(CSS_FILTERS)
     299void TextureMapperLayer::setAnimatedTransform(const TransformationMatrix& matrix)
     300{
     301    m_shouldUpdateCurrentTransformFromGraphicsLayer = false;
     302    m_currentTransform.setLocalTransform(matrix);
     303}
     304
     305void TextureMapperLayer::setAnimatedOpacity(float opacity)
     306{
     307    m_shouldUpdateCurrentOpacityFromGraphicsLayer = false;
     308    m_currentOpacity = opacity;
     309}
     310
     311#if ENABLE(CSS_FILTERS)
     312void TextureMapperLayer::setAnimatedFilters(const FilterOperations& filters)
     313{
     314    m_shouldUpdateCurrentFiltersFromGraphicsLayer = false;
     315    m_currentFilters = filters;
     316}
     317
    300318static bool shouldKeepContentTexture(const FilterOperations& filters)
    301319{
     
    408426    if (changeMask & AnimationChange)
    409427        m_animations = graphicsLayer->m_animations;
     428   
     429    if (changeMask & TransformChange)
     430        m_shouldUpdateCurrentTransformFromGraphicsLayer = true;
     431
     432    if (changeMask & OpacityChange)
     433        m_shouldUpdateCurrentOpacityFromGraphicsLayer = true;
     434
     435#if ENABLE(CSS_FILTERS)
     436    if (changeMask & FilterChange)
     437        m_shouldUpdateCurrentFiltersFromGraphicsLayer = true;
     438#endif
    410439
    411440    if (changeMask & RepaintCountChange)
     
    445474    m_currentTransform.setSize(m_state.size);
    446475    m_currentTransform.setFlattening(!m_state.preserves3D);
    447     m_currentTransform.setLocalTransform(m_state.transform);
    448476    m_currentTransform.setChildrenTransform(m_state.childrenTransform);
    449477
     
    520548{
    521549    m_animations.apply(this);
    522     if (!m_animations.hasActiveAnimationsOfType(AnimatedPropertyWebkitTransform))
    523         setAnimatedTransform(m_state.transform);
    524     if (!m_animations.hasActiveAnimationsOfType(AnimatedPropertyOpacity))
    525         setAnimatedOpacity(m_state.opacity);
    526 #if ENABLE(CSS_FILTERS)
    527     if (!m_animations.hasActiveAnimationsOfType(AnimatedPropertyWebkitFilter))
    528         setAnimatedFilters(m_state.filters);
     550    if (!m_animations.hasActiveAnimationsOfType(AnimatedPropertyWebkitTransform) && m_shouldUpdateCurrentTransformFromGraphicsLayer)
     551        m_currentTransform.setLocalTransform(m_state.transform);
     552    if (!m_animations.hasActiveAnimationsOfType(AnimatedPropertyOpacity) && m_shouldUpdateCurrentOpacityFromGraphicsLayer)
     553        m_currentOpacity = m_state.opacity;
     554
     555#if ENABLE(CSS_FILTERS)
     556    if (!m_animations.hasActiveAnimationsOfType(AnimatedPropertyWebkitFilter) && m_shouldUpdateCurrentFiltersFromGraphicsLayer)
     557        m_currentFilters = m_state.filters;
    529558#endif
    530559}
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h

    r140821 r140825  
    8484        , m_currentOpacity(1)
    8585        , m_centerZ(0)
     86        , m_shouldUpdateCurrentTransformFromGraphicsLayer(true)
     87        , m_shouldUpdateCurrentOpacityFromGraphicsLayer(true)
     88#if ENABLE(CSS_FILTERS)
     89        , m_shouldUpdateCurrentFiltersFromGraphicsLayer(true)
     90#endif
    8691        , m_textureMapper(0)
    8792    { }
     
    128133
    129134    // GraphicsLayerAnimation::Client
    130     virtual void setAnimatedTransform(const TransformationMatrix& matrix) OVERRIDE { m_currentTransform.setLocalTransform(matrix); }
    131     virtual void setAnimatedOpacity(float opacity) OVERRIDE { m_currentOpacity = opacity; }
    132 #if ENABLE(CSS_FILTERS)
    133     virtual void setAnimatedFilters(const FilterOperations& filters) OVERRIDE { m_currentFilters = filters; }
     135    virtual void setAnimatedTransform(const TransformationMatrix&) OVERRIDE;
     136    virtual void setAnimatedOpacity(float) OVERRIDE;
     137#if ENABLE(CSS_FILTERS)
     138    virtual void setAnimatedFilters(const FilterOperations&) OVERRIDE;
    134139#endif
    135140
     
    161166#endif
    162167    float m_centerZ;
     168   
     169    bool m_shouldUpdateCurrentTransformFromGraphicsLayer;
     170    bool m_shouldUpdateCurrentOpacityFromGraphicsLayer;
     171#if ENABLE(CSS_FILTERS)
     172    bool m_shouldUpdateCurrentFiltersFromGraphicsLayer;
     173#endif
    163174
    164175    struct State {
Note: See TracChangeset for help on using the changeset viewer.