|
Lines 865-884
bool RenderBoxModelObject::paintNinePiec
WebCore/rendering/RenderBoxModelObject.cpp_sec1
|
| 865 |
// The top left corner rect is (tx, ty, leftWidth, topWidth) |
865 |
// The top left corner rect is (tx, ty, leftWidth, topWidth) |
| 866 |
// The rect to use from within the image is obtained from our slice, and is (0, 0, leftSlice, topSlice) |
866 |
// The rect to use from within the image is obtained from our slice, and is (0, 0, leftSlice, topSlice) |
| 867 |
if (drawTop) |
867 |
if (drawTop) |
| 868 |
graphicsContext->drawImage(image, colorSpace, IntRect(tx, ty, leftWidth, topWidth), |
868 |
graphicsContext->drawImage(image, colorSpace, graphicsContext->roundToDevicePixels(FloatRect(tx, ty, leftWidth, topWidth)), |
| 869 |
IntRect(0, 0, leftSlice, topSlice), op); |
869 |
FloatRect(0, 0, leftSlice, topSlice), op); |
| 870 |
|
870 |
|
| 871 |
// The bottom left corner rect is (tx, ty + h - bottomWidth, leftWidth, bottomWidth) |
871 |
// The bottom left corner rect is (tx, ty + h - bottomWidth, leftWidth, bottomWidth) |
| 872 |
// The rect to use from within the image is (0, imageHeight - bottomSlice, leftSlice, botomSlice) |
872 |
// The rect to use from within the image is (0, imageHeight - bottomSlice, leftSlice, botomSlice) |
| 873 |
if (drawBottom) |
873 |
if (drawBottom) |
| 874 |
graphicsContext->drawImage(image, colorSpace, IntRect(tx, ty + h - bottomWidth, leftWidth, bottomWidth), |
874 |
graphicsContext->drawImage(image, colorSpace, graphicsContext->roundToDevicePixels(FloatRect(tx, ty + h - bottomWidth, leftWidth, bottomWidth)), |
| 875 |
IntRect(0, imageHeight - bottomSlice, leftSlice, bottomSlice), op); |
875 |
FloatRect(0, imageHeight - bottomSlice, leftSlice, bottomSlice), op); |
| 876 |
|
876 |
|
| 877 |
// Paint the left edge. |
877 |
// Paint the left edge. |
| 878 |
// Have to scale and tile into the border rect. |
878 |
// Have to scale and tile into the border rect. |
| 879 |
graphicsContext->drawTiledImage(image, colorSpace, IntRect(tx, ty + topWidth, leftWidth, |
879 |
graphicsContext->drawTiledImage(image, colorSpace, graphicsContext->roundToDevicePixels(FloatRect(tx, ty + topWidth, leftWidth, h - topWidth - bottomWidth)), |
| 880 |
h - topWidth - bottomWidth), |
880 |
FloatRect(0, topSlice, leftSlice, imageHeight - topSlice - bottomSlice), |
| 881 |
IntRect(0, topSlice, leftSlice, imageHeight - topSlice - bottomSlice), |
|
|
| 882 |
Image::StretchTile, (Image::TileRule)vRule, op); |
881 |
Image::StretchTile, (Image::TileRule)vRule, op); |
| 883 |
} |
882 |
} |
| 884 |
|
883 |
|
|
Lines 887-926
bool RenderBoxModelObject::paintNinePiec
WebCore/rendering/RenderBoxModelObject.cpp_sec2
|
| 887 |
// The top right corner rect is (tx + w - rightWidth, ty, rightWidth, topWidth) |
886 |
// The top right corner rect is (tx + w - rightWidth, ty, rightWidth, topWidth) |
| 888 |
// The rect to use from within the image is obtained from our slice, and is (imageWidth - rightSlice, 0, rightSlice, topSlice) |
887 |
// The rect to use from within the image is obtained from our slice, and is (imageWidth - rightSlice, 0, rightSlice, topSlice) |
| 889 |
if (drawTop) |
888 |
if (drawTop) |
| 890 |
graphicsContext->drawImage(image, colorSpace, IntRect(tx + w - rightWidth, ty, rightWidth, topWidth), |
889 |
graphicsContext->drawImage(image, colorSpace, graphicsContext->roundToDevicePixels(FloatRect(tx + w - rightWidth, ty, rightWidth, topWidth)), |
| 891 |
IntRect(imageWidth - rightSlice, 0, rightSlice, topSlice), op); |
890 |
FloatRect(imageWidth - rightSlice, 0, rightSlice, topSlice), op); |
| 892 |
|
891 |
|
| 893 |
// The bottom right corner rect is (tx + w - rightWidth, ty + h - bottomWidth, rightWidth, bottomWidth) |
892 |
// The bottom right corner rect is (tx + w - rightWidth, ty + h - bottomWidth, rightWidth, bottomWidth) |
| 894 |
// The rect to use from within the image is (imageWidth - rightSlice, imageHeight - bottomSlice, rightSlice, bottomSlice) |
893 |
// The rect to use from within the image is (imageWidth - rightSlice, imageHeight - bottomSlice, rightSlice, bottomSlice) |
| 895 |
if (drawBottom) |
894 |
if (drawBottom) |
| 896 |
graphicsContext->drawImage(image, colorSpace, IntRect(tx + w - rightWidth, ty + h - bottomWidth, rightWidth, bottomWidth), |
895 |
graphicsContext->drawImage(image, colorSpace, graphicsContext->roundToDevicePixels(FloatRect(tx + w - rightWidth, ty + h - bottomWidth, rightWidth, bottomWidth)), |
| 897 |
IntRect(imageWidth - rightSlice, imageHeight - bottomSlice, rightSlice, bottomSlice), op); |
896 |
FloatRect(imageWidth - rightSlice, imageHeight - bottomSlice, rightSlice, bottomSlice), op); |
| 898 |
|
897 |
|
| 899 |
// Paint the right edge. |
898 |
// Paint the right edge. |
| 900 |
graphicsContext->drawTiledImage(image, colorSpace, IntRect(tx + w - rightWidth, ty + topWidth, rightWidth, |
899 |
graphicsContext->drawTiledImage(image, colorSpace, graphicsContext->roundToDevicePixels(FloatRect(tx + w - rightWidth, ty + topWidth, rightWidth, h - topWidth - bottomWidth)), |
| 901 |
h - topWidth - bottomWidth), |
900 |
FloatRect(imageWidth - rightSlice, topSlice, rightSlice, imageHeight - topSlice - bottomSlice), |
| 902 |
IntRect(imageWidth - rightSlice, topSlice, rightSlice, imageHeight - topSlice - bottomSlice), |
|
|
| 903 |
Image::StretchTile, (Image::TileRule)vRule, op); |
901 |
Image::StretchTile, (Image::TileRule)vRule, op); |
| 904 |
} |
902 |
} |
| 905 |
|
903 |
|
| 906 |
// Paint the top edge. |
904 |
// Paint the top edge. |
| 907 |
if (drawTop) |
905 |
if (drawTop) |
| 908 |
graphicsContext->drawTiledImage(image, colorSpace, IntRect(tx + leftWidth, ty, w - leftWidth - rightWidth, topWidth), |
906 |
graphicsContext->drawTiledImage(image, colorSpace, graphicsContext->roundToDevicePixels(FloatRect(tx + leftWidth, ty, w - leftWidth - rightWidth, topWidth)), |
| 909 |
IntRect(leftSlice, 0, imageWidth - rightSlice - leftSlice, topSlice), |
907 |
FloatRect(leftSlice, 0, imageWidth - rightSlice - leftSlice, topSlice), |
| 910 |
(Image::TileRule)hRule, Image::StretchTile, op); |
908 |
(Image::TileRule)hRule, Image::StretchTile, op); |
| 911 |
|
909 |
|
| 912 |
// Paint the bottom edge. |
910 |
// Paint the bottom edge. |
| 913 |
if (drawBottom) |
911 |
if (drawBottom) |
| 914 |
graphicsContext->drawTiledImage(image, colorSpace, IntRect(tx + leftWidth, ty + h - bottomWidth, |
912 |
graphicsContext->drawTiledImage(image, colorSpace, graphicsContext->roundToDevicePixels(FloatRect(tx + leftWidth, ty + h - bottomWidth, w - leftWidth - rightWidth, bottomWidth)), |
| 915 |
w - leftWidth - rightWidth, bottomWidth), |
913 |
FloatRect(leftSlice, imageHeight - bottomSlice, imageWidth - rightSlice - leftSlice, bottomSlice), |
| 916 |
IntRect(leftSlice, imageHeight - bottomSlice, imageWidth - rightSlice - leftSlice, bottomSlice), |
|
|
| 917 |
(Image::TileRule)hRule, Image::StretchTile, op); |
914 |
(Image::TileRule)hRule, Image::StretchTile, op); |
| 918 |
|
915 |
|
| 919 |
// Paint the middle. |
916 |
// Paint the middle. |
| 920 |
if (drawMiddle) |
917 |
if (drawMiddle) |
| 921 |
graphicsContext->drawTiledImage(image, colorSpace, IntRect(tx + leftWidth, ty + topWidth, w - leftWidth - rightWidth, |
918 |
graphicsContext->drawTiledImage(image, colorSpace, graphicsContext->roundToDevicePixels(FloatRect(tx + leftWidth, ty + topWidth, w - leftWidth - rightWidth, h - topWidth - bottomWidth)), |
| 922 |
h - topWidth - bottomWidth), |
919 |
FloatRect(leftSlice, topSlice, imageWidth - rightSlice - leftSlice, imageHeight - topSlice - bottomSlice), |
| 923 |
IntRect(leftSlice, topSlice, imageWidth - rightSlice - leftSlice, imageHeight - topSlice - bottomSlice), |
|
|
| 924 |
(Image::TileRule)hRule, (Image::TileRule)vRule, op); |
920 |
(Image::TileRule)hRule, (Image::TileRule)vRule, op); |
| 925 |
|
921 |
|
| 926 |
return true; |
922 |
return true; |