Force GPU switch with CGLSetVirtualScreen only for compositor

Only compositor contexts are known to use only the subset of GL
that can be safely migrated between the iGPU and the dGPU. Mark
those contexts as safe to forcibly transition between the GPUs.

In particular, Intel GPUs support using a GL_STENCIL_INDEX8
attachment with no depth buffer, but NV GPUs don't. Skia will use
this FBO combo if it is listed as available.

If we use this combo on the iGPU and then forcibly transition the
GL context using this combo from the iGPU to the dGPU, corruption
occurs on NV, and a hang happens on AMD.

Further, if we cache complete FBO combos, then we will cache this
combo as valid when using the iGPU, and claim that it's valid when
using the dGPU, resulting in GL errors.

BUG=180876

Review URL: https://chromiumcodereview.appspot.com/13746002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193302 0039d316-1c4b-4281-b951-d872f2087c98
10 files changed