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