Changeset 190883 in webkit
- Timestamp:
- Oct 12, 2015 12:51:11 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r190880 r190883 1 2015-10-12 Said Abou-Hallawa <sabouhallawa@apple.com> 2 3 REGRESSION(r184895): border-image should always slice the SVG image to nine pieces when drawing it in the container element 4 https://bugs.webkit.org/show_bug.cgi?id=149901 5 <rdar://problem/21995596> 6 7 Reviewed by Darin Adler. 8 9 * fast/borders/border-image-fill-no-intrinsic-size-expected.html: 10 * fast/borders/border-image-fill-no-intrinsic-size.html: 11 * fast/borders/resources/svg-border-100x100-relative.svg: Added. 12 * fast/borders/resources/svg-border-100x100-viewbox.svg: Added. 13 * fast/borders/resources/svg-border-140x140-intrinsic.svg: 14 New test cases for relative lengths border images were added. The relative 15 lengths can be specified by using percentage lengths or adding viewBox to 16 the root element. 17 18 One of the non-intrinsic image-borders must be removed from this test. 19 The SVG image in the expected file has to be scaled by (100 / 140), which 20 can be done. But run-webkit-tests found a very slight difference between 21 the actual and the result files. 22 1 23 2015-10-12 Brent Fulgham <bfulgham@apple.com> 2 24 -
trunk/LayoutTests/fast/borders/border-image-fill-no-intrinsic-size-expected.html
r184895 r190883 5 5 height: 100px; 6 6 width: 100px; 7 margin: 10px;8 7 display: inline-block; 9 8 background-color: red; 10 9 } 11 .border {10 .border-20 { 12 11 border: 20px solid; 12 } 13 .border-40 { 14 border: solid; 15 border-top: 0px; 16 border-right: 40px; 17 border-bottom: 40px; 18 border-left: 0px; 13 19 } 14 20 .no-border { … … 21 27 border-image: url('resources/svg-border-100x100-intrinsic.svg') 20 fill; 22 28 } 29 .border-image-140-intrinsic { 30 border-image: url('resources/svg-border-140x140-intrinsic.svg') 0 fill; 31 } 23 32 .border-image-140-intrinsic-slice { 24 33 border-image: url('resources/svg-border-140x140-intrinsic.svg') 20 fill; … … 28 37 <body> 29 38 <div class="box no-border border-image-100-intrinsic"></div> 30 <div class="box border 39 <div class="box border-20 border-image-100-intrinsic"></div> 31 40 <div class="box no-border border-image-100-intrinsic-slice"></div> 32 <div class="box border 41 <div class="box border-20 border-image-100-intrinsic-slice"></div> 33 42 <br> 34 43 <div class="box no-border border-image-100-intrinsic"></div> 35 <div class="box border border-image-100-intrinsic"></div> 44 <div class="box border-20 border-image-100-intrinsic"></div> 45 <div class="box no-border border-image-100-intrinsic-slice"></div> 46 <div class="box border-20 border-image-140-intrinsic-slice"></div> 47 <br> 36 48 <div class="box no-border border-image-100-intrinsic"></div> 37 <div class="box border border-image-140-intrinsic-slice"></div> 49 <div class="box border-20 border-image-100-intrinsic"></div> 50 <div class="box no-border border-image-100-intrinsic-slice"></div> 51 <div class="box border-20 border-image-140-intrinsic-slice"></div> 52 <br> 53 <div class="box no-border border-image-100-intrinsic"></div> 54 <div class="box border-20"></div> 55 <div class="box no-border border-image-100-intrinsic-slice"></div> 56 <div class="box border-40 border-image-100-intrinsic"></div> 38 57 </body> -
trunk/LayoutTests/fast/borders/border-image-fill-no-intrinsic-size.html
r184895 r190883 5 5 height: 100px; 6 6 width: 100px; 7 margin: 10px;8 7 display: inline-block; 9 8 background-color: red; 10 9 } 11 .border {10 .border-20 { 12 11 border: 20px solid; 13 12 } … … 21 20 border-image: url('resources/svg-border-100x100-intrinsic.svg') 20 fill; 22 21 } 22 .border-image-100-viewbox { 23 border-image: url('resources/svg-border-100x100-viewbox.svg') 0 fill; 24 } 25 .border-image-100-viewbox-slice { 26 border-image: url('resources/svg-border-100x100-viewbox.svg') 20 fill; 27 } 28 .border-image-100-relative { 29 border-image: url('resources/svg-border-100x100-relative.svg') 0 fill; 30 } 31 .border-image-100-relative-slice { 32 border-image: url('resources/svg-border-100x100-relative.svg') 20 fill; 33 } 23 34 .border-image-no-intrinsic { 24 35 border-image: url('resources/svg-border-no-intrinsic.svg') 0 fill; … … 31 42 <body> 32 43 <div class="box no-border border-image-100-intrinsic"></div> 33 <div class="box border 44 <div class="box border-20 border-image-100-intrinsic"></div> 34 45 <div class="box no-border border-image-100-intrinsic-slice"></div> 35 <div class="box border border-image-100-intrinsic-slice"></div> 46 <div class="box border-20 border-image-100-intrinsic-slice"></div> 47 <br> 48 <div class="box no-border border-image-100-viewbox"></div> 49 <div class="box border-20 border-image-100-viewbox"></div> 50 <div class="box no-border border-image-100-viewbox-slice"></div> 51 <div class="box border-20 border-image-100-viewbox-slice"></div> 52 <br> 53 <div class="box no-border border-image-100-relative"></div> 54 <div class="box border-20 border-image-100-relative"></div> 55 <div class="box no-border border-image-100-relative-slice"></div> 56 <div class="box border-20 border-image-100-relative-slice"></div> 36 57 <br> 37 58 <div class="box no-border border-image-no-intrinsic"></div> 38 <div class="box border border-image-no-intrinsic"></div>59 <div class="box border-20"></div> 39 60 <div class="box no-border border-image-no-intrinsic-slice"></div> 40 <div class="box border 61 <div class="box border-20 border-image-no-intrinsic-slice"></div> 41 62 </body> -
trunk/LayoutTests/fast/borders/resources/svg-border-140x140-intrinsic.svg
r184895 r190883 1 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="140" height="140"> 2 <defs> 3 <g id="border-image"> 4 <rect width="100" height="100" fill="lime"/> 5 <rect x="10" y="10" width="80" height="80" fill="none" stroke="black" stroke-width="4px"/> 6 </g> 7 <clipPath id="top-left"> 8 <rect x="0" y="0" width="20" height="20"/> 9 </clipPath> 10 <clipPath id="left"> 11 <rect x="0" y="0" width="20" height="100"/> 12 </clipPath> 13 <clipPath id="bottom-left"> 14 <rect x="0" y="0" width="20" height="20"/> 15 </clipPath> 16 <clipPath id="top-right"> 17 <rect x="0" y="0" width="20" height="20"/> 18 </clipPath> 19 <clipPath id="right"> 20 <rect x="0" y="0" width="20" height="100"/> 21 </clipPath> 22 <clipPath id="bottom-right"> 23 <rect x="0" y="0" width="20" height="20"/> 24 </clipPath> 25 <clipPath id="top"> 26 <rect x="0" y="0" width="100" height="20"/> 27 </clipPath> 28 <clipPath id="bottom"> 29 <rect x="0" y="0" width="100" height="20"/> 30 </clipPath> 31 <clipPath id="middle"> 32 <rect x="0" y="0" width="100" height="100"/> 33 </clipPath> 34 </defs> 35 36 <!-- draw left side --> 37 <use x="0" y="0" xlink:href="#border-image" clip-path="url(#top-left)"/> 38 <use x="0" y="20" xlink:href="#border-image" clip-path="url(#left)"/> 39 <use x="0" y="120" xlink:href="#border-image" clip-path="url(#bottom-left)"/> 40 41 <!-- draw right side --> 42 <use x="120" y="0" xlink:href="#border-image" clip-path="url(#top-right)"/> 43 <use x="120" y="20" xlink:href="#border-image" clip-path="url(#right)"/> 44 <use x="120" y="120" xlink:href="#border-image" clip-path="url(#bottom-right)"/> 45 46 <!-- draw top and bottom sides --> 47 <use x="20" y="0" xlink:href="#border-image" clip-path="url(#top)"/> 48 <use x="20" y="120" xlink:href="#border-image" clip-path="url(#bottom)"/> 49 50 <!-- draw middle --> 51 <use x="20" y="20" xlink:href="#border-image" clip-path="url(#middle)"/> 1 <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="140" height="140"> 2 <rect width="100%" height="100%" fill="lime"/> 3 <rect x="10%" y="10%" width="80%" height="80%" fill="none" stroke="black" stroke-width="4%"/> 52 4 </svg> -
trunk/Source/WebCore/ChangeLog
r190879 r190883 1 2015-10-12 Said Abou-Hallawa <sabouhallawa@apple.com> 2 3 REGRESSION(r184895): border-image should always slice the SVG image to nine pieces when drawing it in the container element 4 https://bugs.webkit.org/show_bug.cgi?id=149901 5 <rdar://problem/21995596> 6 7 Reviewed by Darin Adler. 8 9 The nine-pieces algorithm should be applied to the border-image regardless 10 whether the image has an intrinsic size or not. It is not guaranteed to have 11 a meaningful border-image in all the cases of non-intrinsic size images. But 12 it should work as expected in most of the cases. 13 14 * rendering/RenderBoxModelObject.cpp: 15 * rendering/RenderBoxModelObject.h: 16 (WebCore::RenderBoxModelObject::calculateImageIntrinsicDimensions): 17 Revert the changes which were added to return whether the image has 18 intrinsic size or not. 19 20 (WebCore::RenderBoxModelObject::calculateFillTileSize): 21 (WebCore::RenderBoxModelObject::paintNinePieceImage): 22 Size of the image is now the return value of calculateImageIntrinsicDimensions(). 23 24 * rendering/RenderListMarker.cpp: 25 (WebCore::RenderListMarker::updateContent): 26 * rendering/shapes/ShapeOutsideInfo.cpp: 27 (WebCore::ShapeOutsideInfo::createShapeForImage): 28 Size of the image is now the return value of calculateImageIntrinsicDimensions(). 29 30 * rendering/style/NinePieceImage.cpp: 31 * rendering/style/NinePieceImage.h: 32 (WebCore::NinePieceImage::paint): 33 Delete the logic for the non-intrinsic case. Both intrinsic and non-intrinsic 34 cases will be treated the same. 35 36 (WebCore::NinePieceImage::computeNineRects): 37 (WebCore::NinePieceImage::computeSideTileScale): 38 (WebCore::NinePieceImage::computeMiddleTileScale): 39 (WebCore::NinePieceImage::computeTileScales): 40 (WebCore::NinePieceImage::computeIntrinsicRects): Deleted. 41 (WebCore::NinePieceImage::computeIntrinsicSideTileScale): Deleted. 42 (WebCore::NinePieceImage::computeIntrinsicMiddleTileScale): Deleted. 43 (WebCore::NinePieceImage::computeIntrinsicTileScales): Deleted. 44 Remove *Intrinsic* from the name of the functions. 45 46 (WebCore::NinePieceImage::computeNonIntrinsicRects): Deleted. 47 (WebCore::NinePieceImage::computeNonIntrinsicTileScales): Deleted. 48 Delete the *NonIntrinsic* functions. 49 1 50 2015-10-12 Simon Fraser <simon.fraser@apple.com> 2 51 -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r190834 r190883 898 898 } 899 899 900 bool RenderBoxModelObject::calculateImageIntrinsicDimensions(StyleImage* image, const LayoutSize& positioningAreaSize, ScaleByEffectiveZoomOrNot shouldScaleOrNot, LayoutSize& imageSize) const900 LayoutSize RenderBoxModelObject::calculateImageIntrinsicDimensions(StyleImage* image, const LayoutSize& positioningAreaSize, ScaleByEffectiveZoomOrNot shouldScaleOrNot) const 901 901 { 902 902 // A generated image without a fixed size, will always return the container size as intrinsic size. 903 if (image->isGeneratedImage() && image->usesImageContainerSize()) { 904 imageSize = LayoutSize(positioningAreaSize.width(), positioningAreaSize.height()); 905 return true; 906 } 903 if (image->isGeneratedImage() && image->usesImageContainerSize()) 904 return LayoutSize(positioningAreaSize.width(), positioningAreaSize.height()); 907 905 908 906 Length intrinsicWidth; … … 914 912 ASSERT(!intrinsicHeight.isPercentOrCalculated()); 915 913 916 imageSize = LayoutSize(intrinsicWidth.value(), intrinsicHeight.value()); 917 LayoutSize minimumSize(imageSize.width() > 0 ? 1 : 0, imageSize.height() > 0 ? 1 : 0); 914 LayoutSize resolvedSize(intrinsicWidth.value(), intrinsicHeight.value()); 915 LayoutSize minimumSize(resolvedSize.width() > 0 ? 1 : 0, resolvedSize.height() > 0 ? 1 : 0); 916 918 917 if (shouldScaleOrNot == ScaleByEffectiveZoom) 919 imageSize.scale(style().effectiveZoom()); 920 imageSize.clampToMinimumSize(minimumSize); 921 922 if (!imageSize.isEmpty()) 923 return true; 918 resolvedSize.scale(style().effectiveZoom()); 919 resolvedSize.clampToMinimumSize(minimumSize); 924 920 925 921 // If the image has one of either an intrinsic width or an intrinsic height: … … 927 923 // * and no intrinsic aspect ratio, then the missing dimension is assumed to be the size of the rectangle that 928 924 // establishes the coordinate system for the 'background-position' property. 929 if (imageSize.width() > 0 || imageSize.height() > 0) { 930 imageSize = resolveAgainstIntrinsicWidthOrHeightAndRatio(positioningAreaSize, intrinsicRatio, imageSize.width(), imageSize.height()); 931 return true; 932 } 925 if (resolvedSize.width() > 0 || resolvedSize.height() > 0) 926 return resolveAgainstIntrinsicWidthOrHeightAndRatio(positioningAreaSize, intrinsicRatio, resolvedSize.width(), resolvedSize.height()); 933 927 934 928 // If the image has no intrinsic dimensions and has an intrinsic ratio the dimensions must be assumed to be the 935 929 // largest dimensions at that ratio such that neither dimension exceeds the dimensions of the rectangle that 936 930 // establishes the coordinate system for the 'background-position' property. 937 if (!intrinsicRatio.isEmpty()) { 938 imageSize = resolveAgainstIntrinsicRatio(positioningAreaSize, intrinsicRatio); 939 return false; 940 } 931 if (!intrinsicRatio.isEmpty()) 932 return resolveAgainstIntrinsicRatio(positioningAreaSize, intrinsicRatio); 941 933 942 934 // If the image has no intrinsic ratio either, then the dimensions must be assumed to be the rectangle that 943 935 // establishes the coordinate system for the 'background-position' property. 944 imageSize = positioningAreaSize; 945 return false; 936 return positioningAreaSize; 946 937 } 947 938 … … 953 944 LayoutSize imageIntrinsicSize; 954 945 if (image) { 955 calculateImageIntrinsicDimensions(image, positioningAreaSize, ScaleByEffectiveZoom, imageIntrinsicSize);946 imageIntrinsicSize = calculateImageIntrinsicDimensions(image, positioningAreaSize, ScaleByEffectiveZoom); 956 947 imageIntrinsicSize.scale(1 / image->imageScaleFactor(), 1 / image->imageScaleFactor()); 957 948 } else … … 1264 1255 LayoutRect destination = LayoutRect(snapRectToDevicePixels(rectWithOutsets, deviceScaleFactor)); 1265 1256 1266 LayoutSize source; 1267 bool intrinsicSource = calculateImageIntrinsicDimensions(styleImage, destination.size(), DoNotScaleByEffectiveZoom, source); 1257 LayoutSize source = calculateImageIntrinsicDimensions(styleImage, destination.size(), DoNotScaleByEffectiveZoom); 1268 1258 1269 1259 // If both values are ‘auto’ then the intrinsic width and/or height of the image should be used, if any. 1270 1260 styleImage->setContainerSizeForRenderer(this, source, style.effectiveZoom()); 1271 1261 1272 ninePieceImage.paint(graphicsContext, this, style, destination, source, intrinsicSource,deviceScaleFactor, op);1262 ninePieceImage.paint(graphicsContext, this, style, destination, source, deviceScaleFactor, op); 1273 1263 return true; 1274 1264 } -
trunk/Source/WebCore/rendering/RenderBoxModelObject.h
r190834 r190883 294 294 295 295 enum ScaleByEffectiveZoomOrNot { ScaleByEffectiveZoom, DoNotScaleByEffectiveZoom }; 296 bool calculateImageIntrinsicDimensions(StyleImage*, const LayoutSize& scaledPositioningAreaSize, ScaleByEffectiveZoomOrNot, LayoutSize& imageSize) const;296 LayoutSize calculateImageIntrinsicDimensions(StyleImage*, const LayoutSize& scaledPositioningAreaSize, ScaleByEffectiveZoomOrNot) const; 297 297 298 298 private: -
trunk/Source/WebCore/rendering/RenderListMarker.cpp
r190685 r190883 1427 1427 LayoutUnit bulletWidth = style().fontMetrics().ascent() / LayoutUnit(2); 1428 1428 LayoutSize defaultBulletSize(bulletWidth, bulletWidth); 1429 LayoutSize imageSize; 1430 calculateImageIntrinsicDimensions(m_image.get(), defaultBulletSize, DoNotScaleByEffectiveZoom, imageSize); 1429 LayoutSize imageSize = calculateImageIntrinsicDimensions(m_image.get(), defaultBulletSize, DoNotScaleByEffectiveZoom); 1431 1430 m_image->setContainerSizeForRenderer(this, imageSize, style().effectiveZoom()); 1432 1431 return; -
trunk/Source/WebCore/rendering/shapes/ShapeOutsideInfo.cpp
r184895 r190883 149 149 std::unique_ptr<Shape> ShapeOutsideInfo::createShapeForImage(StyleImage* styleImage, float shapeImageThreshold, WritingMode writingMode, float margin) const 150 150 { 151 LayoutSize imageSize; 152 m_renderer.calculateImageIntrinsicDimensions(styleImage, m_referenceBoxLogicalSize, RenderImage::ScaleByEffectiveZoom, imageSize); 151 LayoutSize imageSize = m_renderer.calculateImageIntrinsicDimensions(styleImage, m_referenceBoxLogicalSize, RenderImage::ScaleByEffectiveZoom); 153 152 styleImage->setContainerSizeForRenderer(&m_renderer, imageSize, m_renderer.style().effectiveZoom()); 154 153 -
trunk/Source/WebCore/rendering/style/NinePieceImage.cpp
r189144 r190883 114 114 } 115 115 116 Vector<FloatRect> NinePieceImage::compute IntrinsicRects(const FloatRect& outer, const LayoutBoxExtent& slices, float deviceScaleFactor)116 Vector<FloatRect> NinePieceImage::computeNineRects(const FloatRect& outer, const LayoutBoxExtent& slices, float deviceScaleFactor) 117 117 { 118 118 FloatRect inner = outer; … … 138 138 } 139 139 140 Vector<FloatRect> NinePieceImage::computeNonIntrinsicRects(const Vector<FloatRect>& intrinsicRects, const LayoutBoxExtent& slices) 141 { 142 Vector<FloatRect> rects(MaxPiece); 143 144 for (ImagePiece piece = MinPiece; piece < MaxPiece; ++piece) { 145 if (isEmptyPieceRect(piece, slices)) 146 continue; 147 rects[piece] = FloatRect(FloatPoint(), intrinsicRects[piece].size()); 148 } 149 150 return rects; 151 } 152 153 FloatSize NinePieceImage::computeIntrinsicSideTileScale(ImagePiece piece, const Vector<FloatRect>& destinationRects, const Vector<FloatRect>& sourceRects) 140 FloatSize NinePieceImage::computeSideTileScale(ImagePiece piece, const Vector<FloatRect>& destinationRects, const Vector<FloatRect>& sourceRects) 154 141 { 155 142 ASSERT(!isCornerPiece(piece) && !isMiddlePiece(piece)); … … 166 153 } 167 154 168 FloatSize NinePieceImage::compute IntrinsicMiddleTileScale(const Vector<FloatSize>& scales, const Vector<FloatRect>& destinationRects, const Vector<FloatRect>& sourceRects, ENinePieceImageRule hRule, ENinePieceImageRule vRule)155 FloatSize NinePieceImage::computeMiddleTileScale(const Vector<FloatSize>& scales, const Vector<FloatRect>& destinationRects, const Vector<FloatRect>& sourceRects, ENinePieceImageRule hRule, ENinePieceImageRule vRule) 169 156 { 170 157 FloatSize scale(1, 1); … … 191 178 } 192 179 193 Vector<FloatSize> NinePieceImage::compute IntrinsicTileScales(const Vector<FloatRect>& destinationRects, const Vector<FloatRect>& sourceRects, ENinePieceImageRule hRule, ENinePieceImageRule vRule)180 Vector<FloatSize> NinePieceImage::computeTileScales(const Vector<FloatRect>& destinationRects, const Vector<FloatRect>& sourceRects, ENinePieceImageRule hRule, ENinePieceImageRule vRule) 194 181 { 195 182 Vector<FloatSize> scales(MaxPiece, FloatSize(1, 1)); 196 183 197 scales[TopPiece] = compute IntrinsicSideTileScale(TopPiece, destinationRects, sourceRects);198 scales[RightPiece] = compute IntrinsicSideTileScale(RightPiece, destinationRects, sourceRects);199 scales[BottomPiece] = compute IntrinsicSideTileScale(BottomPiece, destinationRects, sourceRects);200 scales[LeftPiece] = compute IntrinsicSideTileScale(LeftPiece, destinationRects, sourceRects);201 202 scales[MiddlePiece] = compute IntrinsicMiddleTileScale(scales, destinationRects, sourceRects, hRule, vRule);184 scales[TopPiece] = computeSideTileScale(TopPiece, destinationRects, sourceRects); 185 scales[RightPiece] = computeSideTileScale(RightPiece, destinationRects, sourceRects); 186 scales[BottomPiece] = computeSideTileScale(BottomPiece, destinationRects, sourceRects); 187 scales[LeftPiece] = computeSideTileScale(LeftPiece, destinationRects, sourceRects); 188 189 scales[MiddlePiece] = computeMiddleTileScale(scales, destinationRects, sourceRects, hRule, vRule); 203 190 return scales; 204 191 } 205 192 206 Vector<FloatSize> NinePieceImage::computeNonIntrinsicTileScales() 207 { 208 return Vector<FloatSize>(MaxPiece, FloatSize(1, 1)); 209 } 210 211 void NinePieceImage::paint(GraphicsContext& graphicsContext, RenderElement* renderer, const RenderStyle& style, const LayoutRect& destination, const LayoutSize& source, bool intrinsicSource, float deviceScaleFactor, CompositeOperator op) const 193 void NinePieceImage::paint(GraphicsContext& graphicsContext, RenderElement* renderer, const RenderStyle& style, const LayoutRect& destination, const LayoutSize& source, float deviceScaleFactor, CompositeOperator op) const 212 194 { 213 195 StyleImage* styleImage = image(); … … 219 201 scaleSlicesIfNeeded(destination.size(), destinationSlices, deviceScaleFactor); 220 202 221 Vector<FloatRect> destinationRects = computeIntrinsicRects(destination, destinationSlices, deviceScaleFactor); 222 Vector<FloatRect> sourceRects; 223 Vector<FloatSize> tileScales; 224 225 if (intrinsicSource) { 226 sourceRects = computeIntrinsicRects(FloatRect(FloatPoint(), source), sourceSlices, deviceScaleFactor); 227 tileScales = computeIntrinsicTileScales(destinationRects, sourceRects, horizontalRule(), verticalRule()); 228 } else { 229 sourceRects = computeNonIntrinsicRects(destinationRects, sourceSlices); 230 tileScales = computeNonIntrinsicTileScales(); 231 } 203 Vector<FloatRect> destinationRects = computeNineRects(destination, destinationSlices, deviceScaleFactor); 204 Vector<FloatRect> sourceRects = computeNineRects(FloatRect(FloatPoint(), source), sourceSlices, deviceScaleFactor); 205 Vector<FloatSize> tileScales = computeTileScales(destinationRects, sourceRects, horizontalRule(), verticalRule()); 232 206 233 207 RefPtr<Image> image = styleImage->image(renderer, source); -
trunk/Source/WebCore/rendering/style/NinePieceImage.h
r189144 r190883 197 197 static bool isEmptyPieceRect(ImagePiece, const Vector<FloatRect>& destinationRects, const Vector<FloatRect>& sourceRects); 198 198 199 static Vector<FloatRect> computeIntrinsicRects(const FloatRect& outer, const LayoutBoxExtent& slices, float deviceScaleFactor); 200 static Vector<FloatRect> computeNonIntrinsicRects(const Vector<FloatRect>& intrinsicRects, const LayoutBoxExtent& slices); 199 static Vector<FloatRect> computeNineRects(const FloatRect& outer, const LayoutBoxExtent& slices, float deviceScaleFactor); 201 200 202 201 static void scaleSlicesIfNeeded(const LayoutSize&, LayoutBoxExtent& slices, float deviceScaleFactor); 203 202 204 static FloatSize computeIntrinsicSideTileScale(ImagePiece, const Vector<FloatRect>& destinationRects, const Vector<FloatRect>& sourceRects); 205 static FloatSize computeIntrinsicMiddleTileScale(const Vector<FloatSize>& scales, const Vector<FloatRect>& destinationRects, const Vector<FloatRect>& sourceRects, ENinePieceImageRule hRule, ENinePieceImageRule vRule); 206 static Vector<FloatSize> computeIntrinsicTileScales(const Vector<FloatRect>& destinationRects, const Vector<FloatRect>& sourceRects, ENinePieceImageRule hRule, ENinePieceImageRule vRule); 207 static Vector<FloatSize> computeNonIntrinsicTileScales(); 208 209 void paint(GraphicsContext&, RenderElement*, const RenderStyle&, const LayoutRect& destination, const LayoutSize& source, bool intrinsicSource, float deviceScaleFactor, CompositeOperator) const; 203 static FloatSize computeSideTileScale(ImagePiece, const Vector<FloatRect>& destinationRects, const Vector<FloatRect>& sourceRects); 204 static FloatSize computeMiddleTileScale(const Vector<FloatSize>& scales, const Vector<FloatRect>& destinationRects, const Vector<FloatRect>& sourceRects, ENinePieceImageRule hRule, ENinePieceImageRule vRule); 205 static Vector<FloatSize> computeTileScales(const Vector<FloatRect>& destinationRects, const Vector<FloatRect>& sourceRects, ENinePieceImageRule hRule, ENinePieceImageRule vRule); 206 207 void paint(GraphicsContext&, RenderElement*, const RenderStyle&, const LayoutRect& destination, const LayoutSize& source, float deviceScaleFactor, CompositeOperator) const; 210 208 211 209 private:
Note: See TracChangeset
for help on using the changeset viewer.