It's copied directly from the normal GL context code in Skia. The part I added was just to pass in the shared context. Note that I duplicated the code so that I wouldn't have to touch mainline Skia code at all. The changes just add new files.