Changeset 55334 in webkit


Ignore:
Timestamp:
Feb 26, 2010 6:59:56 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-02-26 Noam Rosenthal <noam.rosenthal@nokia.com>

Reviewed by Kenneth Rohde Christiansen.

[Qt] GraphicsLayerQt: artifacts and wrong transformOrigin
This was due to wrong way of applying cache-mode and transformation
on a graphics-item with HTML. Cache-mode should be updated
when the content type updates, even if it was the same cache-mode

https://bugs.webkit.org/show_bug.cgi?id=35382

Test URL attached to the bug now works correctly.

  • platform/graphics/qt/GraphicsLayerQt.cpp: (WebCore::GraphicsLayerQtImpl::computeTransform): (WebCore::GraphicsLayerQtImpl::flushChanges):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r55332 r55334  
     12010-02-26  Noam Rosenthal  <noam.rosenthal@nokia.com>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        [Qt] GraphicsLayerQt: artifacts and wrong transformOrigin
     6        This was due to wrong way of applying cache-mode and transformation
     7        on a graphics-item with HTML. Cache-mode should be updated
     8        when the content type updates, even if it was the same cache-mode
     9   
     10        https://bugs.webkit.org/show_bug.cgi?id=35382
     11
     12        Test URL attached to the bug now works correctly.
     13
     14        * platform/graphics/qt/GraphicsLayerQt.cpp:
     15        (WebCore::GraphicsLayerQtImpl::computeTransform):
     16        (WebCore::GraphicsLayerQtImpl::flushChanges):
     17
    1182010-02-26  Luiz Agostini  <luiz.agostini@openbossa.org>
    219
  • trunk/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp

    r55132 r55334  
    309309    // attribute that call setChildrenTransform
    310310    QPointF offset = -pos() - boundingRect().bottomRight() / 2;
    311     const GraphicsLayerQtImpl* ancestor = this;
    312     while ((ancestor = qobject_cast<GraphicsLayerQtImpl*>(ancestor->parentObject()))) {
     311
     312    for (const GraphicsLayerQtImpl* ancestor = this; (ancestor = qobject_cast<GraphicsLayerQtImpl*>(ancestor->parentObject())); ) {
    313313        if (!ancestor->m_state.childrenTransform.isIdentity()) {
    314             offset += ancestor->boundingRect().bottomRight() / 2;
     314            const QPointF offset = mapFromItem(ancestor, QPointF(ancestor->m_size.width() / 2, ancestor->m_size.height() / 2));
    315315            computedTransform
    316316                .translate(offset.x(), offset.y())
     
    319319            break;
    320320        }
    321         offset -= ancestor->pos();
    322     }
    323 
    324     computedTransform.multLeft(baseTransform);
     321    }
    325322
    326323    // webkit has relative-to-size originPoint, graphics-view has a pixel originPoint, here we convert
     
    328325    const qreal originX = m_state.anchorPoint.x() * m_size.width();
    329326    const qreal originY = m_state.anchorPoint.y() * m_size.height();
    330     computedTransform = TransformationMatrix()
    331                             .translate(originX, originY)
    332                             .multiply(computedTransform)
    333                             .translate(-originX, -originY);
     327    computedTransform
     328            .translate3d(originX, originY, m_state.anchorPoint.z())
     329            .multLeft(baseTransform)
     330            .translate3d(-originX, -originY, -m_state.anchorPoint.z());
    334331
    335332    // now we project to 2D
     
    512509                update();
    513510                if (m_layer->drawsContent() && !m_maskEffect) {
    514                     const QGraphicsItem::CacheMode mewCacheMode = isTransformAnimationRunning() ? ItemCoordinateCache : DeviceCoordinateCache;
    515 
    516                     // optimization: QGraphicsItem doesn't always perform this test
    517                     if (mewCacheMode != cacheMode())
    518                         setCacheMode(mewCacheMode);
     511                    setCacheMode(isTransformAnimationRunning() ? ItemCoordinateCache : DeviceCoordinateCache);
    519512
    520513                    // HTML content: we want to use exposedRect so we don't use WebCore rendering if we don't have to
Note: See TracChangeset for help on using the changeset viewer.