Changeset 63654 in webkit


Ignore:
Timestamp:
Jul 19, 2010 7:08:31 AM (14 years ago)
Author:
andreas.kling@nokia.com
Message:

2010-07-19 Andreas Kling <andreas.kling@nokia.com>

Reviewed by Kenneth Rohde Christiansen.

[Qt] Some composition modes fail when color has alpha zero
https://bugs.webkit.org/show_bug.cgi?id=36973

Remove erroneous optimization that ignored painting calls when
the stroke/fill color had an alpha value of zero.

  • platform/graphics/qt/GraphicsContextQt.cpp: (WebCore::GraphicsContext::drawLine): (WebCore::GraphicsContext::strokeArc): (WebCore::GraphicsContext::fillPath): (WebCore::GraphicsContext::strokePath): (WebCore::GraphicsContext::fillRect): (WebCore::GraphicsContext::fillRoundedRect):

2010-07-19 Andreas Kling <andreas.kling@nokia.com>

Reviewed by Kenneth Rohde Christiansen.

[Qt] Some composition modes fail when color has alpha zero
https://bugs.webkit.org/show_bug.cgi?id=36973

Unskip fast/canvas/canvas-composite-alpha.html

  • platform/qt/Skipped:
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r63650 r63654  
     12010-07-19  Andreas Kling  <andreas.kling@nokia.com>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        [Qt] Some composition modes fail when color has alpha zero
     6        https://bugs.webkit.org/show_bug.cgi?id=36973
     7
     8        Unskip fast/canvas/canvas-composite-alpha.html
     9
     10        * platform/qt/Skipped:
     11
    1122010-07-19  Pavel Podivilov  <podivilov@chromium.org>
    213
  • trunk/LayoutTests/platform/qt/Skipped

    r63623 r63654  
    26062606fast/text/international/002.html
    26072607fast/block/positioning/absolute-in-inline-rtl-4.html
    2608 fast/canvas/canvas-composite-alpha.html
    26092608fast/canvas/canvas-gradient-addStop-error.html
    26102609fast/css/zoom-body-scroll.html
  • trunk/WebCore/ChangeLog

    r63653 r63654  
     12010-07-19  Andreas Kling  <andreas.kling@nokia.com>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        [Qt] Some composition modes fail when color has alpha zero
     6        https://bugs.webkit.org/show_bug.cgi?id=36973
     7
     8        Remove erroneous optimization that ignored painting calls when
     9        the stroke/fill color had an alpha value of zero.
     10
     11        * platform/graphics/qt/GraphicsContextQt.cpp:
     12        (WebCore::GraphicsContext::drawLine):
     13        (WebCore::GraphicsContext::strokeArc):
     14        (WebCore::GraphicsContext::fillPath):
     15        (WebCore::GraphicsContext::strokePath):
     16        (WebCore::GraphicsContext::fillRect):
     17        (WebCore::GraphicsContext::fillRoundedRect):
     18
    1192010-07-19  Andreas Kling  <andreas.kling@nokia.com>
    220
  • trunk/WebCore/platform/graphics/qt/GraphicsContextQt.cpp

    r63614 r63654  
    359359    StrokeStyle style = strokeStyle();
    360360    Color color = strokeColor();
    361     if (style == NoStroke || !color.alpha())
     361    if (style == NoStroke)
    362362        return;
    363363
     
    468468void GraphicsContext::strokeArc(const IntRect& rect, int startAngle, int angleSpan)
    469469{
    470     if (paintingDisabled() || strokeStyle() == NoStroke || strokeThickness() <= 0.0f || !strokeColor().alpha())
     470    if (paintingDisabled() || strokeStyle() == NoStroke || strokeThickness() <= 0.0f)
    471471        return;
    472472
     
    571571    path.setFillRule(toQtFillRule(fillRule()));
    572572
    573     if (m_common->state.fillPattern || m_common->state.fillGradient || fillColor().alpha()) {
    574         drawFilledShadowPath(this, p, path);
    575         if (m_common->state.fillPattern) {
    576             AffineTransform affine;
    577             p->fillPath(path, QBrush(m_common->state.fillPattern->createPlatformPattern(affine)));
    578         } else if (m_common->state.fillGradient) {
    579             QBrush brush(*m_common->state.fillGradient->platformGradient());
    580             brush.setTransform(m_common->state.fillGradient->gradientSpaceTransform());
    581             p->fillPath(path, brush);
    582         } else {
    583             if (fillColor().alpha())
    584                 p->fillPath(path, p->brush());
    585         }
    586     }
     573    drawFilledShadowPath(this, p, path);
     574    if (m_common->state.fillPattern) {
     575        AffineTransform affine;
     576        p->fillPath(path, QBrush(m_common->state.fillPattern->createPlatformPattern(affine)));
     577    } else if (m_common->state.fillGradient) {
     578        QBrush brush(*m_common->state.fillGradient->platformGradient());
     579        brush.setTransform(m_common->state.fillGradient->gradientSpaceTransform());
     580        p->fillPath(path, brush);
     581    } else
     582        p->fillPath(path, p->brush());
     583
    587584    m_data->currentPath = QPainterPath();
    588585}
     
    598595    path.setFillRule(toQtFillRule(fillRule()));
    599596
    600     if (m_common->state.strokePattern || m_common->state.strokeGradient || strokeColor().alpha()) {
    601         FloatSize shadowSize;
    602         float shadowBlur;
    603         Color shadowColor;
    604         if (getShadow(shadowSize, shadowBlur, shadowColor)) {
    605             QTransform t(p->worldTransform());
    606             p->translate(shadowSize.width(), shadowSize.height());
    607             QPen shadowPen(pen);
    608             shadowPen.setColor(shadowColor);
    609             p->strokePath(path, shadowPen);
    610             p->setWorldTransform(t);
    611         }
    612         if (m_common->state.strokePattern) {
    613             AffineTransform affine;
    614             pen.setBrush(QBrush(m_common->state.strokePattern->createPlatformPattern(affine)));
    615             p->setPen(pen);
    616             p->strokePath(path, pen);
    617         } else if (m_common->state.strokeGradient) {
    618             QBrush brush(*m_common->state.strokeGradient->platformGradient());
    619             brush.setTransform(m_common->state.strokeGradient->gradientSpaceTransform());
    620             pen.setBrush(brush);
    621             p->setPen(pen);
    622             p->strokePath(path, pen);
    623         } else {
    624             if (strokeColor().alpha())
    625                 p->strokePath(path, pen);
    626         }
    627     }
     597    FloatSize shadowSize;
     598    float shadowBlur;
     599    Color shadowColor;
     600    if (getShadow(shadowSize, shadowBlur, shadowColor)) {
     601        QTransform t(p->worldTransform());
     602        p->translate(shadowSize.width(), shadowSize.height());
     603        QPen shadowPen(pen);
     604        shadowPen.setColor(shadowColor);
     605        p->strokePath(path, shadowPen);
     606        p->setWorldTransform(t);
     607    }
     608    if (m_common->state.strokePattern) {
     609        AffineTransform affine;
     610        pen.setBrush(QBrush(m_common->state.strokePattern->createPlatformPattern(affine)));
     611        p->setPen(pen);
     612        p->strokePath(path, pen);
     613    } else if (m_common->state.strokeGradient) {
     614        QBrush brush(*m_common->state.strokeGradient->platformGradient());
     615        brush.setTransform(m_common->state.strokeGradient->gradientSpaceTransform());
     616        pen.setBrush(brush);
     617        p->setPen(pen);
     618        p->strokePath(path, pen);
     619    } else
     620        p->strokePath(path, pen);
    628621    m_data->currentPath = QPainterPath();
    629622}
     
    713706        return;
    714707
    715     if (!(m_common->state.fillPattern || m_common->state.fillGradient || fillColor().alpha()))
    716         return;
    717 
    718708    QPainter* p = m_data->p();
    719709    FloatRect normalizedRect = rect.normalized();
     
    760750        }
    761751        p->fillRect(normalizedRect, brush);
    762     } else if (fillColor().alpha()) {
     752    } else {
    763753        if (hasShadow) {
    764754            pShadow->fillRect(shadowImage->rect(), p->brush());
     
    788778void GraphicsContext::fillRoundedRect(const IntRect& rect, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight, const Color& color, ColorSpace colorSpace)
    789779{
    790     if (paintingDisabled() || !color.isValid() || !color.alpha())
     780    if (paintingDisabled() || !color.isValid())
    791781        return;
    792782
Note: See TracChangeset for help on using the changeset viewer.