Changeset 74054 in webkit
- Timestamp:
- Dec 14, 2010 1:04:47 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r74053 r74054 1 2010-12-14 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r74040. 4 http://trac.webkit.org/changeset/74040 5 https://bugs.webkit.org/show_bug.cgi?id=51050 6 7 Breaks 2d.shadow.canvas.transparent.2 and 8 2d.shadow.image.transparent.2 (Requested by helder on 9 #webkit). 10 11 * fast/canvas/canvas-scale-strokePath-shadow-expected.txt: 12 * fast/canvas/canvas-transforms-fillRect-shadow-expected.txt: Removed. 13 * fast/canvas/canvas-transforms-fillRect-shadow.html: Removed. 14 * fast/canvas/script-tests/canvas-scale-fillPath-shadow.js: 15 * fast/canvas/script-tests/canvas-scale-fillRect-shadow.js: 16 * fast/canvas/script-tests/canvas-scale-strokePath-shadow.js: 17 * fast/canvas/script-tests/canvas-transforms-fillRect-shadow.js: Removed. 18 1 19 2010-12-14 Mihai Parparita <mihaip@chromium.org> 2 20 -
trunk/LayoutTests/fast/canvas/canvas-scale-strokePath-shadow-expected.txt
r74040 r74054 31 31 PASS d[1] is 0 32 32 PASS d[2] is 0 33 PASS d[3] is around 14933 PASS d[3] is around 20 34 34 PASS d[0] is 255 35 35 PASS d[1] is 0 36 36 PASS d[2] is 0 37 PASS d[3] is around 11637 PASS d[3] is around 22 38 38 PASS d[0] is 255 39 39 PASS d[1] is 0 40 40 PASS d[2] is 0 41 PASS d[3] is around 11541 PASS d[3] is around 28 42 42 PASS d[0] is 255 43 43 PASS d[1] is 0 44 44 PASS d[2] is 0 45 PASS d[3] is around 7045 PASS d[3] is around 22 46 46 PASS d[0] is 255 47 47 PASS d[1] is 0 48 48 PASS d[2] is 0 49 PASS d[3] is around 7049 PASS d[3] is around 15 50 50 PASS d[0] is 255 51 51 PASS d[1] is 0 52 52 PASS d[2] is 0 53 PASS d[3] is around 6953 PASS d[3] is around 17 54 54 PASS successfullyParsed is true 55 55 -
trunk/LayoutTests/fast/canvas/script-tests/canvas-scale-fillPath-shadow.js
r74040 r74054 80 80 shouldBe('d[3]', '255'); 81 81 82 d = ctx.getImageData(29 8, 295, 1, 1).data;82 d = ctx.getImageData(299, 295, 1, 1).data; 83 83 shouldBe('d[0]', '255'); 84 84 shouldBe('d[1]', '0'); … … 86 86 shouldBe('d[3]', '255'); 87 87 88 d = ctx.getImageData(200, 29 8, 1, 1).data;88 d = ctx.getImageData(200, 299, 1, 1).data; 89 89 shouldBe('d[0]', '255'); 90 90 shouldBe('d[1]', '0'); … … 99 99 shouldBeAround('d[3]', '76'); 100 100 101 d = ctx.getImageData(29 8, 405, 1, 1).data;101 d = ctx.getImageData(299, 405, 1, 1).data; 102 102 shouldBe('d[0]', '255'); 103 103 shouldBe('d[1]', '0'); … … 105 105 shouldBeAround('d[3]', '76'); 106 106 107 d = ctx.getImageData(205, 49 8, 1, 1).data;107 d = ctx.getImageData(205, 499, 1, 1).data; 108 108 shouldBe('d[0]', '255'); 109 109 shouldBe('d[1]', '0'); -
trunk/LayoutTests/fast/canvas/script-tests/canvas-scale-fillRect-shadow.js
r74040 r74054 59 59 shouldBe('d[3]', '255'); 60 60 61 d = ctx.getImageData(29 8, 298, 1, 1).data;61 d = ctx.getImageData(299, 295, 1, 1).data; 62 62 shouldBe('d[0]', '255'); 63 63 shouldBe('d[1]', '0'); … … 65 65 shouldBe('d[3]', '255'); 66 66 67 d = ctx.getImageData(20 1, 298, 1, 1).data;67 d = ctx.getImageData(200, 299, 1, 1).data; 68 68 shouldBe('d[0]', '255'); 69 69 shouldBe('d[1]', '0'); … … 78 78 shouldBeAround('d[3]', '76'); 79 79 80 d = ctx.getImageData(29 8, 405, 1, 1).data;80 d = ctx.getImageData(299, 405, 1, 1).data; 81 81 shouldBe('d[0]', '255'); 82 82 shouldBe('d[1]', '0'); … … 84 84 shouldBeAround('d[3]', '76'); 85 85 86 d = ctx.getImageData(205, 49 8, 1, 1).data;86 d = ctx.getImageData(205, 499, 1, 1).data; 87 87 shouldBe('d[0]', '255'); 88 88 shouldBe('d[1]', '0'); -
trunk/LayoutTests/fast/canvas/script-tests/canvas-scale-strokePath-shadow.js
r74040 r74054 36 36 ctx.shadowOffsetY = 100; 37 37 ctx.strokeStyle = 'rgba(0, 0, 255, 1)'; 38 ctx.lineWidth = 5;39 38 40 39 ctx.shadowColor = 'rgba(255, 0, 0, 1.0)'; … … 78 77 79 78 // Verify solid shadow. 80 d = ctx.getImageData(2 50, 200, 1, 1).data;79 d = ctx.getImageData(200, 205, 1, 1).data; 81 80 shouldBe('d[0]', '255'); 82 81 shouldBe('d[1]', '0'); … … 84 83 shouldBe('d[3]', '255'); 85 84 86 d = ctx.getImageData( 300, 290, 1, 1).data;85 d = ctx.getImageData(299, 295, 1, 1).data; 87 86 shouldBe('d[0]', '255'); 88 87 shouldBe('d[1]', '0'); … … 90 89 shouldBe('d[3]', '255'); 91 90 92 d = ctx.getImageData(20 0, 250, 1, 1).data;91 d = ctx.getImageData(201, 299, 1, 1).data; 93 92 shouldBe('d[0]', '255'); 94 93 shouldBe('d[1]', '0'); … … 97 96 98 97 // Verify solid alpha shadow. 99 d = ctx.getImageData(20 1, 405, 1, 1).data;98 d = ctx.getImageData(200, 405, 1, 1).data; 100 99 shouldBe('d[0]', '255'); 101 100 shouldBe('d[1]', '0'); … … 103 102 shouldBeAround('d[3]', '76'); 104 103 105 d = ctx.getImageData(2 01, 500, 1, 1).data;104 d = ctx.getImageData(299, 405, 1, 1).data; 106 105 shouldBe('d[0]', '255'); 107 106 shouldBe('d[1]', '0'); … … 109 108 shouldBeAround('d[3]', '76'); 110 109 111 d = ctx.getImageData( 300, 499, 1, 1).data;110 d = ctx.getImageData(205, 499, 1, 1).data; 112 111 shouldBe('d[0]', '255'); 113 112 shouldBe('d[1]', '0'); … … 116 115 117 116 // Verify blurry shadow. 118 d = ctx.getImageData( 404, 210, 1, 1).data;117 d = ctx.getImageData(394, 208, 1, 1).data; 119 118 shouldBe('d[0]', '255'); 120 119 shouldBe('d[1]', '0'); 121 120 shouldBe('d[2]', '0'); 122 shouldBeAround('d[3]', ' 149');121 shouldBeAround('d[3]', '20'); 123 122 124 d = ctx.getImageData(50 5, 250, 1, 1).data;123 d = ctx.getImageData(503, 301, 1, 1).data; 125 124 shouldBe('d[0]', '255'); 126 125 shouldBe('d[1]', '0'); 127 126 shouldBe('d[2]', '0'); 128 shouldBeAround('d[3]', ' 116');127 shouldBeAround('d[3]', '22'); 129 128 130 d = ctx.getImageData( 450, 205, 1, 1).data;129 d = ctx.getImageData(504, 250, 1, 1).data; 131 130 shouldBe('d[0]', '255'); 132 131 shouldBe('d[1]', '0'); 133 132 shouldBe('d[2]', '0'); 134 shouldBeAround('d[3]', ' 115');133 shouldBeAround('d[3]', '28'); 135 134 136 135 // Verify blurry alpha shadow. 137 d = ctx.getImageData( 505, 450, 1, 1).data;136 d = ctx.getImageData(405, 405, 1, 1).data; 138 137 shouldBe('d[0]', '255'); 139 138 shouldBe('d[1]', '0'); 140 139 shouldBe('d[2]', '0'); 141 shouldBeAround('d[3]', ' 70');140 shouldBeAround('d[3]', '22'); 142 141 143 d = ctx.getImageData( 505, 450, 1, 1).data;142 d = ctx.getImageData(415, 495, 1, 1).data; 144 143 shouldBe('d[0]', '255'); 145 144 shouldBe('d[1]', '0'); 146 145 shouldBe('d[2]', '0'); 147 shouldBeAround('d[3]', ' 70');146 shouldBeAround('d[3]', '15'); 148 147 149 d = ctx.getImageData(450, 405, 1, 1).data;148 d = ctx.getImageData(450, 504, 1, 1).data; 150 149 shouldBe('d[0]', '255'); 151 150 shouldBe('d[1]', '0'); 152 151 shouldBe('d[2]', '0'); 153 shouldBeAround('d[3]', ' 69');152 shouldBeAround('d[3]', '17'); 154 153 155 154 var successfullyParsed = true; -
trunk/WebCore/ChangeLog
r74052 r74054 1 2010-12-14 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r74040. 4 http://trac.webkit.org/changeset/74040 5 https://bugs.webkit.org/show_bug.cgi?id=51050 6 7 Breaks 2d.shadow.canvas.transparent.2 and 8 2d.shadow.image.transparent.2 (Requested by helder on 9 #webkit). 10 11 * platform/graphics/ContextShadow.cpp: 12 (WebCore::ContextShadow::ContextShadow): 13 (WebCore::ContextShadow::calculateLayerBoundingRect): 14 * platform/graphics/ContextShadow.h: 15 (WebCore::ContextShadow::offset): 16 * platform/graphics/qt/ContextShadowQt.cpp: 17 (WebCore::ContextShadow::beginShadowLayer): 18 (WebCore::ContextShadow::endShadowLayer): 19 * platform/graphics/qt/GraphicsContextQt.cpp: 20 (WebCore::GraphicsContext::fillPath): 21 (WebCore::GraphicsContext::strokePath): 22 (WebCore::GraphicsContext::fillRect): 23 (WebCore::GraphicsContext::fillRoundedRect): 24 (WebCore::GraphicsContext::setPlatformShadow): 25 1 26 2010-12-14 Nate Chapin <japhet@chromium.org> 2 27 -
trunk/WebCore/platform/graphics/ContextShadow.cpp
r74040 r74054 42 42 , m_blurDistance(0) 43 43 , m_layerContext(0) 44 , m_shadowsIgnoreTransforms(false)45 44 { 46 45 } … … 51 50 , m_offset(offset) 52 51 , m_layerContext(0) 53 , m_shadowsIgnoreTransforms(false)54 52 { 55 53 // See comments in http://webkit.org/b/40793, it seems sensible … … 152 150 } 153 151 154 #if PLATFORM(QT)155 IntRect ContextShadow::calculateLayerBoundingRect(const PlatformContext p, const FloatRect& layerArea, const IntRect& clipRect)156 {157 // Calculate the destination of the blurred and/or transformed layer.158 FloatRect layerFloatRect;159 float inflation = 0;160 161 const QTransform transform = p->transform();162 if (m_shadowsIgnoreTransforms && !transform.isIdentity()) {163 QPolygonF transformedPolygon = transform.map(QPolygonF(layerArea));164 transformedPolygon.translate(offset());165 layerFloatRect = transform.inverted().map(transformedPolygon).boundingRect();166 } else {167 layerFloatRect = layerArea;168 layerFloatRect.move(m_offset);169 }170 171 // We expand the area by the blur radius to give extra space for the blur transition.172 if (m_type == BlurShadow) {173 layerFloatRect.inflate(m_blurDistance);174 inflation += m_blurDistance;175 }176 177 if (!clipRect.contains(enclosingIntRect(layerFloatRect))) {178 // No need to have the buffer larger than the clip.179 layerFloatRect.intersect(clipRect);180 181 // If we are totally outside the clip region, we aren't painting at all.182 if (layerFloatRect.isEmpty())183 return IntRect(0, 0, 0, 0);184 185 // We adjust again because the pixels at the borders are still186 // potentially affected by the pixels outside the buffer.187 if (m_type == BlurShadow) {188 layerFloatRect.inflate(m_blurDistance);189 inflation += m_blurDistance;190 }191 }192 193 const int frameSize = inflation * 2;194 m_sourceRect = IntRect(0, 0, layerArea.width() + frameSize, layerArea.height() + frameSize);195 m_layerOrigin = FloatPoint(layerFloatRect.x(), layerFloatRect.y());196 return enclosingIntRect(layerFloatRect);197 }198 #endif199 200 #if PLATFORM(CAIRO)201 152 void ContextShadow::calculateLayerBoundingRect(const FloatRect& layerArea, const IntRect& clipRect) 202 153 { … … 223 174 } 224 175 } 225 #endif226 176 227 177 } // namespace WebCore -
trunk/WebCore/platform/graphics/ContextShadow.h
r74040 r74054 107 107 void endShadowLayer(PlatformContext); 108 108 static void purgeScratchBuffer(); 109 void setShadowsIgnoreTransforms(bool enable) { m_shadowsIgnoreTransforms = enable; }110 bool shadowsIgnoreTransforms() const { return m_shadowsIgnoreTransforms; }111 109 #if PLATFORM(CAIRO) 112 110 void drawRectShadow(GraphicsContext* context, const IntRect& rect, const IntSize& topLeftRadius = IntSize(), const IntSize& topRightRadius = IntSize(), const IntSize& bottomLeftRadius = IntSize(), const IntSize& bottomRightRadius = IntSize()); 113 111 #endif 112 114 113 #if PLATFORM(QT) 115 QPointF offset() const{ return QPointF(m_offset.width(), m_offset.height()); }114 QPointF offset() { return QPointF(m_offset.width(), m_offset.height()); } 116 115 #endif 117 116 118 117 119 118 private: 120 // Buffer to where the temporary shadow will be drawn to.119 IntRect m_layerRect; 121 120 PlatformImage m_layerImage; 122 // Context used to paint the shadow to the layer image.123 121 PlatformContext m_layerContext; 124 #if PLATFORM(QT) 125 // Sub-rect of m_layerImage that contains the shadow pixels. 126 FloatRect m_sourceRect; 127 // Top-left corner of the bounding rect where the shadow image needs to be drawn. 128 FloatPoint m_layerOrigin; 129 #endif 130 #if PLATFORM(CAIRO) 131 // Enclosing int rect where shadow needs to be drawn to using the layer context. 132 IntRect m_layerRect; 122 133 123 // Used for reference when canvas scale(x,y) was called. 134 124 FloatRect m_unscaledLayerRect; 135 #endif136 bool m_shadowsIgnoreTransforms;137 125 138 126 void blurLayerImage(unsigned char*, const IntSize& imageSize, int stride); 127 void calculateLayerBoundingRect(const FloatRect& layerArea, const IntRect& clipRect); 139 128 #if PLATFORM(CAIRO) 140 void calculateLayerBoundingRect(const FloatRect& layerArea, const IntRect& clipRect);141 129 void drawRectShadowWithoutTiling(PlatformContext context, const IntRect& shadowRect, const IntSize& topLeftRadius, const IntSize& topRightRadius, const IntSize& bottomLeftRadius, const IntSize& bottomRightRadius, float alpha); 142 #else143 IntRect calculateLayerBoundingRect(const PlatformContext, const FloatRect& layerArea, const IntRect& clipRect);144 130 #endif 145 131 }; -
trunk/WebCore/platform/graphics/qt/ContextShadowQt.cpp
r74040 r74054 115 115 clipRect = p->transform().inverted().mapRect(p->window()); 116 116 117 // Set m_layerOrigin and m_sourceRect. 118 IntRect clip(clipRect.x(), clipRect.y(), clipRect.width(), clipRect.height()); 119 IntRect layerRect = calculateLayerBoundingRect(p, layerArea, clip); 117 m_unscaledLayerRect = layerArea; 118 calculateLayerBoundingRect(layerArea, IntRect(clipRect.x(), clipRect.y(), clipRect.width(), clipRect.height())); 120 119 121 120 // Don't paint if we are totally outside the clip region. 122 if ( layerRect.isEmpty())121 if (m_layerRect.isEmpty()) 123 122 return 0; 124 123 125 124 ShadowBuffer* shadowBuffer = scratchShadowBuffer(); 126 QImage* shadowImage = shadowBuffer->scratchImage( layerRect.size());125 QImage* shadowImage = shadowBuffer->scratchImage(m_layerRect.size()); 127 126 m_layerImage = QImage(*shadowImage); 128 127 … … 130 129 m_layerContext->begin(&m_layerImage); 131 130 m_layerContext->setFont(p->font()); 131 m_layerContext->translate(m_offset.width(), m_offset.height()); 132 132 133 // Set the origin as the top left corner of the scratch image. 134 const int frameSize = (m_sourceRect.width() - layerArea.width()) / 2; 135 m_layerContext->translate(-layerArea.x() + frameSize, -layerArea.y() + frameSize); 133 // The origin is now the top left corner of the scratch image. 134 m_layerContext->translate(-m_layerRect.x(), -m_layerRect.y()); 136 135 137 136 return m_layerContext; … … 157 156 } 158 157 159 p->drawImage(m_layerOrigin, m_layerImage, m_sourceRect); 158 const QTransform transform = p->transform(); 159 if (transform.isScaling()) { 160 qreal x = m_unscaledLayerRect.x() + m_offset.width() / transform.m11() - m_blurDistance; 161 qreal y = m_unscaledLayerRect.y() + m_offset.height() / transform.m22() - m_blurDistance; 162 p->drawImage(QPointF(x, y), m_layerImage); 163 } else 164 p->drawImage(m_layerRect.topLeft(), m_layerImage); 160 165 161 166 scratchShadowBuffer()->schedulePurge(); -
trunk/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
r74040 r74054 54 54 55 55 #include <QBrush> 56 #include <QDebug> 56 57 #include <QGradient> 57 58 #include <QPaintDevice> … … 175 176 } 176 177 177 static inline bool mustUseContextShadow(QPainter* painter, ContextShadow* shadow)178 {179 if (shadow->m_type == ContextShadow::BlurShadow)180 // We can't avoid ContextShadow, since the shadow has blur.181 return true;182 if (!shadow->shadowsIgnoreTransforms())183 // We can avoid ContextShadow and optimize, since we're not drawing on a canvas and box184 // shadows are affected by the transformation matrix.185 return false;186 if (painter->transform().isIdentity())187 // We can avoid ContextShadow, since there are no transformations to apply to the canvas.188 return false;189 // Otherwise, no chance avoiding ContextShadow.190 return true;191 }192 193 178 class GraphicsContextPlatformPrivate : public Noncopyable { 194 179 public: … … 522 507 if (m_data->hasShadow()) { 523 508 ContextShadow* shadow = contextShadow(); 524 if (mustUseContextShadow(p, shadow) || m_state.fillPattern || m_state.fillGradient) 509 if (shadow->m_type != ContextShadow::BlurShadow 510 && !m_state.fillPattern && !m_state.fillGradient) 525 511 { 512 QPointF offset = shadow->offset(); 513 const QTransform& transform = p->transform(); 514 if (transform.isScaling()) { 515 // If scaling is required, find the new coord for shadow origin, 516 // so that the relative offset to its shape is kept. 517 QPointF translatedOffset(offset.x() / transform.m11(), 518 offset.y() / transform.m22()); 519 platformPath.translate(translatedOffset); 520 p->fillPath(platformPath, QColor(shadow->m_color)); 521 platformPath.translate(-translatedOffset); 522 } else { 523 p->translate(offset); 524 p->fillPath(platformPath, QColor(shadow->m_color)); 525 p->translate(-offset); 526 } 527 } else { 526 528 QPainter* shadowPainter = shadow->beginShadowLayer(p, platformPath.controlPointRect()); 527 529 if (shadowPainter) { … … 530 532 shadow->endShadowLayer(p); 531 533 } 532 } else {533 QPointF offset = shadow->offset();534 p->translate(offset);535 p->fillPath(platformPath, QColor(shadow->m_color));536 p->translate(-offset);537 534 } 535 538 536 } 539 537 if (m_state.fillPattern) { … … 560 558 if (m_data->hasShadow()) { 561 559 ContextShadow* shadow = contextShadow(); 562 if (mustUseContextShadow(p, shadow) || m_state.strokePattern || m_state.strokeGradient) 560 561 if (shadow->m_type != ContextShadow::BlurShadow 562 && !m_state.strokePattern && !m_state.strokeGradient) 563 563 { 564 QPen shadowPen(pen); 565 shadowPen.setColor(m_data->shadow.m_color); 566 QPointF offset = shadow->offset(); 567 const QTransform& transform = p->transform(); 568 if (transform.isScaling()) { 569 // If scaling is required, find the new coord for shadow origin, 570 // so that the relative offset to its shape is kept. 571 QPointF translatedOffset(offset.x() / transform.m11(), 572 offset.y() / transform.m22()); 573 platformPath.translate(translatedOffset); 574 p->strokePath(platformPath, shadowPen); 575 platformPath.translate(-translatedOffset); 576 } else { 577 p->translate(offset); 578 p->strokePath(platformPath, shadowPen); 579 p->translate(-offset); 580 } 581 } else { 564 582 FloatRect boundingRect = platformPath.controlPointRect(); 565 583 boundingRect.inflate(pen.miterLimit() + pen.widthF()); … … 570 588 shadow->endShadowLayer(p); 571 589 } 572 } else {573 QPen shadowPen(pen);574 shadowPen.setColor(m_data->shadow.m_color);575 QPointF offset = shadow->offset();576 p->translate(offset);577 p->strokePath(platformPath, shadowPen);578 p->translate(-offset);579 590 } 580 591 } … … 696 707 } else { 697 708 if (m_data->hasShadow()) { 698 if ( mustUseContextShadow(p, shadow)) {709 if (shadow->m_type == ContextShadow::BlurShadow) { 699 710 QPainter* shadowPainter = shadow->beginShadowLayer(p, normalizedRect); 700 711 if (shadowPainter) { … … 704 715 } 705 716 } else { 706 // Solid rectangle fill with no blur shadow or transformations applied can be done707 // fasterwithout using the shadow layer at all.717 // Solid rectangle fill with no blur shadow can be done faster 718 // without using the shadow layer at all. 708 719 QColor shadowColor = shadow->m_color; 709 720 shadowColor.setAlphaF(shadowColor.alphaF() * p->brush().color().alphaF()); 710 p->fillRect(normalizedRect.translated(shadow->offset()), shadowColor); 721 const QTransform& transform = p->transform(); 722 if (transform.isScaling()) { 723 p->fillRect(normalizedRect.translated(static_cast<qreal>(shadow->offset().x()) / transform.m11(), 724 static_cast<qreal>(shadow->offset().y() / transform.m22())), 725 shadowColor); 726 } else 727 p->fillRect(normalizedRect.translated(shadow->offset()), shadowColor); 711 728 } 712 729 } … … 728 745 if (m_data->hasShadow()) { 729 746 ContextShadow* shadow = contextShadow(); 730 if (mustUseContextShadow(p, shadow)) { 747 748 if (shadow->m_type != ContextShadow::BlurShadow) { 749 // We do not need any layer for simple shadow. 750 p->fillRect(normalizedRect.translated(shadow->offset()), shadow->m_color); 751 } else { 731 752 QPainter* shadowPainter = shadow->beginShadowLayer(p, normalizedRect); 732 753 if (shadowPainter) { … … 735 756 shadow->endShadowLayer(p); 736 757 } 737 } else 738 p->fillRect(normalizedRect.translated(shadow->offset()), shadow->m_color); 758 } 739 759 } 740 760 … … 752 772 if (m_data->hasShadow()) { 753 773 ContextShadow* shadow = contextShadow(); 754 if (mustUseContextShadow(p, shadow)) { 774 775 if (shadow->m_type != ContextShadow::BlurShadow) { 776 // We do not need any layer for simple shadow. 777 p->translate(m_data->shadow.offset()); 778 p->fillPath(path.platformPath(), QColor(m_data->shadow.m_color)); 779 p->translate(-m_data->shadow.offset()); 780 } else { 755 781 QPainter* shadowPainter = shadow->beginShadowLayer(p, rect); 756 782 if (shadowPainter) { … … 759 785 shadow->endShadowLayer(p); 760 786 } 761 } else {762 p->translate(m_data->shadow.offset());763 p->fillPath(path.platformPath(), QColor(m_data->shadow.m_color));764 p->translate(-m_data->shadow.offset());765 787 } 766 788 } … … 950 972 m_state.shadowOffset = FloatSize(size.width(), -size.height()); 951 973 m_data->shadow = ContextShadow(color, blur, FloatSize(size.width(), -size.height())); 952 } else 974 } else { 953 975 m_data->shadow = ContextShadow(color, blur, FloatSize(size.width(), size.height())); 954 955 m_data->shadow.setShadowsIgnoreTransforms(m_state.shadowsIgnoreTransforms); 976 } 956 977 } 957 978
Note: See TracChangeset
for help on using the changeset viewer.