Changeset 73889 in webkit
- Timestamp:
- Dec 13, 2010 12:56:31 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r73886 r73889 1 2010-12-13 Helder Correia <helder@sencha.com> 2 3 Reviewed by Eric Seidel. 4 5 [Qt] StillImage::draw() should use ContextShadow 6 https://bugs.webkit.org/show_bug.cgi?id=50849 7 8 The branch that checks for a shadow requirement in StillImage::draw() 9 is executed when drawing a canvas onto a canvas with 10 ctx1.drawImage(canvas2, x, y). The current implementation supports 11 solid shadows only. And if transformations are present, the offset gets 12 transformed as well. Thus, ContextShadow must be used instead in order 13 to support blur and correct offset transformations. 14 15 * fast/canvas/canvas-draw-canvas-on-canvas-shadow-expected.txt: Added. 16 * fast/canvas/canvas-draw-canvas-on-canvas-shadow.html: Added. 17 * fast/canvas/script-tests/canvas-draw-canvas-on-canvas-shadow.js: Added. 18 1 19 2010-10-28 MORITA Hajime <morrita@google.com> 2 20 -
trunk/WebCore/ChangeLog
r73888 r73889 1 2010-12-13 Helder Correia <helder@sencha.com> 2 3 Reviewed by Eric Seidel. 4 5 [Qt] StillImage::draw() should use ContextShadow 6 https://bugs.webkit.org/show_bug.cgi?id=50849 7 8 The branch that checks for a shadow requirement in StillImage::draw() 9 is executed when drawing a canvas onto a canvas with 10 ctx1.drawImage(canvas2, x, y). The current implementation supports 11 solid shadows only. And if transformations are present, the offset gets 12 transformed as well. Thus, ContextShadow must be used instead in order 13 to support blur and correct offset transformations. 14 15 Test: fast/canvas/canvas-draw-canvas-on-canvas-shadow.html 16 17 * platform/graphics/qt/StillImageQt.cpp: 18 (WebCore::StillImage::draw): 19 1 20 2010-12-12 Jon Honeycutt <jhoneycutt@apple.com> 2 21 -
trunk/WebCore/platform/graphics/qt/StillImageQt.cpp
r66082 r73889 29 29 #include "StillImageQt.h" 30 30 31 #include "ContextShadow.h" 31 32 #include "GraphicsContext.h" 32 33 #include "IntSize.h" … … 68 69 return; 69 70 70 71 71 FloatRect normalizedSrc = src.normalized(); 72 72 FloatRect normalizedDst = dst.normalized(); … … 77 77 ctxt->setCompositeOperation(op); 78 78 79 FloatSize shadowOffset; 80 float shadowBlur; 81 Color shadowColor; 82 if (ctxt->getShadow(shadowOffset, shadowBlur, shadowColor)) { 83 FloatRect shadowImageRect(normalizedDst); 84 shadowImageRect.move(shadowOffset.width(), shadowOffset.height()); 85 86 QImage shadowImage(QSize(static_cast<int>(normalizedSrc.width()), static_cast<int>(normalizedSrc.height())), QImage::Format_ARGB32_Premultiplied); 87 QPainter p(&shadowImage); 88 p.setCompositionMode(QPainter::CompositionMode_Source); 89 p.fillRect(shadowImage.rect(), shadowColor); 90 p.setCompositionMode(QPainter::CompositionMode_DestinationIn); 91 p.drawPixmap(QRect(0, 0, normalizedDst.width(), normalizedDst.height()), *m_pixmap, normalizedSrc); 92 p.end(); 93 painter->drawImage(shadowImageRect, shadowImage, normalizedSrc); 79 ContextShadow* shadow = ctxt->contextShadow(); 80 if (shadow->m_type != ContextShadow::NoShadow) { 81 QPainter* shadowPainter = shadow->beginShadowLayer(painter, normalizedDst); 82 if (shadowPainter) { 83 shadowPainter->setOpacity(static_cast<qreal>(shadow->m_color.alpha()) / 255); 84 shadowPainter->drawPixmap(normalizedDst, *m_pixmap, normalizedSrc); 85 shadow->endShadowLayer(painter); 86 } 94 87 } 95 88
Note: See TracChangeset
for help on using the changeset viewer.