Federer's increasingly running into a wall against the other top 3 at slams - Djok, Nadal at one or more of AO, RG, USO, and now Murray as well at AO and Olympics with Wimby 12 the only exception. He's also been susceptible or close to an upset against the likes of Berdych, Tsonga, JMDP. I hope he can reverse this pattern, but if it continues or the losses mount, then I could see him retiring. Otherwise Fed himself has said that his body will dictate how long he will continue on the tour.
Djokovic, Berdych, Tsonga, and Nadal are declining too. Perhaps not as quickly as Federer but they are. Murray is peaking now but he'll start to decline in an year or two as well. I think things will continue to get worse for Federer for a couple of years and then they're gonna gradually get better. For instance, I think a 35 year-old Federer will have a better chance against a 29 year-old Djokovic/Murray than a 32 year-old Federer will against a 26 year-old Djokovic/Murray. This is assuming Federer continues on the tour till he's 35.