Title: [193886] branches/safari-601.1.46-branch/Source/WebCore
Revision
193886
Author
simon.fra...@apple.com
Date
2015-12-09 19:16:43 -0800 (Wed, 09 Dec 2015)

Log Message

Merge r190910. rdar://problem/23432368

Modified Paths

Diff

Modified: branches/safari-601.1.46-branch/Source/WebCore/ChangeLog (193885 => 193886)


--- branches/safari-601.1.46-branch/Source/WebCore/ChangeLog	2015-12-10 02:53:12 UTC (rev 193885)
+++ branches/safari-601.1.46-branch/Source/WebCore/ChangeLog	2015-12-10 03:16:43 UTC (rev 193886)
@@ -1,3 +1,56 @@
+2015-12-09  Simon Fraser  <simon.fra...@apple.com>
+
+        Merge r190910. rdar://problem/23432368
+
+    2015-10-12  Simon Fraser  <simon.fra...@apple.com>
+
+            Remove Image::spaceSize() and ImageBuffer::spaceSize()
+            https://bugs.webkit.org/show_bug.cgi?id=150064
+
+            Reviewed by Tim Horton.
+
+            Image spacing when tiled should not be a property of the image; but a description
+            of how it's drawn, like tile size. So remove spacing from Image and ImageBuffer,
+            and pass it in as an argument.
+
+            * platform/graphics/BitmapImage.cpp:
+            (WebCore::BitmapImage::drawPattern):
+            * platform/graphics/BitmapImage.h:
+            * platform/graphics/CrossfadeGeneratedImage.cpp:
+            (WebCore::CrossfadeGeneratedImage::drawPattern):
+            * platform/graphics/CrossfadeGeneratedImage.h:
+            * platform/graphics/GeneratedImage.h:
+            * platform/graphics/GradientImage.cpp:
+            (WebCore::GradientImage::drawPattern):
+            * platform/graphics/GradientImage.h:
+            * platform/graphics/GraphicsContext.cpp:
+            (WebCore::GraphicsContext::drawTiledImage):
+            * platform/graphics/GraphicsContext.h:
+            * platform/graphics/Image.cpp:
+            (WebCore::Image::drawTiled):
+            * platform/graphics/Image.h:
+            (WebCore::Image::spaceSize): Deleted.
+            (WebCore::Image::setSpaceSize): Deleted.
+            * platform/graphics/ImageBuffer.h:
+            (WebCore::ImageBuffer::spaceSize): Deleted.
+            (WebCore::ImageBuffer::setSpaceSize): Deleted.
+            * platform/graphics/NamedImageGeneratedImage.cpp:
+            (WebCore::NamedImageGeneratedImage::drawPattern):
+            * platform/graphics/NamedImageGeneratedImage.h:
+            * platform/graphics/cg/ImageBufferCG.cpp:
+            (WebCore::ImageBuffer::copyImage):
+            (WebCore::ImageBuffer::drawPattern):
+            * platform/graphics/cg/ImageCG.cpp:
+            (WebCore::Image::drawPattern):
+            * rendering/RenderBoxModelObject.cpp:
+            (WebCore::RenderBoxModelObject::paintFillLayerExtended):
+            * svg/graphics/SVGImage.cpp:
+            (WebCore::SVGImage::drawPatternForContainer):
+            * svg/graphics/SVGImage.h:
+            * svg/graphics/SVGImageForContainer.cpp:
+            (WebCore::SVGImageForContainer::drawPattern):
+            * svg/graphics/SVGImageForContainer.h:
+
 2015-12-09  Matthew Hanson  <matthew_han...@apple.com>
 
         Merge r192639. rdar://problem/23814338

Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/BitmapImage.cpp (193885 => 193886)


