Changeset 139479 in webkit


Ignore:
Timestamp:
Jan 11, 2013 11:59:48 AM (11 years ago)
Author:
leviw@chromium.org
Message:

RenderGeometryMap and TransformState disagree with sub-pixel layout and translations
https://bugs.webkit.org/show_bug.cgi?id=106047

Reviewed by Simon Fraser.

Source/WebCore:

Mirror RenderGeometryMap's optimization for integer-translated transforms in TransformState.
This avoids the current behavior where the two can disagree on mappings, since RenderGeometryMap
pixel-snapped later when a translation occurred between two sub-pixel containers.

Test: fast/layers/geometry-map-transform-state-translation-mismatch.html

  • platform/graphics/transforms/TransformState.h:

(WebCore::TransformState::setQuad): Clear accumulatedOffset when setting a new quad. Note: this
implementation only works properly when only tracking a quad.

  • platform/graphics/transforms/TransformState.cpp:

(WebCore::TransformState::applyTransform): apply integral translations to the accumulatedOffset
for performance and consistency with RenderGeometryMap.

LayoutTests:

  • fast/layers/geometry-map-transform-state-translation-mismatch-expected.txt: Added.
  • fast/layers/geometry-map-transform-state-translation-mismatch.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r139475 r139479  
     12013-01-11  Levi Weintraub  <leviw@chromium.org>
     2
     3        RenderGeometryMap and TransformState disagree with sub-pixel layout and translations
     4        https://bugs.webkit.org/show_bug.cgi?id=106047
     5
     6        Reviewed by Simon Fraser.
     7
     8        * fast/layers/geometry-map-transform-state-translation-mismatch-expected.txt: Added.
     9        * fast/layers/geometry-map-transform-state-translation-mismatch.html: Added.
     10
    1112013-01-11  Stephen Chenney  <schenney@chromium.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r139470 r139479  
     12013-01-11  Levi Weintraub  <leviw@chromium.org>
     2
     3        RenderGeometryMap and TransformState disagree with sub-pixel layout and translations
     4        https://bugs.webkit.org/show_bug.cgi?id=106047
     5
     6        Reviewed by Simon Fraser.
     7
     8        Mirror RenderGeometryMap's optimization for integer-translated transforms in TransformState.
     9        This avoids the current behavior where the two can disagree on mappings, since RenderGeometryMap
     10        pixel-snapped later when a translation occurred between two sub-pixel containers.
     11
     12        Test: fast/layers/geometry-map-transform-state-translation-mismatch.html
     13
     14        * platform/graphics/transforms/TransformState.h:
     15        (WebCore::TransformState::setQuad): Clear accumulatedOffset when setting a new quad. Note: this
     16        implementation only works properly when only tracking a quad.
     17        * platform/graphics/transforms/TransformState.cpp:
     18        (WebCore::TransformState::applyTransform): apply integral translations to the accumulatedOffset
     19        for performance and consistency with RenderGeometryMap.
     20
    1212013-01-11  Abhishek Arya  <inferno@chromium.org>
    222
  • trunk/Source/WebCore/platform/graphics/transforms/TransformState.cpp

    r137847 r139479  
    112112        *wasClamped = false;
    113113
     114    if (transformFromContainer.isIntegerTranslation()) {
     115        move(LayoutSize(transformFromContainer.e(), transformFromContainer.f()), accumulate);
     116        return;
     117    }
     118
    114119    applyAccumulatedOffset();
    115120
  • trunk/Source/WebCore/platform/graphics/transforms/TransformState.h

    r137847 r139479  
    7474    TransformState& operator=(const TransformState&);
    7575   
    76     void setQuad(const FloatQuad& quad) { m_lastPlanarQuad = quad; }
     76    void setQuad(const FloatQuad& quad)
     77    {
     78        // FIXME: this assumes that the quad being added is in the coordinate system of the current state.
     79        // This breaks if we're simultaneously mapping a point. https://bugs.webkit.org/show_bug.cgi?id=106680
     80        ASSERT(!m_mapPoint);
     81        m_accumulatedOffset = LayoutSize();
     82        m_lastPlanarQuad = quad;
     83    }
    7784
    7885    void move(LayoutUnit x, LayoutUnit y, TransformAccumulation accumulate = FlattenTransform)
Note: See TracChangeset for help on using the changeset viewer.