Pedro Almodóvar's
The Skin I Live In

(2011)

Six years ago Vicente raped or sexually assaulted Norma Ledgard outside a party. Having already been briefly institutionalized, and having witnessed her mother's suicide, this crime sent her over the edge whereupon she killed herself.

In retaliation, her father Dr Robert Ledgard (Antonio Banderas), drugged Vicente, and then gave him a sex change against his will, followed by extensive facial plastic surgery, effectively turning Vicente into a lookalike of Robert's late wife (who Robert always maintains died in a car crash).

Vicente tries to commit suicide but Robert keeps saving him/her, and then addicts him/her to opium.

In 2012, Vicente now goes by Vera Cruz (Elena Anaya), and is used as a test subject for Robert's pioneering experiments into synthetic skin to treat burns.

Zeca (who has known Robert all their lives), is on the run from the law, hiding out at Robert's home. He finds out about Vera and rapes her, thinking she is Robert's wife. Robert comes home and on seeing Zeca violating Vera, shoots him repeatedly in the back. As he leaves to dispose of Zeca, his housekeeper Marilia reveals that Zeca and Robert are both her sons and half brothers. Vera also finds out from her, that the last time Zeca showed up, he ran off with Robert's wife, which led to a car crash that badly burned her, leading to her death and Robert's obsession with helping repair burnt skin.

One night, having again been raped by Robert, Vera shoots him in the chest and kills him. Marilia hears the gun fire, and bursts into the crime scene, gun drawn, but Vera hides under Robert's bed and guns her down. Vera then flees from Robert's residence and is last seen tracking down her/his mother to reveal his new identity that was forced onto him/her.    

Thanks ND Woods!