--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/BitmapImage.cpp	2015-12-10 02:53:12 UTC (rev 193885)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/BitmapImage.cpp	2015-12-10 03:16:43 UTC (rev 193886)
@@ -606,13 +606,13 @@
 }
 
 void BitmapImage::drawPattern(GraphicsContext* ctxt, const FloatRect& tileRect, const AffineTransform& transform,
-    const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect, BlendMode blendMode)
+    const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect, BlendMode blendMode)
 {
     if (tileRect.isEmpty())
         return;
 
     if (!ctxt->drawLuminanceMask()) {
-        Image::drawPattern(ctxt, tileRect, transform, phase, styleColorSpace, op, destRect, blendMode);
+        Image::drawPattern(ctxt, tileRect, transform, phase, spacing, styleColorSpace, op, destRect, blendMode);
         return;
     }
     if (!m_cachedImage) {
@@ -634,12 +634,10 @@
         m_cachedImage = buffer->copyImage(DontCopyBackingStore, Unscaled);
         if (!m_cachedImage)
             return;
-
-        m_cachedImage->setSpaceSize(spaceSize());
     }
 
     ctxt->setDrawLuminanceMask(false);
-    m_cachedImage->drawPattern(ctxt, tileRect, transform, phase, styleColorSpace, op, destRect, blendMode);
+    m_cachedImage->drawPattern(ctxt, tileRect, transform, phase, spacing, styleColorSpace, op, destRect, blendMode);
 }
 
 

Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/BitmapImage.h (193885 => 193886)


--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/BitmapImage.h	2015-12-10 02:53:12 UTC (rev 193885)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/BitmapImage.h	2015-12-10 03:16:43 UTC (rev 193886)
@@ -142,8 +142,8 @@
     virtual void stopAnimation() override;
     virtual void resetAnimation() override;
 
-    virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform,
-        const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode = BlendModeNormal) override;
+     virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform,
+         const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode = BlendModeNormal) override;
 
     // Accessors for native image formats.
 
@@ -207,7 +207,7 @@
 
 #if USE(WINGDI)
     virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform,
-        const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect);
+        const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect);
 #endif
 
     size_t currentFrame() const { return m_currentFrame; }

Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/CrossfadeGeneratedImage.cpp (193885 => 193886)


--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/CrossfadeGeneratedImage.cpp	2015-12-10 02:53:12 UTC (rev 193885)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/CrossfadeGeneratedImage.cpp	2015-12-10 03:16:43 UTC (rev 193886)
@@ -95,7 +95,7 @@
     drawCrossfade(context);
 }
 
-void CrossfadeGeneratedImage::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode blendMode)
+void CrossfadeGeneratedImage::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode blendMode)
 {
     std::unique_ptr<ImageBuffer> imageBuffer = ImageBuffer::create(size(), 1, ColorSpaceDeviceRGB, context->isAcceleratedContext() ? Accelerated : Unaccelerated);
     if (!imageBuffer)
@@ -106,7 +106,7 @@
     drawCrossfade(graphicsContext);
 
     // Tile the image buffer into the context.
-    imageBuffer->drawPattern(context, srcRect, patternTransform, phase, styleColorSpace, compositeOp, dstRect, blendMode);
+    imageBuffer->drawPattern(context, srcRect, patternTransform, phase, spacing, styleColorSpace, compositeOp, dstRect, blendMode);
 }
 
 }

Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/CrossfadeGeneratedImage.h (193885 => 193886)


--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/CrossfadeGeneratedImage.h	2015-12-10 02:53:12 UTC (rev 193885)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/CrossfadeGeneratedImage.h	2015-12-10 03:16:43 UTC (rev 193886)
@@ -50,7 +50,7 @@
 
 protected:
     virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) override;
-    virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& dstRect, BlendMode) override;
+    virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& dstRect, BlendMode) override;
 
     CrossfadeGeneratedImage(Image* fromImage, Image* toImage, float percentage, const FloatSize& crossfadeSize, const FloatSize&);
 

Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/GeneratedImage.h (193885 => 193886)


--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/GeneratedImage.h	2015-12-10 02:53:12 UTC (rev 193885)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/GeneratedImage.h	2015-12-10 03:16:43 UTC (rev 193886)
@@ -51,7 +51,7 @@
 protected:
     virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) override = 0;
     virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform,
-        const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode) override = 0;
+        const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode) override = 0;
 
     // FIXME: Implement this to be less conservative.
     virtual bool currentFrameKnownToBeOpaque() override { return false; }

Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/GradientImage.cpp (193885 => 193886)


