After that I realized grades were fairly arbitrary and explicitly aimed for Ds in classes I didn't care about and settled for whatever in the classes I did care about.
I've been doing graphics since high school, it was one of the few classes I was really excited about, and it's what I'm currently getting paid to do. I've never failed any other class.
In my opinion, the first two years of CS actually matter. Fundamentals like data structures, algorithms, and maybe even operating systems classes are great. Beyond that, most CS programs tend to be severely outdated - you'll learn more from internships and co-ops than another 2 years of classes.
Of course, take that with a grain of salt since I did know exactly what I wanted to do coming into college.
University professor here.
Perhaps it's too late now, but I would encourage you to make a strenuous effort to get your professor in as much trouble with the administration as you can. I don't know who the "class dean" is -- but contact this person's department chair, the departmental undergraduate director, the dean of engineering, the dean of students, the provost, anybody, everybody. Whoever will listen.
What you experienced is not okay. I'm sure it's not an isolated incident, but it's also not the norm.