summaryrefslogtreecommitdiff
path: root/libs/gui/BufferQueueThreadState.cpp
diff options
context:
space:
mode:
author Cody Northrop <cnorthrop@google.com> 2019-11-05 09:04:33 -0700
committer Cody Northrop <cnorthrop@google.com> 2019-11-07 09:18:12 -0700
commitb2306edb48e2a63b37a77524bdf8c5262b1783ed (patch)
tree70de9279ce1e293bc727810b4e192df7262368ce /libs/gui/BufferQueueThreadState.cpp
parent0b5ac42f5bd65fbe76fbc4b01dec7d8c5144ea7e (diff)
EGL: Fix repeated extension lookups
When adding support for GLES layers, we refactored eglGetProcAddress to allow layers to intercept functions unknown to the Loader. During the cleanup, we broke slot tracking if an extension were looked up multiple times. Follow up queries would use an incremented slot that had not been initialized: eglGetProcAddress("foo1") = fptr0:0x77e2c2abd8 eglGetProcAddress("foo2") = fptr1:0x77e2c2abf4 eglGetProcAddress("foo3") = fptr2:0x77e2c2ac10 eglGetProcAddress("foo1") = fptr3:0x77e2c2ac2c <= wrong eglGetProcAddress("foo2") = fptr4:0x77e2c2ac2c <= repeated eglGetProcAddress("foo3") = fptr5:0x77e2c2ac2c <= repeated This CL tracks which slot was used for a given extension, and when it is queried a second time, we look up the correct slot using extensionSlotMap. eglGetProcAddress("foo1") = fptr0:0x77e2c2abd8 eglGetProcAddress("foo2") = fptr1:0x77e2c2abf4 eglGetProcAddress("foo3") = fptr2:0x77e2c2ac10 eglGetProcAddress("foo1") = fptr3:0x77e2c2abd8 <= correct eglGetProcAddress("foo2") = fptr4:0x77e2c2abf4 <= correct eglGetProcAddress("foo3") = fptr5:0x77e2c2ac10 <= correct It also refactors the code a bit to be more readable, and fixes a typo throughout the file. Bug: 143860847 Test: egl_api_test Change-Id: If75c1abdb69a4d82253f28a5a80687f546e33ee0 Merged-In: If75c1abdb69a4d82253f28a5a80687f546e33ee0
Diffstat (limited to 'libs/gui/BufferQueueThreadState.cpp')
0 files changed, 0 insertions, 0 deletions