--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/GradientImage.cpp	2015-12-10 02:53:12 UTC (rev 193885)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/GradientImage.cpp	2015-12-10 03:16:43 UTC (rev 193886)
@@ -56,7 +56,7 @@
 }
 
 void GradientImage::drawPattern(GraphicsContext* destContext, const FloatRect& srcRect, const AffineTransform& patternTransform,
-    const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator compositeOp, const FloatRect& destRect, BlendMode blendMode)
+    const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator compositeOp, const FloatRect& destRect, BlendMode blendMode)
 {
     // Allow the generator to provide visually-equivalent tiling parameters for better performance.
     FloatSize adjustedSize = size();
@@ -88,11 +88,10 @@
             m_cachedImageBuffer->convertToLuminanceMask();
     }
 
-    m_cachedImageBuffer->setSpaceSize(spaceSize());
     destContext->setDrawLuminanceMask(false);
 
     // Tile the image buffer into the context.
-    m_cachedImageBuffer->drawPattern(destContext, adjustedSrcRect, adjustedPatternCTM, phase, styleColorSpace, compositeOp, destRect, blendMode);
+    m_cachedImageBuffer->drawPattern(destContext, adjustedSrcRect, adjustedPatternCTM, phase, spacing, styleColorSpace, compositeOp, destRect, blendMode);
 }
 
 }

Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/GradientImage.h (193885 => 193886)


--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/GradientImage.h	2015-12-10 02:53:12 UTC (rev 193885)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/GradientImage.h	2015-12-10 03:16:43 UTC (rev 193886)
@@ -48,7 +48,7 @@
 protected:
     virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) override;
     virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform,
-        const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode) override;
+        const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode) override;
 
     GradientImage(PassRefPtr<Gradient>, const FloatSize&);
 

Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/GraphicsContext.cpp (193885 => 193886)


--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/GraphicsContext.cpp	2015-12-10 02:53:12 UTC (rev 193885)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/GraphicsContext.cpp	2015-12-10 03:16:43 UTC (rev 193886)
@@ -399,14 +399,13 @@
     image->draw(this, destination, source, colorSpace, imagePaintingOptions.m_compositeOperator, imagePaintingOptions.m_blendMode, imagePaintingOptions.m_orientationDescription);
 }
 
-void GraphicsContext::drawTiledImage(Image* image, ColorSpace colorSpace, const FloatRect& destination, const FloatPoint& source, const FloatSize& tileSize,
-    const ImagePaintingOptions& imagePaintingOptions)
+void GraphicsContext::drawTiledImage(Image* image, ColorSpace colorSpace, const FloatRect& destination, const FloatPoint& source, const FloatSize& tileSize, const FloatSize& spacing, const ImagePaintingOptions& imagePaintingOptions)
 {
     if (paintingDisabled() || !image)
         return;
 
     InterpolationQualityMaintainer interpolationQualityForThisScope(*this, imagePaintingOptions.m_useLowQualityScale ? InterpolationLow : imageInterpolationQuality());
-    image->drawTiled(this, destination, source, tileSize, colorSpace, imagePaintingOptions.m_compositeOperator, imagePaintingOptions.m_blendMode);
+    image->drawTiled(this, destination, source, tileSize, spacing, colorSpace, imagePaintingOptions.m_compositeOperator, imagePaintingOptions.m_blendMode);
 }
 
 void GraphicsContext::drawTiledImage(Image* image, ColorSpace colorSpace, const FloatRect& destination, const FloatRect& source, const FloatSize& tileScaleFactor,

Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/GraphicsContext.h (193885 => 193886)


--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/GraphicsContext.h	2015-12-10 02:53:12 UTC (rev 193885)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/GraphicsContext.h	2015-12-10 03:16:43 UTC (rev 193886)
@@ -310,8 +310,7 @@
         WEBCORE_EXPORT void drawImage(Image*, ColorSpace, const FloatRect& destination, const ImagePaintingOptions& = ImagePaintingOptions());
         void drawImage(Image*, ColorSpace, const FloatRect& destination, const FloatRect& source, const ImagePaintingOptions& = ImagePaintingOptions());
 
-        void drawTiledImage(Image*, ColorSpace, const FloatRect& destination, const FloatPoint& source, const FloatSize& tileSize,
-            const ImagePaintingOptions& = ImagePaintingOptions());
+        void drawTiledImage(Image*, ColorSpace, const FloatRect& destination, const FloatPoint& source, const FloatSize& tileSize, const FloatSize& spacing, const ImagePaintingOptions& = ImagePaintingOptions());
         void drawTiledImage(Image*, ColorSpace, const FloatRect& destination, const FloatRect& source, const FloatSize& tileScaleFactor,
             Image::TileRule, Image::TileRule, const ImagePaintingOptions& = ImagePaintingOptions());
 

Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/Image.cpp (193885 => 193886)


--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/Image.cpp	2015-12-10 02:53:12 UTC (rev 193885)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/Image.cpp	2015-12-10 03:16:43 UTC (rev 193886)
@@ -94,7 +94,7 @@
     draw(ctx, dstRect, srcRect, styleColorSpace, op, blendMode, description);
 }
 
