FloatRect encloseRectToDevicePixels(const LayoutRect& rect, float pixelSnappingFactor) { FloatPoint location = floorPointToDevicePixels(rect.minXMinYCorner(), pixelSnappingFactor); FloatPoint maxPoint = ceilPointToDevicePixels(rect.maxXMaxYCorner(), pixelSnappingFactor); return FloatRect(location, maxPoint - location); }
IntRect enclosingIntRect(const LayoutRect& rect) { IntPoint location = flooredIntPoint(rect.minXMinYCorner()); IntPoint maxPoint = ceiledIntPoint(rect.maxXMaxYCorner()); return IntRect(location, maxPoint - location); }