I used to have such problems when my old computer's video card started to overheat. And my XBOX 360 started to give strange coloured pixels while gaming, both without performance problems.
I suppose you have a notebook, and if so, it can overheat quiet fast, so I recommend a thorough cleaning inside the notebook with high-pressure air.
If this doesn't help, try to rise the notebook with something.
The best solution after the cleaning would be to buy something like this:
It lowers the CPU temperature with at over 25%. I have the same as seen on the picture.