-void Image::drawTiled(GraphicsContext* ctxt, const FloatRect& destRect, const FloatPoint& srcPoint, const FloatSize& scaledTileSize, ColorSpace styleColorSpace, CompositeOperator op, BlendMode blendMode)
+void Image::drawTiled(GraphicsContext* ctxt, const FloatRect& destRect, const FloatPoint& srcPoint, const FloatSize& scaledTileSize, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator op, BlendMode blendMode)
 {    
     if (mayFillWithSolidColor()) {
         fillWithSolidColor(ctxt, destRect, solidColor(), styleColorSpace, op);
@@ -117,7 +117,7 @@
                     scaledTileSize.height() / intrinsicTileSize.height());
 
     FloatRect oneTileRect;
-    FloatSize actualTileSize(scaledTileSize.width() + spaceSize().width(), scaledTileSize.height() + spaceSize().height());
+    FloatSize actualTileSize(scaledTileSize.width() + spacing.width(), scaledTileSize.height() + spacing.height());
     oneTileRect.setX(destRect.x() + fmodf(fmodf(-srcPoint.x(), actualTileSize.width()) - actualTileSize.width(), actualTileSize.width()));
     oneTileRect.setY(destRect.y() + fmodf(fmodf(-srcPoint.y(), actualTileSize.height()) - actualTileSize.height(), actualTileSize.height()));
     oneTileRect.setSize(scaledTileSize);
@@ -195,7 +195,7 @@
 
     AffineTransform patternTransform = AffineTransform().scaleNonUniform(scale.width(), scale.height());
     FloatRect tileRect(FloatPoint(), intrinsicTileSize);
-    drawPattern(ctxt, tileRect, patternTransform, oneTileRect.location(), styleColorSpace, op, destRect, blendMode);
+    drawPattern(ctxt, tileRect, patternTransform, oneTileRect.location(), spacing, styleColorSpace, op, destRect, blendMode);
 
 #if PLATFORM(IOS)
     startAnimation(DoNotCatchUp);
@@ -233,7 +233,7 @@
         vPhase -= (dstRect.height() - scaledTileHeight) / 2; 
     FloatPoint patternPhase(dstRect.x() - hPhase, dstRect.y() - vPhase);
     
-    drawPattern(ctxt, srcRect, patternTransform, patternPhase, styleColorSpace, op, dstRect);
+    drawPattern(ctxt, srcRect, patternTransform, patternPhase, FloatSize(), styleColorSpace, op, dstRect);
 
 #if PLATFORM(IOS)
     startAnimation(DoNotCatchUp);

Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/Image.h (193885 => 193886)


--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/Image.h	2015-12-10 02:53:12 UTC (rev 193885)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/Image.h	2015-12-10 03:16:43 UTC (rev 193886)
@@ -167,7 +167,7 @@
 #endif
 
     virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform,
-        const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode = BlendModeNormal);
+        const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode = BlendModeNormal);
 
 #if ENABLE(IMAGE_DECODER_DOWN_SAMPLING)
     FloatRect adjustSourceRectForDownSampling(const FloatRect& srcRect, const IntSize& scaledSize) const;
@@ -177,11 +177,6 @@
     virtual bool notSolidColor() { return true; }
 #endif
 
-    FloatSize spaceSize() const { return m_space; }
-    void setSpaceSize(const FloatSize& space)
-    {
-        m_space = space;
-    }
 protected:
     Image(ImageObserver* = nullptr);
 
