Given a polygon, I am trying to find the area of the polygon intersected with $\mathbf{x}<x$ and $\mathbf{y}<y$. I reckon this can be viewed as an integration of a function where its value is 1 inside polygon. Here is a figure to describe my problem better:

When the polygon and $(x,y)$ is given is there a fast way to calculate the area?
I need to calculate the area for many $(x,y)$ values. I have looked into integral transformation but could not manage to express my problem in terms of it.
We can assume polygon is convex if necessary, but I am interested in non-convex cases too.
There are a lot of similar questions already asked here, but I couldn't transform my problem to apply already mentioned methods.
Note that the area of an arbitrary convex polygon $P$ defined by a set of vertices $\left ( x_k,y_k \right)$, $k \in \{1,2,\ldots,N\}$ is given by
$$A(P) = \sum_{k=1}^N \left (x_k\, y_{k+1} - x_{k+1}\, y_k \right )$$
where $\left ( x_{N+1},y_{N+1} \right) = \left ( x_{1},y_{1} \right)$, and the vertices are listed in counterclockwise order. Essentially, you just need to determine the new polygon defined by the intersection of the two regions. This involves making a list of the coordinates contained within the rectangle $0 \le x' \le x$ and $0 \le y' \le y$ in counterclockwise order. You will need to develop the program logic to determine these points, the intersection of the region with the polygon, and the resulting polygon. Once you determine these, you may then compute the area from the above formula.