Mobile/SkiaGLDebugging
Debugging SkiaGL
Debugging the GLES2 Skia backend on desktop
SkiaGL has an object, GrGLInterface, that contains all the function pointers to glFoo functions for it to use. We have our own special GrGLInterface, "GLContextSkia", that forwards these glFoo calls to GLContext->fFoo. It is in gfx/gl/GLContextSkia.cpp
SkiaGL supports two different OpenGL APIs through its GrGLInterface; either desktop GL (we expose Desktop OpenGL 2.0 with a few extensions) or GLES2. On device, we (obviously) use GLES2 bindings, and on desktop we will generally use desktop GL.
In order to debug the GLES2 codepath without the overhead of having to test on an ARM device, it's generally easier to find a desktop Linux box with the "GL_ARB_ES2_compatibility" extension available (you can check if it's supported by running "glxinfo"). If you have it, change all instances of:
if (sGLContext->IsGLES2())
to
if (sGLContext->IsGLES2() || true)
To ensure that we use the GLES2 Skia codepath in desktop Linux.