The 36-year-old marvel continues to defy the ageing process as he needed just 58 minutes to overpower the Serb with a brilliant display of Swiss timing.
“I was feeling like he was not loving my slice and I was also mixing in dropshots,” said Federer who extended his perfect record this season to 14-0.
“I really I was able to mix up my game nicely, make it difficult for him.
“At the same time, have fun with my game, play a variation, but for the most part try to stay on the offensive.”
Federer blasted six aces, had one double fault and won 89 percent of his first serve points, losing just three points on his serve the entire match.
“I actually was explosive out there today and I felt good,” he said. “So I'm very happy how things are turning out to be.”
After handing back an early break to allow Krajinovic to draw level at two-all, Federer moved into cruise control.
At one point he won 17 straight points en route to taking a 6-2, 3-0 lead, winning 10 of the final 11 games in the match.
Federer, who is the defending champion and trying to win a record sixth title in the California desert, was on the centre stadium for the third day in a row.
His opening match on Saturday night against Federico Delbonis carried over into Sunday afternoon after heavy rains forced a postponement of several night matches.
He said playing matches three days in a row doesn't faze him.
“You've got to be ready for it. It's what tennis players do. We wait, we play, we wait again, we play again.
“In Rotterdam I played five matches in a row,” he said. “Back in the day, I used to play six matches in a row.
“At the Masters 1000s, when the format was different, it was the best-of-five-set finals in the finals.
Playing three matches in a row. I think I'm okay.”
Federer has already won two titles in 2018, claiming his 20th Grand Slam crown by winning the Australian Open in January. The other victory came in Rotterdam.
In the next round he faces Jeremy Chardy, who beat fellow Frenchman Adrian Mannarino 7-5, 4-6, 6-1.