evas gl: Check EGL version before using dlsym
authorJean-Philippe Andre <jp.andre@samsung.com>
Thu, 20 Jul 2017 04:16:50 +0000 (13:16 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Thu, 20 Jul 2017 04:31:15 +0000 (13:31 +0900)
commit0c78783045e1b6b26133350865a910f97031ad02
treef334e4c61ad561e5d155045413ed220c3628a95e
parentef9bd4183196b60e28b54d15eebdcc7428242d9f
evas gl: Check EGL version before using dlsym

A recent commit broke texture_from_pixmap for NVIDIA EGL
(again), because eglCreateImage is a symbol in libEGL.so
but isn't in fact implemented by the driver.

That's because eglCreateImage() is exposed by libglvnd but
the underlying EGL implementation is NVIDIA and its version
is only 1.4, not 1.5 (where the API was introduced as core).

Instead of reverting the patch, it's better to cover our
bases properly and use dlsym() only if the version is right.

Note that GetProcAddress() may return garbage function
pointers for ALL functions as dynamic virtual functions may
be created on the fly by libglvnd. So it is absolutely
necessary to check the extension string as well.

See 0255f14dc2189c71776408b00307b8488bfa4dc5
src/modules/evas/engines/gl_common/evas_gl_context.c