I've had this problem for about 24 hours now, so I'm turning to these forums to share my situation.
I have an iMac, 27-inch, Late 2009, 2.8 GHz Intel Core i7, 8 GB 1067 MHz DDR3, ATI Radeon HD 4850 512 MB. It's been a wonderful machine, and used it daily for years. I've been updating OS X since Snow Leopard, all the way up to Yosemite, and I've never had a problem, not ever, not once, not until now.
I came home yesterday and resumed using my iMac, went to Safari and started watching a video on YouTube. Then all of a sudden, pink lines appeared vertically down the center of my display. I realised that this distortion had also frozen the screen like this. Curiously, I could still move my cursor over this frozen image, and, I could still hear my YouTube video. It's was as if the entire desktop and it's windows had frozen together as one corrupted looking image, but other aspects of OS X were still working.
Being unable to see what I'm doing on my computer, I forcefully shut down the computer and restarted it. Attempting to fix the problem, I rebooted into recovery mode, tried a disk repair, reset the PRAM and unplugged the power. Nothing seemed to work – the problem seems more complex.
My issue is reproduced by simply booting into the login screen, or even booting directly into the desktop (automatic login), which reproduces the issue pretty much immediately – as soon as I have booted into OS X (after the grey boot screen) – noticeable graphic artefacts, pink and green noise and pixelation appears, and the image is frozen. Visually, my machine appears unresponsive, but as I reboot, my Mac still joins the network, I constantly hear the hard drive I/O, and I can SSH into it. Not being able to use the screen, I tried reading my system logs from another device using SSH, though nothing out of the ordinary indicates what the problem could be.
Now, not knowing much about either service, I'm just going to insinuate here that something like SystemUIServer or WindowServer is having a panic attack, whether it's a bug related to Quartz or a kernel extension – I have no idea – but I'm convinced my issue is not related to hardware – I'm able to "Safe Boot" straight into my desktop (after some time) and use my computer quite competently, albeit in safe mode. It leads me to assume that my logic board hasn't fried, my GPU hasn't exploded, and my RAM hasn't been corrupted. It should be software based.
I've read in this thread that deleting caches, LaunchAgents, and other files which could affect startup is advisable, though from what I've tried it hasn't fixed problem. I've also read that people had unusual success with installing, updating or uninstalling Java, but the problem still persists for me.
What I'm more concerned about is how widespread this issue could be, having upgraded to all the versions of OS X since Snow Leopard and never having any issues, I have no idea what I could have done to have caused this issue on Yosemite. I had been using Yosemite for weeks, and I'm completely puzzled by how simply playing a YouTube video in Safari would cause what seems like an irreversible compromise of my system. I am speechless about this one.
With my issue recurring pretty much right after booting OS X, the only way I can use my machine at this point is with Safe Boot... unless there is something I haven't tried yet in this mode – not knowing where the source of the problem is, I think my only option is to clean install Yosemite and cross my fingers that it doesn't magically happen again.
I have no idea what caused it, no idea how to fix it, and the fact it seemed so spontaneous makes me feel like it can happen to anyone.