Yes, you can segment your path and draw only those segments that are visible. You can also render your whole path to a pixmap and then just render the pixmap instead of stroking the path in each frame (especially if your path is static).