@@ -192,7 +187,7 @@
     virtual void drawFrameMatchingSourceSize(GraphicsContext*, const FloatRect& dstRect, const IntSize& srcSize, ColorSpace styleColorSpace, CompositeOperator) { }
 #endif
     virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription);
-    void drawTiled(GraphicsContext*, const FloatRect& dstRect, const FloatPoint& srcPoint, const FloatSize& tileSize, ColorSpace styleColorSpace,
+    void drawTiled(GraphicsContext*, const FloatRect& dstRect, const FloatPoint& srcPoint, const FloatSize& tileSize, const FloatSize& spacing, ColorSpace styleColorSpace,
         CompositeOperator , BlendMode);
     void drawTiled(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, const FloatSize& tileScaleFactor, TileRule hRule, TileRule vRule, ColorSpace styleColorSpace, CompositeOperator);
 
@@ -203,7 +198,6 @@
 private:
     RefPtr<SharedBuffer> m_encodedImageData;
     ImageObserver* m_imageObserver;
-    FloatSize m_space;
 };
 
 } // namespace WebCore

Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/ImageBuffer.h (193885 => 193886)


--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/ImageBuffer.h	2015-12-10 02:53:12 UTC (rev 193885)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/ImageBuffer.h	2015-12-10 03:16:43 UTC (rev 193886)
@@ -124,9 +124,6 @@
     // with textures that are RGB or RGBA format, and UNSIGNED_BYTE type.
     bool copyToPlatformTexture(GraphicsContext3D&, Platform3DObject, GC3Denum, bool, bool);
 
-    FloatSize spaceSize() const { return m_space; }
-    void setSpaceSize(const FloatSize& space) { m_space = space; }
-
     // These functions are used when clamping the ImageBuffer which is created for filter, masker or clipper.
     static bool sizeNeedsClamping(const FloatSize&);
     static bool sizeNeedsClamping(const FloatSize&, FloatSize& scale);
@@ -144,7 +141,7 @@
     void clip(GraphicsContext*, const FloatRect&) const;
 
     void draw(GraphicsContext*, ColorSpace, const FloatRect& destRect, const FloatRect& srcRect = FloatRect(0, 0, -1, -1), CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal, bool useLowQualityScale = false);
-    void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode = BlendModeNormal);
+    void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode = BlendModeNormal);
 
     inline void genericConvertToLuminanceMask();
 
@@ -159,7 +156,6 @@
     IntSize m_size;
     IntSize m_logicalSize;
     float m_resolutionScale;
-    FloatSize m_space;
 
     // This constructor will place its success into the given out-variable
     // so that create() knows when it should return failure.

Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/NamedImageGeneratedImage.cpp (193885 => 193886)


--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/NamedImageGeneratedImage.cpp	2015-12-10 02:53:12 UTC (rev 193885)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/NamedImageGeneratedImage.cpp	2015-12-10 03:16:43 UTC (rev 193886)
@@ -60,7 +60,7 @@
 #endif
 }
 
-void NamedImageGeneratedImage::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode blendMode)
+void NamedImageGeneratedImage::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode blendMode)
 {
 #if USE(NEW_THEME)
 //    std::unique_ptr<ImageBuffer> imageBuffer = ImageBuffer::create(size(), 1, ColorSpaceDeviceRGB, context->isAcceleratedContext() ? Accelerated : Unaccelerated);
@@ -72,7 +72,7 @@
     platformTheme()->drawNamedImage(m_name, graphicsContext, FloatRect(0, 0, size().width(), size().height()));
 
     // Tile the image buffer into the context.
-    imageBuffer->drawPattern(context, srcRect, patternTransform, phase, styleColorSpace, compositeOp, dstRect, blendMode);
+    imageBuffer->drawPattern(context, srcRect, patternTransform, phase, spacing, styleColorSpace, compositeOp, dstRect, blendMode);
 #else
     UNUSED_PARAM(context);
     UNUSED_PARAM(srcRect);

Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/NamedImageGeneratedImage.h (193885 => 193886)


--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/NamedImageGeneratedImage.h	2015-12-10 02:53:12 UTC (rev 193885)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/NamedImageGeneratedImage.h	2015-12-10 03:16:43 UTC (rev 193886)
@@ -42,7 +42,7 @@
 
 protected:
     virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) override;
