State tax filing

Assuming this does not involve employee stock options awarded when you worked and resided in WA:
You would record all of the gain as California income on your California part-year resident tax return (form 540NR).  Your state of residence when purchased is not relevant.  Capital gain or loss is recognized in total only upon sale, and it is not "prorated" over the period of ownership.  It is your state of residence when you sell the stock and thereby receive capital gain or incur capital loss which determines your state tax obligation.