Changeset 65791 in webkit


Ignore:
Timestamp:
Aug 22, 2010 5:52:13 PM (14 years ago)
Author:
andreas.kling@nokia.com
Message:

2010-08-22 Andreas Kling <andreas.kling@nokia.com>

Reviewed by Kenneth Rohde Christiansen.

[Qt] GraphicsContext: Simplify getting the clip bounding rect
https://bugs.webkit.org/show_bug.cgi?id=44396

Move the Qt 4.8 version check for QPainter::clipBoundingRect()
into a GraphicsContextPlatformPrivate method.

  • platform/graphics/qt/GraphicsContextQt.cpp: (WebCore::GraphicsContextPlatformPrivate::clipBoundingRect): (WebCore::GraphicsContext::beginTransparencyLayer): (WebCore::GraphicsContext::clipOut): (WebCore::GraphicsContext::clipOutEllipseInRect):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r65788 r65791  
     12010-08-22  Andreas Kling  <andreas.kling@nokia.com>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        [Qt] GraphicsContext: Simplify getting the clip bounding rect
     6        https://bugs.webkit.org/show_bug.cgi?id=44396
     7
     8        Move the Qt 4.8 version check for QPainter::clipBoundingRect()
     9        into a GraphicsContextPlatformPrivate method.
     10
     11        * platform/graphics/qt/GraphicsContextQt.cpp:
     12        (WebCore::GraphicsContextPlatformPrivate::clipBoundingRect):
     13        (WebCore::GraphicsContext::beginTransparencyLayer):
     14        (WebCore::GraphicsContext::clipOut):
     15        (WebCore::GraphicsContext::clipOutEllipseInRect):
     16
    1172010-08-22  Juha Savolainen  <juha.savolainen@weego.fi>
    218
  • trunk/WebCore/platform/graphics/qt/GraphicsContextQt.cpp

    r65782 r65791  
    208208    {
    209209        return shadow.type != ContextShadow::NoShadow;
     210    }
     211
     212    QRectF clipBoundingRect() const
     213    {
     214#if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
     215        return painter->clipBoundingRect();
     216#else
     217        return painter->clipRegion().boundingRect();
     218#endif
    210219    }
    211220
     
    912921    h = device->height();
    913922
    914     QRectF clip = p->clipPath().boundingRect();
     923    QRectF clip = m_data->clipBoundingRect();
    915924    QRectF deviceClip = p->transform().mapRect(clip);
    916925    x = int(qBound(qreal(0), deviceClip.x(), (qreal)w));
     
    10751084    newClip.setFillRule(Qt::OddEvenFill);
    10761085    if (p->hasClipping()) {
    1077 #if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
    1078         newClip.addRect(p->clipBoundingRect());
    1079 #else
    1080         newClip.addRect(p->clipRegion().boundingRect());
    1081 #endif
     1086        newClip.addRect(m_data->clipBoundingRect());
    10821087        newClip.addPath(clippedOut);
    10831088        p->setClipPath(newClip, Qt::IntersectClip);
     
    11491154    newClip.setFillRule(Qt::OddEvenFill);
    11501155    if (p->hasClipping()) {
    1151 #if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
    1152         newClip.addRect(p->clipBoundingRect());
    1153 #else
    1154         newClip.addRect(p->clipRegion().boundingRect());
    1155 #endif
     1156        newClip.addRect(m_data->clipBoundingRect());
    11561157        newClip.addRect(QRect(rect));
    11571158        p->setClipPath(newClip, Qt::IntersectClip);
     
    11751176    newClip.setFillRule(Qt::OddEvenFill);
    11761177    if (p->hasClipping()) {
    1177 #if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
    1178         newClip.addRect(p->clipBoundingRect());
    1179 #else
    1180         newClip.addRect(p->clipRegion().boundingRect());
    1181 #endif
     1178        newClip.addRect(m_data->clipBoundingRect());
    11821179        newClip.addEllipse(QRect(rect));
    11831180        p->setClipPath(newClip, Qt::IntersectClip);
Note: See TracChangeset for help on using the changeset viewer.