-    virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& dstRect, BlendMode) override;
+    virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& dstRect, BlendMode) override;
 
     NamedImageGeneratedImage(String name, const FloatSize&);
 

Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp (193885 => 193886)


--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp	2015-12-10 02:53:12 UTC (rev 193885)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp	2015-12-10 03:16:43 UTC (rev 193886)
@@ -196,10 +196,7 @@
     if (!image)
         return nullptr;
 
-    auto bitmapImage = BitmapImage::create(image.get());
-    bitmapImage->setSpaceSize(spaceSize());
-
-    return WTF::move(bitmapImage);
+    return BitmapImage::create(image.get());
 }
 
 BackingStoreCopy ImageBuffer::fastCopyImageMode()
@@ -247,7 +244,7 @@
     destContext->drawNativeImage(image.get(), m_data.backingStoreSize, colorSpace, destRect, adjustedSrcRect, op, blendMode);
 }
 
-void ImageBuffer::drawPattern(GraphicsContext* destContext, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect, BlendMode blendMode)
+void ImageBuffer::drawPattern(GraphicsContext* destContext, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect, BlendMode blendMode)
 {
     FloatRect adjustedSrcRect = srcRect;
     adjustedSrcRect.scale(m_resolutionScale, m_resolutionScale);
@@ -255,14 +252,14 @@
     if (!context()->isAcceleratedContext()) {
         if (destContext == context() || destContext->isAcceleratedContext()) {
             if (RefPtr<Image> copy = copyImage(CopyBackingStore)) // Drawing into our own buffer, need to deep copy.
-                copy->drawPattern(destContext, adjustedSrcRect, patternTransform, phase, styleColorSpace, op, destRect, blendMode);
+                copy->drawPattern(destContext, adjustedSrcRect, patternTransform, phase, spacing, styleColorSpace, op, destRect, blendMode);
         } else {
             if (RefPtr<Image> imageForRendering = copyImage(DontCopyBackingStore))
-                imageForRendering->drawPattern(destContext, adjustedSrcRect, patternTransform, phase, styleColorSpace, op, destRect, blendMode);
+                imageForRendering->drawPattern(destContext, adjustedSrcRect, patternTransform, phase, spacing, styleColorSpace, op, destRect, blendMode);
         }
     } else {
         if (RefPtr<Image> copy = copyImage(CopyBackingStore))
-            copy->drawPattern(destContext, adjustedSrcRect, patternTransform, phase, styleColorSpace, op, destRect, blendMode);
+            copy->drawPattern(destContext, adjustedSrcRect, patternTransform, phase, spacing, styleColorSpace, op, destRect, blendMode);
     }
 }
 

Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/cg/ImageCG.cpp (193885 => 193886)


