WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-100026-20121030103852.patch (text/plain), 24.89 KB, created by
arno.
on 2012-10-30 10:40:28 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
arno.
Created:
2012-10-30 10:40:28 PDT
Size:
24.89 KB
patch
obsolete
>Subversion Revision: 132106 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index cded2354b6162024f04b5bc1a0c8f39064273838..0323084195d3483aabbff293f95713cc7e2af40d 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,53 @@ >+2012-10-30 Arnaud Renevier <a.renevier@sisa.samsung.com> >+ >+ inconsistency in drawImage with target rect negative dimensions. >+ https://bugs.webkit.org/show_bug.cgi?id=100026 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Remove -1, -1 special case in drawImage and drawImageBuffer. Replace >+ all -1 -1 arguments calls to with the correct rectangle dimensions. >+ >+ Remove FloatRect(0, 0, -1, -1) default argument for srcRect, and >+ instead, add new overloaded functions to create a FloatRect from image >+ size. >+ >+ Replace -1 -1 arguments calls in FEComposite::platformApplySoftware >+ with correct rectangle dimensions. >+ >+ Replace ImageGStreamer rect method (which may return -1 -1 rectangle) >+ with cropRect method, and make caller check for rectangle emptiness. >+ >+ Replace image pointer check by an assertion in GraphicsContext >+ drawImage and drawImageBuffer methods. Add check to callers to avoid >+ calling those methods with null images. >+ >+ * fast/canvas/drawImage-with-negative-source-destination-expected.txt: >+ * fast/canvas/drawImage-with-negative-source-destination.js: >+ >+ * html/canvas/CanvasRenderingContext2D.cpp: >+ (WebCore::CanvasRenderingContext2D::fullCanvasCompositedDrawImage): >+ * platform/graphics/GraphicsContext.cpp: >+ (WebCore::GraphicsContext::drawImage): >+ (WebCore): >+ (WebCore::GraphicsContext::drawTiledImage): >+ (WebCore::GraphicsContext::drawImageBuffer): >+ * platform/graphics/GraphicsContext.h: >+ (GraphicsContext): >+ * platform/graphics/filters/FEComposite.cpp: >+ (WebCore::FEComposite::platformApplySoftware): >+ * platform/graphics/gstreamer/ImageGStreamer.h: >+ (WebCore::ImageGStreamer::rect): >+ * platform/graphics/qt/ImageBufferQt.cpp: >+ (WebCore::ImageBuffer::draw): >+ * platform/graphics/texmap/TextureMapperImageBuffer.cpp: >+ (WebCore::BitmapTextureImageBuffer::updateContents): >+ (WebCore::TextureMapperImageBuffer::drawTexture): >+ * rendering/RenderBoxModelObject.cpp: >+ (WebCore::RenderBoxModelObject::paintNinePieceImage): >+ * rendering/RenderListMarker.cpp: >+ (WebCore::RenderListMarker::paint): >+ > 2012-10-29 Arnaud Renevier <a.renevier@sisa.samsung.com> > > webview not redrawn as needed when accelerated compositing is enabled. >diff --git a/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp b/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp >index ef754f59704aa9cc773d1bf57ef0ad3a1aefca2b..248bd7fc7661375c2282ec859196ee75306538ea 100644 >--- a/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp >+++ b/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp >@@ -1660,6 +1660,9 @@ template<class T> void CanvasRenderingContext2D::fullCanvasCompositedDrawImage( > { > ASSERT(isFullCanvasCompositeMode(op)); > >+ if (!image) >+ return; >+ > IntSize croppedOffset; > IntRect bufferRect = calculateCompositingBufferRect(dest, &croppedOffset); > if (bufferRect.isEmpty()) { >diff --git a/Source/WebCore/platform/graphics/GraphicsContext.cpp b/Source/WebCore/platform/graphics/GraphicsContext.cpp >index 2ca0e65f63512ef55e9ca2ef8e2ed951fdb91296..ef8aa610b7fdef19183f6d181bbf10f17adbae83 100644 >--- a/Source/WebCore/platform/graphics/GraphicsContext.cpp >+++ b/Source/WebCore/platform/graphics/GraphicsContext.cpp >@@ -439,12 +439,14 @@ void GraphicsContext::drawHighlightForText(const Font& font, const TextRun& run, > > void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const IntPoint& p, CompositeOperator op, RespectImageOrientationEnum shouldRespectImageOrientation) > { >- drawImage(image, styleColorSpace, p, IntRect(0, 0, -1, -1), op, shouldRespectImageOrientation); >+ ASSERT(image); >+ drawImage(image, styleColorSpace, p, IntRect(IntPoint(), image->size()), op, shouldRespectImageOrientation); > } > > void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const IntRect& r, CompositeOperator op, RespectImageOrientationEnum shouldRespectImageOrientation, bool useLowQualityScale) > { >- drawImage(image, styleColorSpace, r, IntRect(0, 0, -1, -1), op, shouldRespectImageOrientation, useLowQualityScale); >+ ASSERT(image); >+ drawImage(image, styleColorSpace, r, IntRect(IntPoint(), image->size()), op, shouldRespectImageOrientation, useLowQualityScale); > } > > void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const IntPoint& dest, const IntRect& srcRect, CompositeOperator op, RespectImageOrientationEnum shouldRespectImageOrientation) >@@ -457,26 +459,18 @@ void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const > drawImage(image, styleColorSpace, FloatRect(dest), srcRect, op, shouldRespectImageOrientation, useLowQualityScale); > } > >+void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const FloatRect& dest) >+{ >+ ASSERT(image); >+ drawImage(image, styleColorSpace, dest, FloatRect(IntRect(IntPoint(), image->size()))); >+} >+ > void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const FloatRect& dest, const FloatRect& src, CompositeOperator op, RespectImageOrientationEnum shouldRespectImageOrientation, bool useLowQualityScale) > { >- if (paintingDisabled() || !image) >+ ASSERT(image); >+ if (paintingDisabled()) > return; > >- float tsw = src.width(); >- float tsh = src.height(); >- float tw = dest.width(); >- float th = dest.height(); >- >- if (tsw == -1) >- tsw = image->width(); >- if (tsh == -1) >- tsh = image->height(); >- >- if (tw == -1) >- tw = image->width(); >- if (th == -1) >- th = image->height(); >- > InterpolationQuality previousInterpolationQuality = InterpolationDefault; > > if (useLowQualityScale) { >@@ -489,7 +483,7 @@ void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const > #endif > } > >- image->draw(this, FloatRect(dest.location(), FloatSize(tw, th)), FloatRect(src.location(), FloatSize(tsw, tsh)), styleColorSpace, op, shouldRespectImageOrientation); >+ image->draw(this, dest, src, styleColorSpace, op, shouldRespectImageOrientation); > > if (useLowQualityScale) > setImageInterpolationQuality(previousInterpolationQuality); >@@ -497,7 +491,8 @@ void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const > > void GraphicsContext::drawTiledImage(Image* image, ColorSpace styleColorSpace, const IntRect& destRect, const IntPoint& srcPoint, const IntSize& tileSize, CompositeOperator op, bool useLowQualityScale) > { >- if (paintingDisabled() || !image) >+ ASSERT(image); >+ if (paintingDisabled()) > return; > > if (useLowQualityScale) { >@@ -532,12 +527,14 @@ void GraphicsContext::drawTiledImage(Image* image, ColorSpace styleColorSpace, c > > void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace styleColorSpace, const IntPoint& p, CompositeOperator op) > { >- drawImageBuffer(image, styleColorSpace, p, IntRect(0, 0, -1, -1), op); >+ ASSERT(image); >+ drawImageBuffer(image, styleColorSpace, p, IntRect(IntPoint(), image->logicalSize()), op); > } > > void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace styleColorSpace, const IntRect& r, CompositeOperator op, bool useLowQualityScale) > { >- drawImageBuffer(image, styleColorSpace, r, IntRect(0, 0, -1, -1), op, useLowQualityScale); >+ ASSERT(image); >+ drawImageBuffer(image, styleColorSpace, r, IntRect(IntPoint(), image->logicalSize()), op, useLowQualityScale); > } > > void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace styleColorSpace, const IntPoint& dest, const IntRect& srcRect, CompositeOperator op) >@@ -550,25 +547,18 @@ void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace styleColorS > drawImageBuffer(image, styleColorSpace, FloatRect(dest), srcRect, op, useLowQualityScale); > } > >-void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace styleColorSpace, const FloatRect& dest, const FloatRect& src, CompositeOperator op, bool useLowQualityScale) >+void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace styleColorSpace, const FloatRect& dest) > { >- if (paintingDisabled() || !image) >- return; >- >- float tsw = src.width(); >- float tsh = src.height(); >- float tw = dest.width(); >- float th = dest.height(); >+ ASSERT(image); >+ drawImageBuffer(image, styleColorSpace, dest, FloatRect(IntRect(IntPoint(), image->logicalSize()))); >+} > >- if (tsw == -1) >- tsw = image->logicalSize().width(); >- if (tsh == -1) >- tsh = image->logicalSize().height(); >+void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace styleColorSpace, const FloatRect& dest, const FloatRect& src, CompositeOperator op, bool useLowQualityScale) >+{ >+ ASSERT(image); > >- if (tw == -1) >- tw = image->logicalSize().width(); >- if (th == -1) >- th = image->logicalSize().height(); >+ if (paintingDisabled()) >+ return; > > if (useLowQualityScale) { > InterpolationQuality previousInterpolationQuality = imageInterpolationQuality(); >@@ -578,10 +568,10 @@ void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace styleColorS > // FIXME (49002): Should be InterpolationLow > setImageInterpolationQuality(InterpolationNone); > #endif >- image->draw(this, styleColorSpace, FloatRect(dest.location(), FloatSize(tw, th)), FloatRect(src.location(), FloatSize(tsw, tsh)), op, useLowQualityScale); >+ image->draw(this, styleColorSpace, dest, src, op, useLowQualityScale); > setImageInterpolationQuality(previousInterpolationQuality); > } else >- image->draw(this, styleColorSpace, FloatRect(dest.location(), FloatSize(tw, th)), FloatRect(src.location(), FloatSize(tsw, tsh)), op, useLowQualityScale); >+ image->draw(this, styleColorSpace, dest, src, op, useLowQualityScale); > } > > #if !PLATFORM(QT) >diff --git a/Source/WebCore/platform/graphics/GraphicsContext.h b/Source/WebCore/platform/graphics/GraphicsContext.h >index fe65f8860b480a146bfaa585f2216327115e27e0..3a147b44bdd5fe19ec9f0348a143e50a549b1375 100644 >--- a/Source/WebCore/platform/graphics/GraphicsContext.h >+++ b/Source/WebCore/platform/graphics/GraphicsContext.h >@@ -313,8 +313,8 @@ namespace WebCore { > void drawImage(Image*, ColorSpace styleColorSpace, const IntRect&, CompositeOperator = CompositeSourceOver, RespectImageOrientationEnum = DoNotRespectImageOrientation, bool useLowQualityScale = false); > void drawImage(Image*, ColorSpace styleColorSpace, const IntPoint& destPoint, const IntRect& srcRect, CompositeOperator = CompositeSourceOver, RespectImageOrientationEnum = DoNotRespectImageOrientation); > void drawImage(Image*, ColorSpace styleColorSpace, const IntRect& destRect, const IntRect& srcRect, CompositeOperator = CompositeSourceOver, RespectImageOrientationEnum = DoNotRespectImageOrientation, bool useLowQualityScale = false); >- void drawImage(Image*, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect = FloatRect(0, 0, -1, -1), >- CompositeOperator = CompositeSourceOver, RespectImageOrientationEnum = DoNotRespectImageOrientation, bool useLowQualityScale = false); >+ void drawImage(Image*, ColorSpace styleColorSpace, const FloatRect& destRect); >+ void drawImage(Image*, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator = CompositeSourceOver, RespectImageOrientationEnum = DoNotRespectImageOrientation, bool useLowQualityScale = false); > void drawTiledImage(Image*, ColorSpace styleColorSpace, const IntRect& destRect, const IntPoint& srcPoint, const IntSize& tileSize, > CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false); > void drawTiledImage(Image*, ColorSpace styleColorSpace, const IntRect& destRect, const IntRect& srcRect, >@@ -325,8 +325,8 @@ namespace WebCore { > void drawImageBuffer(ImageBuffer*, ColorSpace styleColorSpace, const IntRect&, CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false); > void drawImageBuffer(ImageBuffer*, ColorSpace styleColorSpace, const IntPoint& destPoint, const IntRect& srcRect, CompositeOperator = CompositeSourceOver); > void drawImageBuffer(ImageBuffer*, ColorSpace styleColorSpace, const IntRect& destRect, const IntRect& srcRect, CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false); >- void drawImageBuffer(ImageBuffer*, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect = FloatRect(0, 0, -1, -1), >- CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false); >+ void drawImageBuffer(ImageBuffer*, ColorSpace styleColorSpace, const FloatRect& destRect); >+ void drawImageBuffer(ImageBuffer*, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false); > > void setImageInterpolationQuality(InterpolationQuality); > InterpolationQuality imageInterpolationQuality() const; >diff --git a/Source/WebCore/platform/graphics/filters/FEComposite.cpp b/Source/WebCore/platform/graphics/filters/FEComposite.cpp >index 9d566ed923d95ad3443171a730a90cde39cacf28..c1f6443897b0913d77b573cf232bdc660eacd9f6 100644 >--- a/Source/WebCore/platform/graphics/filters/FEComposite.cpp >+++ b/Source/WebCore/platform/graphics/filters/FEComposite.cpp >@@ -274,11 +274,15 @@ void FEComposite::platformApplySoftware() > return; > GraphicsContext* filterContext = resultImage->context(); > >- FloatRect srcRect = FloatRect(0, 0, -1, -1); >+ ImageBuffer* imgBuffer = in->asImageBuffer(); >+ ImageBuffer* imgBuffer2 = in2->asImageBuffer(); >+ ASSERT(imgBuffer); >+ ASSERT(imgBuffer2); >+ > switch (m_type) { > case FECOMPOSITE_OPERATOR_OVER: >- filterContext->drawImageBuffer(in2->asImageBuffer(), ColorSpaceDeviceRGB, drawingRegionOfInputImage(in2->absolutePaintRect())); >- filterContext->drawImageBuffer(in->asImageBuffer(), ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect())); >+ filterContext->drawImageBuffer(imgBuffer2, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in2->absolutePaintRect())); >+ filterContext->drawImageBuffer(imgBuffer, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect())); > break; > case FECOMPOSITE_OPERATOR_IN: { > // Applies only to the intersected region. >@@ -292,21 +296,21 @@ void FEComposite::platformApplySoftware() > destinationRect.y() - in->absolutePaintRect().y()), destinationRect.size()); > IntRect source2Rect(IntPoint(destinationRect.x() - in2->absolutePaintRect().x(), > destinationRect.y() - in2->absolutePaintRect().y()), destinationRect.size()); >- filterContext->drawImageBuffer(in2->asImageBuffer(), ColorSpaceDeviceRGB, destinationPoint, source2Rect); >- filterContext->drawImageBuffer(in->asImageBuffer(), ColorSpaceDeviceRGB, destinationPoint, sourceRect, CompositeSourceIn); >+ filterContext->drawImageBuffer(imgBuffer2, ColorSpaceDeviceRGB, destinationPoint, source2Rect); >+ filterContext->drawImageBuffer(imgBuffer, ColorSpaceDeviceRGB, destinationPoint, sourceRect, CompositeSourceIn); > break; > } > case FECOMPOSITE_OPERATOR_OUT: >- filterContext->drawImageBuffer(in->asImageBuffer(), ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect())); >- filterContext->drawImageBuffer(in2->asImageBuffer(), ColorSpaceDeviceRGB, drawingRegionOfInputImage(in2->absolutePaintRect()), srcRect, CompositeDestinationOut); >+ filterContext->drawImageBuffer(imgBuffer, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect())); >+ filterContext->drawImageBuffer(imgBuffer2, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in2->absolutePaintRect()), IntRect(IntPoint(), imgBuffer2->logicalSize()), CompositeDestinationOut); > break; > case FECOMPOSITE_OPERATOR_ATOP: >- filterContext->drawImageBuffer(in2->asImageBuffer(), ColorSpaceDeviceRGB, drawingRegionOfInputImage(in2->absolutePaintRect())); >- filterContext->drawImageBuffer(in->asImageBuffer(), ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect()), srcRect, CompositeSourceAtop); >+ filterContext->drawImageBuffer(imgBuffer2, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in2->absolutePaintRect())); >+ filterContext->drawImageBuffer(imgBuffer, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect()), IntRect(IntPoint(), imgBuffer->logicalSize()), CompositeSourceAtop); > break; > case FECOMPOSITE_OPERATOR_XOR: >- filterContext->drawImageBuffer(in2->asImageBuffer(), ColorSpaceDeviceRGB, drawingRegionOfInputImage(in2->absolutePaintRect())); >- filterContext->drawImageBuffer(in->asImageBuffer(), ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect()), srcRect, CompositeXOR); >+ filterContext->drawImageBuffer(imgBuffer2, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in2->absolutePaintRect())); >+ filterContext->drawImageBuffer(imgBuffer, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect()), IntRect(IntPoint(), imgBuffer->logicalSize()), CompositeXOR); > break; > default: > break; >diff --git a/Source/WebCore/platform/graphics/gstreamer/ImageGStreamer.h b/Source/WebCore/platform/graphics/gstreamer/ImageGStreamer.h >index 83bdfe2b72268b028e73fd84d73dc2b40b090f43..68f8fa1b59ffb61fe74589bc76ca577487dd7386 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/ImageGStreamer.h >+++ b/Source/WebCore/platform/graphics/gstreamer/ImageGStreamer.h >@@ -51,9 +51,8 @@ class ImageGStreamer : public RefCounted<ImageGStreamer> { > { > if (!m_cropRect.isEmpty()) > return FloatRect(m_cropRect); >- >- // Default rectangle used by GraphicsContext::drawImage(). >- return FloatRect(0, 0, -1, -1); >+ ASSERT(m_image); >+ return FloatRect(0, 0, m_image->size().width(), m_image->size().height()); > } > > private: >diff --git a/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp b/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp >index ac27dc25afc68faf9d1946607e1b8d6da297f6a1..4182d4a9ae4e5d177bb511e98b4167385b3e5c23 100644 >--- a/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp >+++ b/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp >@@ -132,7 +132,7 @@ void ImageBuffer::draw(GraphicsContext* destContext, ColorSpace styleColorSpace, > // We're drawing into our own buffer. In order for this to work, we need to copy the source buffer first. > RefPtr<Image> copy = copyImage(CopyBackingStore); > destContext->drawImage(copy.get(), ColorSpaceDeviceRGB, destRect, srcRect, op, DoNotRespectImageOrientation, useLowQualityScale); >- } else >+ } else if (m_data.m_image.get()) > destContext->drawImage(m_data.m_image.get(), styleColorSpace, destRect, srcRect, op, DoNotRespectImageOrientation, useLowQualityScale); > } > >diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.cpp b/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.cpp >index 84343325314e110cbd7379ab020257a73995a861..b1a0e85341a570268f8614a1b387b07610d8c421 100644 >--- a/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.cpp >+++ b/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.cpp >@@ -61,6 +61,8 @@ void BitmapTextureImageBuffer::didReset() > > void BitmapTextureImageBuffer::updateContents(Image* image, const IntRect& targetRect, const IntPoint& offset, UpdateContentsFlag) > { >+ if (!image) >+ return; > m_image->context()->drawImage(image, ColorSpaceDeviceRGB, targetRect, IntRect(offset, targetRect.size()), CompositeCopy); > } > >@@ -110,7 +112,8 @@ void TextureMapperImageBuffer::drawTexture(const BitmapTexture& texture, const F > maskContext->setAlpha(opacity); > opacity = 1; > } >- maskContext->drawImageBuffer(mask->m_image.get(), ColorSpaceDeviceRGB, IntPoint::zero(), CompositeDestinationIn); >+ if (mask->m_image.get()) >+ maskContext->drawImageBuffer(mask->m_image.get(), ColorSpaceDeviceRGB, IntPoint::zero(), CompositeDestinationIn); > image = maskedImage.get(); > } > >diff --git a/Source/WebCore/rendering/RenderBoxModelObject.cpp b/Source/WebCore/rendering/RenderBoxModelObject.cpp >index fd6390ae35800ea6aaa849b152f937773663cee9..f6822f8e4fedac3e1708ce9eaef467a8c59cddc2 100644 >--- a/Source/WebCore/rendering/RenderBoxModelObject.cpp >+++ b/Source/WebCore/rendering/RenderBoxModelObject.cpp >@@ -1297,6 +1297,8 @@ bool RenderBoxModelObject::paintNinePieceImage(GraphicsContext* graphicsContext, > && (imageHeight - topSlice - bottomSlice) > 0 && (borderImageRect.height() - topWidth - bottomWidth) > 0; > > RefPtr<Image> image = styleImage->image(this, imageSize); >+ if (!image) >+ return false; > ColorSpace colorSpace = style->colorSpace(); > > float destinationWidth = borderImageRect.width() - leftWidth - rightWidth; >diff --git a/Source/WebCore/rendering/RenderListMarker.cpp b/Source/WebCore/rendering/RenderListMarker.cpp >index b7cbaa03893202c08d0b2363e335ce950812f7bc..ba8ad4eaf07b7eb5ca45095c1d20d5b375497415 100644 >--- a/Source/WebCore/rendering/RenderListMarker.cpp >+++ b/Source/WebCore/rendering/RenderListMarker.cpp >@@ -1130,7 +1130,9 @@ void RenderListMarker::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffse > if (style()->highlight() != nullAtom && !paintInfo.context->paintingDisabled()) > paintCustomHighlight(paintOffset, style()->highlight(), true); > #endif >- context->drawImage(m_image->image(this, marker.size()).get(), style()->colorSpace(), marker); >+ RefPtr<Image> image = m_image->image(this, marker.size()); >+ if (image) >+ context->drawImage(image.get(), style()->colorSpace(), marker); > if (selectionState() != SelectionNone) { > LayoutRect selRect = localSelectionRect(); > selRect.moveBy(boxOrigin); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 8c97b161b2fa7fd7a3355418aa9e824638c07783..b923764b2610882a2ba4c8f454ed1d488231575b 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,17 @@ >+2012-10-29 Arnaud Renevier <a.renevier@sisa.samsung.com> >+ >+ inconsistency in drawImage with target rect negative dimensions. >+ https://bugs.webkit.org/show_bug.cgi?id=100026 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add a drawImage check for a destination rectangle with -1px >+ width/height. When drawing to (1, 1, -1, -1) rectangle, first >+ (top-left) pixel should have been and been the only one drawn into. >+ >+ * fast/canvas/drawImage-with-negative-source-destination-expected.txt: >+ * fast/canvas/drawImage-with-negative-source-destination.js: >+ > 2012-10-22 Emil A Eklund <eae@chromium.org> > > Unreviewed gardening, marking fast/sub-pixel/file-upload-control-at-fractional-offset.html as failing on LION for now. >diff --git a/LayoutTests/fast/canvas/drawImage-with-negative-source-destination-expected.txt b/LayoutTests/fast/canvas/drawImage-with-negative-source-destination-expected.txt >index 738568b0ce1222ef84a48dcff04070ebf25b80a5..f41ac923705b79cb4385a63f1706d22814814089 100644 >--- a/LayoutTests/fast/canvas/drawImage-with-negative-source-destination-expected.txt >+++ b/LayoutTests/fast/canvas/drawImage-with-negative-source-destination-expected.txt >@@ -6,6 +6,12 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE > PASS imgdata[4] is 0 > PASS imgdata[5] is 255 > PASS imgdata[6] is 0 >+PASS imgdata[0] is 255 >+PASS imgdata[1] is 0 >+PASS imgdata[2] is 0 >+PASS imgdata[4] is 0 >+PASS imgdata[5] is 0 >+PASS imgdata[6] is 0 > PASS successfullyParsed is true > > TEST COMPLETE >diff --git a/LayoutTests/fast/canvas/drawImage-with-negative-source-destination.js b/LayoutTests/fast/canvas/drawImage-with-negative-source-destination.js >index 0a8a09c1523582cbc15b1d6ad553607ad42bfadd..671fd73b6c5606d1de74d5707d700c90664ada03 100644 >--- a/LayoutTests/fast/canvas/drawImage-with-negative-source-destination.js >+++ b/LayoutTests/fast/canvas/drawImage-with-negative-source-destination.js >@@ -19,3 +19,16 @@ var imgdata = imageData.data; > shouldBe("imgdata[4]", "0"); > shouldBe("imgdata[5]", "255"); > shouldBe("imgdata[6]", "0"); >+ >+// test width or height -1 >+canvas.fillStyle = '#000'; >+canvas.fillRect(0, 0, 1, 2); >+canvas.drawImage(canvas2, 0, 0, 1, 1, 1, 1, -1, -1); >+var imageData = canvas.getImageData(0, 0, 1, 2); >+var imgdata = imageData.data; >+shouldBe("imgdata[0]", "255"); >+shouldBe("imgdata[1]", "0"); >+shouldBe("imgdata[2]", "0"); >+shouldBe("imgdata[4]", "0"); >+shouldBe("imgdata[5]", "0"); >+shouldBe("imgdata[6]", "0");
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
buildbot
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 100026
:
169978
|
170489
|
171001
|
171309
|
171482
|
171558
|
173412
|
174523
|
178893
|
179544
|
179563
|
182865