Changeset 52115 in webkit


Ignore:
Timestamp:
Dec 14, 2009 1:27:11 PM (14 years ago)
Author:
eric@webkit.org
Message:

2009-12-14 Jakob Petsovits <jpetsovits@rim.com>

Reviewed by Simon Fraser.

Add FloatQuad::isRectilinear() to check whether it can be represented as FloatRect.
https://bugs.webkit.org/show_bug.cgi?id=30442

This enables optimizations for distinguishing between
arbitrary FloatQuads and rectilinear ones.

  • platform/graphics/FloatQuad.cpp: (WebCore::FloatQuad::isRectilinear):
  • platform/graphics/FloatQuad.h:
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r52113 r52115  
     12009-12-14  Jakob Petsovits  <jpetsovits@rim.com>
     2
     3        Reviewed by Simon Fraser.
     4
     5        Add FloatQuad::isRectilinear() to check whether it can be represented as FloatRect.
     6        https://bugs.webkit.org/show_bug.cgi?id=30442
     7
     8        This enables optimizations for distinguishing between
     9        arbitrary FloatQuads and rectilinear ones.
     10
     11        * platform/graphics/FloatQuad.cpp:
     12        (WebCore::FloatQuad::isRectilinear):
     13        * platform/graphics/FloatQuad.h:
     14
    1152009-12-14  Simon Hausmann  <hausmann@webkit.org>
    216
  • trunk/WebCore/platform/graphics/FloatQuad.cpp

    r42206 r52115  
    8686}
    8787
     88bool FloatQuad::isRectilinear() const
     89{
     90    return (m_p1.x() == m_p2.x() && m_p2.y() == m_p3.y() && m_p3.x() == m_p4.x() && m_p4.y() == m_p1.y())
     91        || (m_p1.y() == m_p2.y() && m_p2.x() == m_p3.x() && m_p3.y() == m_p4.y() && m_p4.x() == m_p1.x());
     92}
     93
    8894bool FloatQuad::containsPoint(const FloatPoint& p) const
    8995{
  • trunk/WebCore/platform/graphics/FloatQuad.h

    r42206 r52115  
    7575    bool isEmpty() const { return boundingBox().isEmpty(); }
    7676
     77    // Tests whether this quad can be losslessly represented by a FloatRect,
     78    // that is, if two edges are parallel to the x-axis and the other two
     79    // are parallel to the y-axis. If this method returns true, the
     80    // corresponding FloatRect can be retrieved with boundingBox().
     81    bool isRectilinear() const;
     82
    7783    // Tests whether the given point is inside, or on an edge or corner of this quad.
    7884    bool containsPoint(const FloatPoint&) const;
Note: See TracChangeset for help on using the changeset viewer.