--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/cg/ImageCG.cpp	2015-12-10 02:53:12 UTC (rev 193885)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/cg/ImageCG.cpp	2015-12-10 03:16:43 UTC (rev 193886)
@@ -89,7 +89,7 @@
 }
 
 void Image::drawPattern(GraphicsContext* ctxt, const FloatRect& tileRect, const AffineTransform& patternTransform,
-    const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect, BlendMode blendMode)
+    const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect, BlendMode blendMode)
 {
     if (!nativeImageForCurrentFrame())
         return;
@@ -133,11 +133,11 @@
     // Adjust the color space.
     subImage = Image::imageWithColorSpace(subImage.get(), styleColorSpace);
 
-    // If we need to paint gaps between tiles because we have a partially loaded image or non-zero spaceSize(),
+    // If we need to paint gaps between tiles because we have a partially loaded image or non-zero spacing,
     // fall back to the less efficient CGPattern-based mechanism.
     float scaledTileWidth = tileRect.width() * narrowPrecisionToFloat(patternTransform.a());
     float w = CGImageGetWidth(tileImage);
-    if (w == size().width() && h == size().height() && !spaceSize().width() && !spaceSize().height())
+    if (w == size().width() && h == size().height() && !spacing.width() && !spacing.height())
         CGContextDrawTiledImage(context, FloatRect(adjustedX, adjustedY, scaledTileWidth, scaledTileHeight), subImage.get());
     else {
         static const CGPatternCallbacks patternCallbacks = { 0, drawPatternCallback, patternReleaseCallback };
@@ -151,8 +151,8 @@
 #endif
         CGImageRef platformImage = CGImageRetain(subImage.get());
         RetainPtr<CGPatternRef> pattern = adoptCF(CGPatternCreate(platformImage, CGRectMake(0, 0, tileRect.width(), tileRect.height()), matrix,
-            tileRect.width() + spaceSize().width() * (1 / narrowPrecisionToFloat(patternTransform.a())),
-            tileRect.height() + spaceSize().height() * (1 / narrowPrecisionToFloat(patternTransform.d())),
+            tileRect.width() + spacing.width() * (1 / narrowPrecisionToFloat(patternTransform.a())),
+            tileRect.height() + spacing.height() * (1 / narrowPrecisionToFloat(patternTransform.d())),
             kCGPatternTilingConstantSpacing, true, &patternCallbacks));
         
         if (!pattern)

Modified: branches/safari-601.1.46-branch/Source/WebCore/rendering/RenderBoxModelObject.cpp (193885 => 193886)


--- branches/safari-601.1.46-branch/Source/WebCore/rendering/RenderBoxModelObject.cpp	2015-12-10 02:53:12 UTC (rev 193885)
+++ branches/safari-601.1.46-branch/Source/WebCore/rendering/RenderBoxModelObject.cpp	2015-12-10 03:16:43 UTC (rev 193886)
@@ -848,9 +848,7 @@
             RefPtr<Image> image = bgImage->image(clientForBackgroundImage, geometry.tileSize());
             context->setDrawLuminanceMask(bgLayer->maskSourceType() == MaskLuminance);
             bool useLowQualityScaling = shouldPaintAtLowQuality(context, image.get(), bgLayer, geometry.tileSize());
-            if (image.get())
-                image->setSpaceSize(geometry.spaceSize());
-            context->drawTiledImage(image.get(), style().colorSpace(), geometry.destRect(), toLayoutPoint(geometry.relativePhase()), geometry.tileSize(), ImagePaintingOptions(compositeOp, bgLayer->blendMode(), ImageOrientationDescription(), useLowQualityScaling));
+            context->drawTiledImage(image.get(), style().colorSpace(), geometry.destRect(), toLayoutPoint(geometry.relativePhase()), geometry.tileSize(), geometry.spaceSize(), ImagePaintingOptions(compositeOp, bgLayer->blendMode(), ImageOrientationDescription(), useLowQualityScaling));
         }
     }
 

Modified: branches/safari-601.1.46-branch/Source/WebCore/svg/graphics/SVGImage.cpp (193885 => 193886)


--- branches/safari-601.1.46-branch/Source/WebCore/svg/graphics/SVGImage.cpp	2015-12-10 02:53:12 UTC (rev 193885)
+++ branches/safari-601.1.46-branch/Source/WebCore/svg/graphics/SVGImage.cpp	2015-12-10 03:16:43 UTC (rev 193886)
@@ -184,8 +184,8 @@
 }
 #endif
 
-void SVGImage::drawPatternForContainer(GraphicsContext* context, const FloatSize containerSize, float zoom, const FloatRect& srcRect,
-    const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace colorSpace, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode blendMode)
+void SVGImage::drawPatternForContainer(GraphicsContext* context, const FloatSize& containerSize, float zoom, const FloatRect& srcRect,
+    const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, ColorSpace colorSpace, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode blendMode)
 {
     FloatRect zoomedContainerRect = FloatRect(FloatPoint(), containerSize);
     zoomedContainerRect.scale(zoom);
@@ -209,7 +209,6 @@
     RefPtr<Image> image = buffer->copyImage(DontCopyBackingStore, Unscaled);
     if (!image)
         return;
-    image->setSpaceSize(spaceSize());
 
     // Adjust the source rect and transform due to the image buffer's scaling.
     FloatRect scaledSrcRect = srcRect;
@@ -218,7 +217,7 @@
     unscaledPatternTransform.scale(1 / imageBufferScale.width(), 1 / imageBufferScale.height());
 
     context->setDrawLuminanceMask(false);
-    image->drawPattern(context, scaledSrcRect, unscaledPatternTransform, phase, colorSpace, compositeOp, dstRect, blendMode);
+    image->drawPattern(context, scaledSrcRect, unscaledPatternTransform, phase, spacing, colorSpace, compositeOp, dstRect, blendMode);
 }
 
 void SVGImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace, CompositeOperator compositeOp, BlendMode blendMode, ImageOrientationDescription)

