Changeset 55266 in webkit


Ignore:
Timestamp:
Feb 25, 2010 5:06:30 PM (14 years ago)
Author:
oliver@apple.com
Message:

2010-02-25 Oliver Hunt <oliver@apple.com>

Reviewed by Simon Fraser.

Multiple repaints on apple.com
https://bugs.webkit.org/show_bug.cgi?id=35409

apple.com was triggering the fast scaling path for background images due to
repeated repaints as more content came in. This occured due to a two problems
in the logic to detect scaling. The first is that the main context is flipped
on mac so fails the identity or translation check. We work around this by adding
an function that allows the scaling for a flipped CTM. The other problem was that
we were looking at the destination rect size instead of the destination tile size
when deciding if the size we were drawn at would cause scaling.

  • platform/graphics/transforms/AffineTransform.h: (WebCore::AffineTransform::isIdentityOrTranslationOrFlipped):
  • rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelScaleObserver::shouldPaintBackgroundAtLowQuality): (WebCore::RenderBoxModelObject::paintFillLayerExtended):
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r55263 r55266  
     12010-02-25  Oliver Hunt  <oliver@apple.com>
     2
     3        Reviewed by Simon Fraser.
     4
     5        Multiple repaints on apple.com
     6        https://bugs.webkit.org/show_bug.cgi?id=35409
     7
     8        apple.com was triggering the fast scaling path for background images due to
     9        repeated repaints as more content came in.  This occured due to a two problems
     10        in the logic to detect scaling.  The first is that the main context is flipped
     11        on mac so fails the identity or translation check.  We work around this by adding
     12        an function that allows the scaling for a flipped CTM.  The other problem was that
     13        we were looking at the destination rect size instead of the destination tile size
     14        when deciding if the size we were drawn at would cause scaling.
     15
     16        * platform/graphics/transforms/AffineTransform.h:
     17        (WebCore::AffineTransform::isIdentityOrTranslationOrFlipped):
     18        * rendering/RenderBoxModelObject.cpp:
     19        (WebCore::RenderBoxModelScaleObserver::shouldPaintBackgroundAtLowQuality):
     20        (WebCore::RenderBoxModelObject::paintFillLayerExtended):
     21
    1222010-02-25  Enrica Casucci  <enrica@apple.com>
    223
  • trunk/WebCore/platform/graphics/transforms/AffineTransform.h

    r54564 r55266  
    121121        return m_transform[0] == 1 && m_transform[1] == 0 && m_transform[2] == 0 && m_transform[3] == 1;
    122122    }
     123   
     124    bool isIdentityOrTranslationOrFlipped() const
     125    {
     126        return m_transform[0] == 1 && m_transform[1] == 0 && m_transform[2] == 0 && (m_transform[3] == 1 || m_transform[3] == -1);
     127    }
    123128
    124129    bool operator== (const AffineTransform& m2) const
  • trunk/WebCore/rendering/RenderBoxModelObject.cpp

    r55141 r55266  
    132132
    133133    const AffineTransform& currentTransform = context->getCTM();
    134     bool contextIsScaled = !currentTransform.isIdentityOrTranslation();
     134    bool contextIsScaled = !currentTransform.isIdentityOrTranslationOrFlipped();
    135135    if (!contextIsScaled && imageSize == size) {
    136136        // There is no scale in effect.  If we had a scale in effect before, we can just delete this data.
     
    607607            RenderObject* clientForBackgroundImage = backgroundObject ? backgroundObject : this;
    608608            Image* image = bg->image(clientForBackgroundImage, tileSize);
    609             bool useLowQualityScaling = RenderBoxModelScaleObserver::shouldPaintBackgroundAtLowQuality(context, this, image, destRect.size());
     609            bool useLowQualityScaling = RenderBoxModelScaleObserver::shouldPaintBackgroundAtLowQuality(context, this, image, tileSize);
    610610            context->drawTiledImage(image, style()->colorSpace(), destRect, phase, tileSize, compositeOp, useLowQualityScaling);
    611611        }
Note: See TracChangeset for help on using the changeset viewer.