I have this new Macbook pro and this is what is going on after a while. Might be actually a heating issue since I run it in a clamshell mode. But since I can screenshot it I can assume this is a software problem.
It happens when two monitors are plugged in and I think especially after I scroll or open many windows.
After you let it idle it goes back to normal I will check the GPU temperature next time. The strange part is I can screenshot the issue. So I guess that might be drivers fault? The OS is the latest one: Sierra 10.12.4 (16E195) with all updates installed.
It is probably not related to the temperature:
And the hardware test did not find any defects.
After observing it, I think I could say that it happens only with external monitors connected through Apple USB-C -> USB/Lightning/HDMI adaptors.
But the problem is not in the adaptors or I wouldn't be able to screenshot it.