Changeset 55314 in webkit


Ignore:
Timestamp:
Feb 26, 2010 2:27:44 PM (14 years ago)
Author:
krit@webkit.org
Message:

2010-02-26 Dirk Schulze <krit@webkit.org>

Reviewed by Nikolas Zimmermann.

Extend AffineTransform to mapQuad
https://bugs.webkit.org/show_bug.cgi?id=35444

This makes mapQuad available for AffineTransform. So that platforms
can make use of it after the switch from TransformationMatrix to
AffineTransform in GraphicsContext.

  • platform/graphics/transforms/AffineTransform.cpp: (WebCore::AffineTransform::mapRect): mapRect already did the calculation for mapQuad but gave back the

boundingBox of the resulting FloatQuad.

(WebCore::AffineTransform::mapQuad):

  • platform/graphics/transforms/AffineTransform.h:
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r55313 r55314  
     12010-02-26  Dirk Schulze  <krit@webkit.org>
     2
     3        Reviewed by Nikolas Zimmermann.
     4
     5        Extend AffineTransform to mapQuad
     6        https://bugs.webkit.org/show_bug.cgi?id=35444
     7
     8        This makes mapQuad available for AffineTransform. So that platforms
     9        can make use of it after the switch from TransformationMatrix to
     10        AffineTransform in GraphicsContext.
     11
     12        * platform/graphics/transforms/AffineTransform.cpp:
     13        (WebCore::AffineTransform::mapRect): mapRect already did the calculation for mapQuad but gave back the
     14                                             boundingBox of the resulting FloatQuad.
     15        (WebCore::AffineTransform::mapQuad):
     16        * platform/graphics/transforms/AffineTransform.h:
     17
    1182010-02-26  Brady Eidson  <beidson@apple.com>
    219
  • trunk/WebCore/platform/graphics/transforms/AffineTransform.cpp

    r54564 r55314  
    315315    }
    316316
    317     FloatQuad q(rect);
     317    FloatQuad result;
     318    result.setP1(mapPoint(rect.location()));
     319    result.setP2(mapPoint(FloatPoint(rect.right(), rect.y())));
     320    result.setP3(mapPoint(FloatPoint(rect.right(), rect.bottom())));
     321    result.setP4(mapPoint(FloatPoint(rect.x(), rect.bottom())));
     322    return result.boundingBox();
     323}
     324
     325FloatQuad AffineTransform::mapQuad(const FloatQuad& q) const
     326{
     327    if (isIdentityOrTranslation()) {
     328        FloatQuad mappedQuad(q);
     329        mappedQuad.move(narrowPrecisionToFloat(m_transform[4]), narrowPrecisionToFloat(m_transform[5]));
     330        return mappedQuad;
     331    }
    318332
    319333    FloatQuad result;
     
    322336    result.setP3(mapPoint(q.p3()));
    323337    result.setP4(mapPoint(q.p4()));
    324     return result.boundingBox();
     338    return result;
    325339}
    326340
  • trunk/WebCore/platform/graphics/transforms/AffineTransform.h

    r55266 r55314  
    7575
    7676    FloatRect mapRect(const FloatRect&) const;
     77    FloatQuad mapQuad(const FloatQuad&) const;
    7778
    7879    bool isIdentity() const;
Note: See TracChangeset for help on using the changeset viewer.