Changeset 190910 in webkit
- Timestamp:
- Oct 12, 2015, 5:52:13 PM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r190906 r190910 1 2015-10-12 Simon Fraser <simon.fraser@apple.com> 2 3 Remove Image::spaceSize() and ImageBuffer::spaceSize() 4 https://bugs.webkit.org/show_bug.cgi?id=150064 5 6 Reviewed by Tim Horton. 7 8 Image spacing when tiled should not be a property of the image; but a description 9 of how it's drawn, like tile size. So remove spacing from Image and ImageBuffer, 10 and pass it in as an argument. 11 12 * platform/graphics/BitmapImage.cpp: 13 (WebCore::BitmapImage::drawPattern): 14 * platform/graphics/BitmapImage.h: 15 * platform/graphics/CrossfadeGeneratedImage.cpp: 16 (WebCore::CrossfadeGeneratedImage::drawPattern): 17 * platform/graphics/CrossfadeGeneratedImage.h: 18 * platform/graphics/GeneratedImage.h: 19 * platform/graphics/GradientImage.cpp: 20 (WebCore::GradientImage::drawPattern): 21 * platform/graphics/GradientImage.h: 22 * platform/graphics/GraphicsContext.cpp: 23 (WebCore::GraphicsContext::drawTiledImage): 24 * platform/graphics/GraphicsContext.h: 25 * platform/graphics/Image.cpp: 26 (WebCore::Image::drawTiled): 27 * platform/graphics/Image.h: 28 (WebCore::Image::spaceSize): Deleted. 29 (WebCore::Image::setSpaceSize): Deleted. 30 * platform/graphics/ImageBuffer.h: 31 (WebCore::ImageBuffer::spaceSize): Deleted. 32 (WebCore::ImageBuffer::setSpaceSize): Deleted. 33 * platform/graphics/NamedImageGeneratedImage.cpp: 34 (WebCore::NamedImageGeneratedImage::drawPattern): 35 * platform/graphics/NamedImageGeneratedImage.h: 36 * platform/graphics/cg/ImageBufferCG.cpp: 37 (WebCore::ImageBuffer::copyImage): 38 (WebCore::ImageBuffer::drawPattern): 39 * platform/graphics/cg/ImageCG.cpp: 40 (WebCore::Image::drawPattern): 41 * rendering/RenderBoxModelObject.cpp: 42 (WebCore::RenderBoxModelObject::paintFillLayerExtended): 43 * svg/graphics/SVGImage.cpp: 44 (WebCore::SVGImage::drawPatternForContainer): 45 * svg/graphics/SVGImage.h: 46 * svg/graphics/SVGImageForContainer.cpp: 47 (WebCore::SVGImageForContainer::drawPattern): 48 * svg/graphics/SVGImageForContainer.h: 49 1 50 2015-10-12 Andreas Kling <akling@apple.com> 2 51 -
trunk/Source/WebCore/platform/graphics/BitmapImage.cpp
r190124 r190910 607 607 608 608 void BitmapImage::drawPattern(GraphicsContext& ctxt, const FloatRect& tileRect, const AffineTransform& transform, 609 const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect, BlendMode blendMode)609 const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect, BlendMode blendMode) 610 610 { 611 611 if (tileRect.isEmpty()) … … 613 613 614 614 if (!ctxt.drawLuminanceMask()) { 615 Image::drawPattern(ctxt, tileRect, transform, phase, s tyleColorSpace, op, destRect, blendMode);615 Image::drawPattern(ctxt, tileRect, transform, phase, spacing, styleColorSpace, op, destRect, blendMode); 616 616 return; 617 617 } … … 635 635 if (!m_cachedImage) 636 636 return; 637 638 m_cachedImage->setSpaceSize(spaceSize());639 637 } 640 638 641 639 ctxt.setDrawLuminanceMask(false); 642 m_cachedImage->drawPattern(ctxt, tileRect, transform, phase, s tyleColorSpace, op, destRect, blendMode);640 m_cachedImage->drawPattern(ctxt, tileRect, transform, phase, spacing, styleColorSpace, op, destRect, blendMode); 643 641 } 644 642 -
trunk/Source/WebCore/platform/graphics/BitmapImage.h
r189144 r190910 144 144 145 145 virtual void drawPattern(GraphicsContext&, const FloatRect& srcRect, const AffineTransform& patternTransform, 146 const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode = BlendModeNormal) override;146 const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode = BlendModeNormal) override; 147 147 148 148 // Accessors for native image formats. … … 208 208 #if USE(WINGDI) 209 209 virtual void drawPattern(GraphicsContext&, const FloatRect& srcRect, const AffineTransform& patternTransform, 210 const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect);210 const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect); 211 211 #endif 212 212 -
trunk/Source/WebCore/platform/graphics/CrossfadeGeneratedImage.cpp
r190124 r190910 96 96 } 97 97 98 void CrossfadeGeneratedImage::drawPattern(GraphicsContext& context, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode blendMode)98 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) 99 99 { 100 100 std::unique_ptr<ImageBuffer> imageBuffer = ImageBuffer::create(size(), context.renderingMode()); … … 107 107 108 108 // Tile the image buffer into the context. 109 imageBuffer->drawPattern(context, srcRect, patternTransform, phase, s tyleColorSpace, compositeOp, dstRect, blendMode);109 imageBuffer->drawPattern(context, srcRect, patternTransform, phase, spacing, styleColorSpace, compositeOp, dstRect, blendMode); 110 110 } 111 111 -
trunk/Source/WebCore/platform/graphics/CrossfadeGeneratedImage.h
r189144 r190910 51 51 protected: 52 52 virtual void draw(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) override; 53 virtual void drawPattern(GraphicsContext&, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& dstRect, BlendMode) override;53 virtual void drawPattern(GraphicsContext&, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& dstRect, BlendMode) override; 54 54 55 55 CrossfadeGeneratedImage(Image* fromImage, Image* toImage, float percentage, const FloatSize& crossfadeSize, const FloatSize&); -
trunk/Source/WebCore/platform/graphics/GeneratedImage.h
r189144 r190910 52 52 virtual void draw(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) override = 0; 53 53 virtual void drawPattern(GraphicsContext&, const FloatRect& srcRect, const AffineTransform& patternTransform, 54 const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode) override = 0;54 const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode) override = 0; 55 55 56 56 // FIXME: Implement this to be less conservative. -
trunk/Source/WebCore/platform/graphics/GradientImage.cpp
r189144 r190910 57 57 58 58 void GradientImage::drawPattern(GraphicsContext& destContext, const FloatRect& srcRect, const AffineTransform& patternTransform, 59 const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator compositeOp, const FloatRect& destRect, BlendMode blendMode)59 const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator compositeOp, const FloatRect& destRect, BlendMode blendMode) 60 60 { 61 61 // Allow the generator to provide visually-equivalent tiling parameters for better performance. … … 89 89 } 90 90 91 m_cachedImageBuffer->setSpaceSize(spaceSize());92 91 destContext.setDrawLuminanceMask(false); 93 92 94 93 // Tile the image buffer into the context. 95 m_cachedImageBuffer->drawPattern(destContext, adjustedSrcRect, adjustedPatternCTM, phase, s tyleColorSpace, compositeOp, destRect, blendMode);94 m_cachedImageBuffer->drawPattern(destContext, adjustedSrcRect, adjustedPatternCTM, phase, spacing, styleColorSpace, compositeOp, destRect, blendMode); 96 95 } 97 96 -
trunk/Source/WebCore/platform/graphics/GradientImage.h
r189144 r190910 49 49 virtual void draw(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) override; 50 50 virtual void drawPattern(GraphicsContext&, const FloatRect& srcRect, const AffineTransform& patternTransform, 51 const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode) override;51 const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode) override; 52 52 53 53 GradientImage(PassRefPtr<Gradient>, const FloatSize&); -
trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp
r189144 r190910 400 400 } 401 401 402 void GraphicsContext::drawTiledImage(Image* image, ColorSpace colorSpace, const FloatRect& destination, const FloatPoint& source, const FloatSize& tileSize, 403 const ImagePaintingOptions& imagePaintingOptions) 402 void GraphicsContext::drawTiledImage(Image* image, ColorSpace colorSpace, const FloatRect& destination, const FloatPoint& source, const FloatSize& tileSize, const FloatSize& spacing, const ImagePaintingOptions& imagePaintingOptions) 404 403 { 405 404 if (paintingDisabled() || !image) … … 407 406 408 407 InterpolationQualityMaintainer interpolationQualityForThisScope(*this, imagePaintingOptions.m_useLowQualityScale ? InterpolationLow : imageInterpolationQuality()); 409 image->drawTiled(*this, destination, source, tileSize, colorSpace, imagePaintingOptions.m_compositeOperator, imagePaintingOptions.m_blendMode);408 image->drawTiled(*this, destination, source, tileSize, spacing, colorSpace, imagePaintingOptions.m_compositeOperator, imagePaintingOptions.m_blendMode); 410 409 } 411 410 -
trunk/Source/WebCore/platform/graphics/GraphicsContext.h
r190249 r190910 313 313 void drawImage(Image*, ColorSpace, const FloatRect& destination, const FloatRect& source, const ImagePaintingOptions& = ImagePaintingOptions()); 314 314 315 void drawTiledImage(Image*, ColorSpace, const FloatRect& destination, const FloatPoint& source, const FloatSize& tileSize, 316 const ImagePaintingOptions& = ImagePaintingOptions()); 315 void drawTiledImage(Image*, ColorSpace, const FloatRect& destination, const FloatPoint& source, const FloatSize& tileSize, const FloatSize& spacing, const ImagePaintingOptions& = ImagePaintingOptions()); 317 316 void drawTiledImage(Image*, ColorSpace, const FloatRect& destination, const FloatRect& source, const FloatSize& tileScaleFactor, 318 317 Image::TileRule, Image::TileRule, const ImagePaintingOptions& = ImagePaintingOptions()); -
trunk/Source/WebCore/platform/graphics/Image.cpp
r189144 r190910 95 95 } 96 96 97 void Image::drawTiled(GraphicsContext& ctxt, const FloatRect& destRect, const FloatPoint& srcPoint, const FloatSize& scaledTileSize, ColorSpace styleColorSpace, CompositeOperator op, BlendMode blendMode)97 void Image::drawTiled(GraphicsContext& ctxt, const FloatRect& destRect, const FloatPoint& srcPoint, const FloatSize& scaledTileSize, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator op, BlendMode blendMode) 98 98 { 99 99 if (mayFillWithSolidColor()) { … … 118 118 119 119 FloatRect oneTileRect; 120 FloatSize actualTileSize(scaledTileSize.width() + spac eSize().width(), scaledTileSize.height() + spaceSize().height());120 FloatSize actualTileSize(scaledTileSize.width() + spacing.width(), scaledTileSize.height() + spacing.height()); 121 121 oneTileRect.setX(destRect.x() + fmodf(fmodf(-srcPoint.x(), actualTileSize.width()) - actualTileSize.width(), actualTileSize.width())); 122 122 oneTileRect.setY(destRect.y() + fmodf(fmodf(-srcPoint.y(), actualTileSize.height()) - actualTileSize.height(), actualTileSize.height())); … … 196 196 AffineTransform patternTransform = AffineTransform().scaleNonUniform(scale.width(), scale.height()); 197 197 FloatRect tileRect(FloatPoint(), intrinsicTileSize); 198 drawPattern(ctxt, tileRect, patternTransform, oneTileRect.location(), s tyleColorSpace, op, destRect, blendMode);198 drawPattern(ctxt, tileRect, patternTransform, oneTileRect.location(), spacing, styleColorSpace, op, destRect, blendMode); 199 199 200 200 #if PLATFORM(IOS) … … 234 234 FloatPoint patternPhase(dstRect.x() - hPhase, dstRect.y() - vPhase); 235 235 236 drawPattern(ctxt, srcRect, patternTransform, patternPhase, styleColorSpace, op, dstRect);236 drawPattern(ctxt, srcRect, patternTransform, patternPhase, FloatSize(), styleColorSpace, op, dstRect); 237 237 238 238 #if PLATFORM(IOS) -
trunk/Source/WebCore/platform/graphics/Image.h
r189144 r190910 168 168 169 169 virtual void drawPattern(GraphicsContext&, const FloatRect& srcRect, const AffineTransform& patternTransform, 170 const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode = BlendModeNormal);170 const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode = BlendModeNormal); 171 171 172 172 #if ENABLE(IMAGE_DECODER_DOWN_SAMPLING) … … 178 178 #endif 179 179 180 FloatSize spaceSize() const { return m_space; }181 void setSpaceSize(const FloatSize& space)182 {183 m_space = space;184 }185 180 protected: 186 181 Image(ImageObserver* = nullptr); … … 193 188 #endif 194 189 virtual void draw(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription); 195 void drawTiled(GraphicsContext&, const FloatRect& dstRect, const FloatPoint& srcPoint, const FloatSize& tileSize, ColorSpace styleColorSpace,190 void drawTiled(GraphicsContext&, const FloatRect& dstRect, const FloatPoint& srcPoint, const FloatSize& tileSize, const FloatSize& spacing, ColorSpace styleColorSpace, 196 191 CompositeOperator , BlendMode); 197 192 void drawTiled(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect, const FloatSize& tileScaleFactor, TileRule hRule, TileRule vRule, ColorSpace styleColorSpace, CompositeOperator); … … 204 199 RefPtr<SharedBuffer> m_encodedImageData; 205 200 ImageObserver* m_imageObserver; 206 FloatSize m_space;207 201 }; 208 202 -
trunk/Source/WebCore/platform/graphics/ImageBuffer.h
r190124 r190910 119 119 bool copyToPlatformTexture(GraphicsContext3D&, GC3Denum, Platform3DObject, GC3Denum, bool, bool); 120 120 121 FloatSize spaceSize() const { return m_space; }122 void setSpaceSize(const FloatSize& space) { m_space = space; }123 124 121 // These functions are used when clamping the ImageBuffer which is created for filter, masker or clipper. 125 122 static bool sizeNeedsClamping(const FloatSize&); … … 139 136 140 137 void draw(GraphicsContext&, ColorSpace, const FloatRect& destRect, const FloatRect& srcRect = FloatRect(0, 0, -1, -1), CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal, bool useLowQualityScale = false); 141 void drawPattern(GraphicsContext&, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode = BlendModeNormal);138 void drawPattern(GraphicsContext&, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode = BlendModeNormal); 142 139 143 140 inline void genericConvertToLuminanceMask(); … … 154 151 IntSize m_logicalSize; 155 152 float m_resolutionScale; 156 FloatSize m_space;157 153 158 154 // This constructor will place its success into the given out-variable -
trunk/Source/WebCore/platform/graphics/NamedImageGeneratedImage.cpp
r190124 r190910 61 61 } 62 62 63 void NamedImageGeneratedImage::drawPattern(GraphicsContext& context, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode blendMode)63 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) 64 64 { 65 65 #if USE(NEW_THEME) … … 72 72 73 73 // Tile the image buffer into the context. 74 imageBuffer->drawPattern(context, srcRect, patternTransform, phase, s tyleColorSpace, compositeOp, dstRect, blendMode);74 imageBuffer->drawPattern(context, srcRect, patternTransform, phase, spacing, styleColorSpace, compositeOp, dstRect, blendMode); 75 75 #else 76 76 UNUSED_PARAM(context); -
trunk/Source/WebCore/platform/graphics/NamedImageGeneratedImage.h
r189144 r190910 43 43 protected: 44 44 virtual void draw(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) override; 45 virtual void drawPattern(GraphicsContext&, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& dstRect, BlendMode) override;45 virtual void drawPattern(GraphicsContext&, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& dstRect, BlendMode) override; 46 46 47 47 NamedImageGeneratedImage(String name, const FloatSize&); -
trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp
r190124 r190910 197 197 return nullptr; 198 198 199 auto bitmapImage = BitmapImage::create(image.get()); 200 bitmapImage->setSpaceSize(spaceSize()); 201 202 return WTF::move(bitmapImage); 199 return BitmapImage::create(image.get()); 203 200 } 204 201 … … 248 245 } 249 246 250 void ImageBuffer::drawPattern(GraphicsContext& destContext, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect, BlendMode blendMode)247 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) 251 248 { 252 249 FloatRect adjustedSrcRect = srcRect; … … 256 253 if (&destContext == &context() || destContext.isAcceleratedContext()) { 257 254 if (RefPtr<Image> copy = copyImage(CopyBackingStore)) // Drawing into our own buffer, need to deep copy. 258 copy->drawPattern(destContext, adjustedSrcRect, patternTransform, phase, s tyleColorSpace, op, destRect, blendMode);255 copy->drawPattern(destContext, adjustedSrcRect, patternTransform, phase, spacing, styleColorSpace, op, destRect, blendMode); 259 256 } else { 260 257 if (RefPtr<Image> imageForRendering = copyImage(DontCopyBackingStore)) 261 imageForRendering->drawPattern(destContext, adjustedSrcRect, patternTransform, phase, s tyleColorSpace, op, destRect, blendMode);258 imageForRendering->drawPattern(destContext, adjustedSrcRect, patternTransform, phase, spacing, styleColorSpace, op, destRect, blendMode); 262 259 } 263 260 } else { 264 261 if (RefPtr<Image> copy = copyImage(CopyBackingStore)) 265 copy->drawPattern(destContext, adjustedSrcRect, patternTransform, phase, s tyleColorSpace, op, destRect, blendMode);262 copy->drawPattern(destContext, adjustedSrcRect, patternTransform, phase, spacing, styleColorSpace, op, destRect, blendMode); 266 263 } 267 264 } -
trunk/Source/WebCore/platform/graphics/cg/ImageCG.cpp
r189144 r190910 88 88 89 89 void Image::drawPattern(GraphicsContext& ctxt, const FloatRect& tileRect, const AffineTransform& patternTransform, 90 const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect, BlendMode blendMode)90 const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect, BlendMode blendMode) 91 91 { 92 92 if (!nativeImageForCurrentFrame()) … … 132 132 subImage = Image::imageWithColorSpace(subImage.get(), styleColorSpace); 133 133 134 // If we need to paint gaps between tiles because we have a partially loaded image or non-zero spac eSize(),134 // If we need to paint gaps between tiles because we have a partially loaded image or non-zero spacing, 135 135 // fall back to the less efficient CGPattern-based mechanism. 136 136 float scaledTileWidth = tileRect.width() * narrowPrecisionToFloat(patternTransform.a()); 137 137 float w = CGImageGetWidth(tileImage); 138 if (w == size().width() && h == size().height() && !spac eSize().width() && !spaceSize().height())138 if (w == size().width() && h == size().height() && !spacing.width() && !spacing.height()) 139 139 CGContextDrawTiledImage(context, FloatRect(adjustedX, adjustedY, scaledTileWidth, scaledTileHeight), subImage.get()); 140 140 else { … … 150 150 CGImageRef platformImage = CGImageRetain(subImage.get()); 151 151 RetainPtr<CGPatternRef> pattern = adoptCF(CGPatternCreate(platformImage, CGRectMake(0, 0, tileRect.width(), tileRect.height()), matrix, 152 tileRect.width() + spac eSize().width() * (1 / narrowPrecisionToFloat(patternTransform.a())),153 tileRect.height() + spac eSize().height() * (1 / narrowPrecisionToFloat(patternTransform.d())),152 tileRect.width() + spacing.width() * (1 / narrowPrecisionToFloat(patternTransform.a())), 153 tileRect.height() + spacing.height() * (1 / narrowPrecisionToFloat(patternTransform.d())), 154 154 kCGPatternTilingConstantSpacing, true, &patternCallbacks)); 155 155 -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r190883 r190910 837 837 context.setDrawLuminanceMask(bgLayer->maskSourceType() == MaskLuminance); 838 838 bool useLowQualityScaling = shouldPaintAtLowQuality(context, image.get(), bgLayer, geometry.tileSize()); 839 if (image.get()) 840 image->setSpaceSize(geometry.spaceSize()); 841 context.drawTiledImage(image.get(), style().colorSpace(), geometry.destRect(), toLayoutPoint(geometry.relativePhase()), geometry.tileSize(), ImagePaintingOptions(compositeOp, bgLayer->blendMode(), ImageOrientationDescription(), useLowQualityScaling)); 839 context.drawTiledImage(image.get(), style().colorSpace(), geometry.destRect(), toLayoutPoint(geometry.relativePhase()), geometry.tileSize(), geometry.spaceSize(), ImagePaintingOptions(compositeOp, bgLayer->blendMode(), ImageOrientationDescription(), useLowQualityScaling)); 842 840 } 843 841 } -
trunk/Source/WebCore/svg/graphics/SVGImage.cpp
r190124 r190910 186 186 #endif 187 187 188 void SVGImage::drawPatternForContainer(GraphicsContext& context, const FloatSize containerSize, float zoom, const FloatRect& srcRect,189 const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace colorSpace, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode blendMode)188 void SVGImage::drawPatternForContainer(GraphicsContext& context, const FloatSize& containerSize, float zoom, const FloatRect& srcRect, 189 const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, ColorSpace colorSpace, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode blendMode) 190 190 { 191 191 FloatRect zoomedContainerRect = FloatRect(FloatPoint(), containerSize); … … 211 211 if (!image) 212 212 return; 213 image->setSpaceSize(spaceSize());214 213 215 214 // Adjust the source rect and transform due to the image buffer's scaling. … … 220 219 221 220 context.setDrawLuminanceMask(false); 222 image->drawPattern(context, scaledSrcRect, unscaledPatternTransform, phase, colorSpace, compositeOp, dstRect, blendMode);221 image->drawPattern(context, scaledSrcRect, unscaledPatternTransform, phase, spacing, colorSpace, compositeOp, dstRect, blendMode); 223 222 } 224 223 -
trunk/Source/WebCore/svg/graphics/SVGImage.h
r189144 r190910 94 94 virtual void draw(GraphicsContext&, const FloatRect& fromRect, const FloatRect& toRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) override; 95 95 void drawForContainer(GraphicsContext&, const FloatSize, float, const FloatRect&, const FloatRect&, ColorSpace, CompositeOperator, BlendMode); 96 void drawPatternForContainer(GraphicsContext&, const FloatSize , float, const FloatRect&, const AffineTransform&, const FloatPoint&, ColorSpace,96 void drawPatternForContainer(GraphicsContext&, const FloatSize& containerSize, float zoom, const FloatRect& srcRect, const AffineTransform&, const FloatPoint& phase, const FloatSize& spacing, ColorSpace, 97 97 CompositeOperator, const FloatRect&, BlendMode); 98 98 -
trunk/Source/WebCore/svg/graphics/SVGImageForContainer.cpp
r189144 r190910 42 42 43 43 void SVGImageForContainer::drawPattern(GraphicsContext& context, const FloatRect& srcRect, const AffineTransform& patternTransform, 44 const FloatPoint& phase, ColorSpace colorSpace, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode blendMode)44 const FloatPoint& phase, const FloatSize& spacing, ColorSpace colorSpace, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode blendMode) 45 45 { 46 m_image->setSpaceSize(spaceSize()); 47 m_image->drawPatternForContainer(context, m_containerSize, m_zoom, srcRect, patternTransform, phase, colorSpace, compositeOp, dstRect, blendMode); 46 m_image->drawPatternForContainer(context, m_containerSize, m_zoom, srcRect, patternTransform, phase, spacing, colorSpace, compositeOp, dstRect, blendMode); 48 47 } 49 48 -
trunk/Source/WebCore/svg/graphics/SVGImageForContainer.h
r189144 r190910 59 59 virtual void draw(GraphicsContext&, const FloatRect&, const FloatRect&, ColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) override; 60 60 61 virtual void drawPattern(GraphicsContext&, const FloatRect&, const AffineTransform&, const FloatPoint&, ColorSpace, CompositeOperator, const FloatRect&, BlendMode) override;61 virtual void drawPattern(GraphicsContext&, const FloatRect&, const AffineTransform&, const FloatPoint&, const FloatSize&, ColorSpace, CompositeOperator, const FloatRect&, BlendMode) override; 62 62 63 63 // FIXME: Implement this to be less conservative.
Note:
See TracChangeset
for help on using the changeset viewer.