Changeset 121435 in webkit
- Timestamp:
- Jun 28, 2012 9:14:54 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r121433 r121435 1 2012-06-28 Bruno de Oliveira Abinader <bruno.abinader@basyskom.com> 2 3 [Qt] Make GC's fill{Rounded}Rect use optimized shadow blur code 4 https://bugs.webkit.org/show_bug.cgi?id=90082 5 6 Reviewed by Noam Rosenthal. 7 8 ShadowBlur::drawRectShadow makes use of optimized tiles-based drawPattern, which 9 is not present when using {begin/end}shadowLayer. 10 11 * platform/graphics/qt/GraphicsContextQt.cpp: 12 (WebCore::GraphicsContext::fillRect): 13 (WebCore::GraphicsContext::fillRoundedRect): 14 (WebCore::GraphicsContext::pushTransparencyLayerInternal): 15 1 16 2012-06-28 Rahul Tiwari <rahultiwari.cse.iitr@gmail.com> 2 17 -
trunk/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
r120065 r121435 704 704 return; 705 705 706 m_data->solidColor.setColor(color); 707 QPainter* p = m_data->p(); 708 QRectF normalizedRect = rect.normalized(); 709 706 QRectF platformRect(rect); 707 QPainter* p = m_data->p(); 710 708 if (hasShadow()) { 711 709 ShadowBlur* shadow = shadowBlur(); 712 710 if (shadow->mustUseShadowBlur(this)) { 713 GraphicsContext* shadowContext = shadow->beginShadowLayer(this, normalizedRect); 714 if (shadowContext) { 715 QPainter* shadowPainter = shadowContext->platformContext(); 716 shadowPainter->setCompositionMode(QPainter::CompositionMode_Source); 717 shadowPainter->fillRect(normalizedRect, m_state.shadowColor); 718 shadow->endShadowLayer(this); 719 } 711 shadow->drawRectShadow(this, platformRect, RoundedRect::Radii()); 720 712 } else { 721 713 QColor shadowColor = m_state.shadowColor; 722 714 shadowColor.setAlphaF(shadowColor.alphaF() * p->brush().color().alphaF()); 723 p->fillRect( normalizedRect.translated(QPointF(m_state.shadowOffset.width(), m_state.shadowOffset.height())), shadowColor);715 p->fillRect(platformRect.translated(QPointF(m_state.shadowOffset.width(), m_state.shadowOffset.height())), shadowColor); 724 716 } 725 717 } 726 727 p->fillRect(normalizedRect, m_data->solidColor); 718 p->fillRect(platformRect, QColor(color)); 728 719 } 729 720 … … 739 730 ShadowBlur* shadow = shadowBlur(); 740 731 if (shadow->mustUseShadowBlur(this)) { 741 GraphicsContext* shadowContext = shadow->beginShadowLayer(this, rect); 742 if (shadowContext) { 743 QPainter* shadowPainter = shadowContext->platformContext(); 744 shadowPainter->setCompositionMode(QPainter::CompositionMode_Source); 745 shadowPainter->fillPath(path.platformPath(), QColor(m_state.shadowColor)); 746 shadow->endShadowLayer(this); 747 } 732 shadow->drawRectShadow(this, rect, RoundedRect::Radii(topLeft, topRight, bottomLeft, bottomRight)); 748 733 } else { 749 734 const QPointF shadowOffset(m_state.shadowOffset.width(), m_state.shadowOffset.height()); … … 1046 1031 QPainter* p = m_data->p(); 1047 1032 1048 QRect deviceClip = p->transform().mapRect(rect); 1033 QTransform deviceTransform = p->transform(); 1034 QRect deviceClip = deviceTransform.mapRect(rect); 1035 1036 alphaMask = alphaMask.transformed(deviceTransform); 1049 1037 if (alphaMask.width() != deviceClip.width() || alphaMask.height() != deviceClip.height()) 1050 1038 alphaMask = alphaMask.scaled(deviceClip.width(), deviceClip.height());
Note: See TracChangeset
for help on using the changeset viewer.