Modified: branches/safari-601.1.46-branch/Source/WebCore/svg/graphics/SVGImage.h (193885 => 193886)


--- branches/safari-601.1.46-branch/Source/WebCore/svg/graphics/SVGImage.h	2015-12-10 02:53:12 UTC (rev 193885)
+++ branches/safari-601.1.46-branch/Source/WebCore/svg/graphics/SVGImage.h	2015-12-10 03:16:43 UTC (rev 193886)
@@ -94,9 +94,9 @@
     virtual bool currentFrameKnownToBeOpaque() override { return false; }
 
     SVGImage(ImageObserver&, const URL&);
-    virtual void draw(GraphicsContext*, const FloatRect& fromRect, const FloatRect& toRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) override;
+    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) override;
     void drawForContainer(GraphicsContext*, const FloatSize, float, const FloatRect&, const FloatRect&, ColorSpace, CompositeOperator, BlendMode);
-    void drawPatternForContainer(GraphicsContext*, const FloatSize, float, const FloatRect&, const AffineTransform&, const FloatPoint&, ColorSpace,
+    void drawPatternForContainer(GraphicsContext*, const FloatSize& containerSize, float zoom, const FloatRect& srcRect, const AffineTransform&, const FloatPoint& phase, const FloatSize& spacing, ColorSpace,
         CompositeOperator, const FloatRect&, BlendMode);
 
     SVGSVGElement* rootElement() const;

Modified: branches/safari-601.1.46-branch/Source/WebCore/svg/graphics/SVGImageForContainer.cpp (193885 => 193886)


--- branches/safari-601.1.46-branch/Source/WebCore/svg/graphics/SVGImageForContainer.cpp	2015-12-10 02:53:12 UTC (rev 193885)
+++ branches/safari-601.1.46-branch/Source/WebCore/svg/graphics/SVGImageForContainer.cpp	2015-12-10 03:16:43 UTC (rev 193886)
@@ -41,10 +41,9 @@
 }
 
 void SVGImageForContainer::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const AffineTransform& patternTransform,
-    const FloatPoint& phase, ColorSpace colorSpace, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode blendMode)
+    const FloatPoint& phase, const FloatSize& spacing, ColorSpace colorSpace, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode blendMode)
 {
-    m_image->setSpaceSize(spaceSize());
-    m_image->drawPatternForContainer(context, m_containerSize, m_zoom, srcRect, patternTransform, phase, colorSpace, compositeOp, dstRect, blendMode);
+    m_image->drawPatternForContainer(context, m_containerSize, m_zoom, srcRect, patternTransform, phase, spacing, colorSpace, compositeOp, dstRect, blendMode);
 }
 
 PassNativeImagePtr SVGImageForContainer::nativeImageForCurrentFrame()

Modified: branches/safari-601.1.46-branch/Source/WebCore/svg/graphics/SVGImageForContainer.h (193885 => 193886)


--- branches/safari-601.1.46-branch/Source/WebCore/svg/graphics/SVGImageForContainer.h	2015-12-10 02:53:12 UTC (rev 193885)
+++ branches/safari-601.1.46-branch/Source/WebCore/svg/graphics/SVGImageForContainer.h	2015-12-10 03:16:43 UTC (rev 193886)
@@ -58,7 +58,7 @@
 
     virtual void draw(GraphicsContext*, const FloatRect&, const FloatRect&, ColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) override;
 
-    virtual void drawPattern(GraphicsContext*, const FloatRect&, const AffineTransform&, const FloatPoint&, ColorSpace, CompositeOperator, const FloatRect&, BlendMode) override;
+    virtual void drawPattern(GraphicsContext*, const FloatRect&, const AffineTransform&, const FloatPoint&, const FloatSize&, ColorSpace, CompositeOperator, const FloatRect&, BlendMode) override;
 
     // FIXME: Implement this to be less conservative.
     virtual bool currentFrameKnownToBeOpaque() override { return false; }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to