That picture just shows a varying pulse width signal converted to a ramp, not a PWM signal. If you want to do than then feed the pulse into an op amp integrator circuit with a reset circuit to discharge the integrator capacitor at the end of the ramp. What is the frequency and pulse-width of the pulse?
A fixed current source, a shorting switch and a capacitor is
pretty much it. But getting the first and last, ideal, small and
cheap, is maybe the harder problem.
Do you really need a linear ramp? If so then an op amp integrator
might be cheapest, I know of no good fixed current reference
piece-parts. But in a closed loop setup ramp linearity isn't good
for much. Switched RC can be "close enough", often.