EglMacApi: Use the right pbuffer texture target and format parameters

The target and format parameters are in the EGL parameter range
(and are stored in EGLints), while nsCreatePBuffer (which calls
NSOpenGLPixelBuffer initWithTextureTarget) takes GLenums.
This is pretty much similar to the same function in EglWindowsApi.cpp,
but contrary to that function, there's nothing similar to
WGL_NO_TEXTURE_ARB in initWithTextureTarget, so something has to be
specified in all cases.

Previously, the default EGL_NO_TEXTURE (0x305C) was passed through.
While this mostly worked just fine, it had the surprising hidden
side effect of using a vertically flipped coordinate system in
glReadPixels (with the origin being the top left corner instead
of the bottom left one, which is default in OpenGL).

This makes the EncodeDecodeTest media CTS test pass with surface
output on the emulator on Mac OS X. (This test renders the decoded
video to a pbuffer and checks individual pixel values using
glReadPixels.)

Change-Id: I21a2430ce6334a5e82ea3203c4d157f5bad1558d
1 file changed