Changeset 145810 in webkit
- Timestamp:
- Mar 14, 2013 7:04:32 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r145809 r145810 1 2013-03-14 Allan Sandfeld Jensen <allan.jensen@digia.com> 2 3 [Qt] Add support for tiled shadow blur 4 https://bugs.webkit.org/show_bug.cgi?id=90082 5 6 Reviewed by Noam Rosenthal. 7 8 Use the optimized ShadowBlur::drawRectShadow as long as we do not 9 have a rotating transform. Such a transform would go through the 10 slow path in ShadowBlur anyway, and would end up using a transformed 11 TransparencyLayer with an alphaMap which causes scaling artifacts 12 for us. 13 14 Tested by fast/canvas/canvas-scale-fillRect-shadow.html 15 and fast/canvas/canvas-transforms-fillRect-shadow.html 16 17 * platform/graphics/ShadowBlur.cpp: 18 (WebCore::ShadowBlur::drawInsetShadowWithTiling): 19 Handle scaling transforms when shadows ignore transforms. 20 (WebCore::ShadowBlur::drawRectShadowWithTiling): 21 Ditto. 22 * platform/graphics/qt/GraphicsContextQt.cpp: 23 (WebCore::GraphicsContext::fillRect): 24 1 25 2013-03-12 Andrey Kosyakov <caseq@chromium.org> 2 26 -
trunk/Source/WebCore/platform/graphics/ShadowBlur.cpp
r145366 r145810 680 680 blurAndColorShadowBuffer(templateSize); 681 681 } 682 FloatSize offset = m_offset; 683 if (shadowsIgnoreTransforms()) { 684 AffineTransform transform = graphicsContext->getCTM(); 685 offset.scale(1 / transform.xScale(), 1 / transform.yScale()); 686 } 682 687 683 688 FloatRect boundingRect = rect; 684 boundingRect.move( m_offset);689 boundingRect.move(offset); 685 690 686 691 FloatRect destHoleRect = holeRect; 687 destHoleRect.move( m_offset);692 destHoleRect.move(offset); 688 693 FloatRect destHoleBounds = destHoleRect; 689 694 destHoleBounds.inflateX(edgeSize.width()); … … 737 742 blurAndColorShadowBuffer(templateSize); 738 743 } 744 FloatSize offset = m_offset; 745 if (shadowsIgnoreTransforms()) { 746 AffineTransform transform = graphicsContext->getCTM(); 747 offset.scale(1 / transform.xScale(), 1 / transform.yScale()); 748 } 739 749 740 750 FloatRect shadowBounds = shadowedRect; 741 shadowBounds.move( m_offset.width(), m_offset.height());751 shadowBounds.move(offset); 742 752 shadowBounds.inflateX(edgeSize.width()); 743 753 shadowBounds.inflateY(edgeSize.height()); -
trunk/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
r145366 r145810 803 803 if (hasShadow()) { 804 804 if (shadow->mustUseShadowBlur(this)) { 805 GraphicsContext* shadowContext = shadow->beginShadowLayer(this, normalizedRect); 806 if (shadowContext) { 807 QPainter* shadowPainter = shadowContext->platformContext(); 808 shadowPainter->fillRect(normalizedRect, p->brush()); 809 shadow->endShadowLayer(this); 810 } 805 // drawRectShadowWithTiling does not work with rotations, and the fallback of 806 // drawing though clipToImageBuffer() produces scaling artifacts for us. 807 if (!getCTM().preservesAxisAlignment()) { 808 GraphicsContext* shadowContext = shadow->beginShadowLayer(this, normalizedRect); 809 if (shadowContext) { 810 QPainter* shadowPainter = shadowContext->platformContext(); 811 shadowPainter->fillRect(normalizedRect, p->brush()); 812 shadow->endShadowLayer(this); 813 } 814 } else 815 shadow->drawRectShadow(this, rect, RoundedRect::Radii()); 811 816 } else { 812 817 // Solid rectangle fill with no blur shadow or transformations applied can be done
Note: See TracChangeset
for help on using the changeset viewer.