If you're in OpenGL then you're providing texture coordinates for the quad. Perspective correction is automatic. You provide coordinates between 0.0 and 1.0 for each of your vertices. To produce an image like you've posted you have to scale the texture coordinates in relation to your vertex coordinates, or in much older versions of GL you can use automatic texture coordinate generation which in 2D will produce the same result.

The solution for 'perspective' in 2D as you desire is to simply leave your texture coordinates at each corner of the texture while altering the vertices of the quad.

Input the vertex coordinates that would give you a quad like in the image you have provided and in counter-clockwise order (OpenGL defaults to counter-clockwise winding to determine front facing polygons) set your texture coordinates as (x:0,y:0) (x:0,y:1) (x:1,y:1) (x:1,x:0)

As long as you keep your texture coordinates the same, you can draw your (convex) quad at any combination of vertices and openGL will 'skew' the texture automatically.