1*8975f5c5SAndroid Build Coastguard Worker# Introduction 2*8975f5c5SAndroid Build Coastguard Worker 3*8975f5c5SAndroid Build Coastguard WorkerThis page describes how to add new extensions to ANGLE. 4*8975f5c5SAndroid Build Coastguard Worker 5*8975f5c5SAndroid Build Coastguard Worker# Adding EGL extensions 6*8975f5c5SAndroid Build Coastguard Worker 7*8975f5c5SAndroid Build Coastguard WorkerNote: see also [anglebug.com/42261334](http://anglebug.com/42261334), linked 8*8975f5c5SAndroid Build Coastguard Workerfrom the [starter project](Starter-Projects.md) doc, to simplify some 9*8975f5c5SAndroid Build Coastguard Workerof these steps. 10*8975f5c5SAndroid Build Coastguard Worker 11*8975f5c5SAndroid Build Coastguard WorkerFor extensions requiring new entry points: 12*8975f5c5SAndroid Build Coastguard Worker 13*8975f5c5SAndroid Build Coastguard Worker* Add the extension xml to 14*8975f5c5SAndroid Build Coastguard Worker [scripts/egl_angle_ext.xml](../scripts/egl_angle_ext.xml) . 15*8975f5c5SAndroid Build Coastguard Worker 16*8975f5c5SAndroid Build Coastguard Worker* Note the prototypes for the new entry points must be added to the 17*8975f5c5SAndroid Build Coastguard Worker top of the file, and the functions themselves grouped under the 18*8975f5c5SAndroid Build Coastguard Worker extension name to the bottom of the file. 19*8975f5c5SAndroid Build Coastguard Worker 20*8975f5c5SAndroid Build Coastguard Worker* Modify [scripts/registry_xml.py](../scripts/registry_xml.py) to add 21*8975f5c5SAndroid Build Coastguard Worker the new extension as needed. 22*8975f5c5SAndroid Build Coastguard Worker 23*8975f5c5SAndroid Build Coastguard Worker* Run 24*8975f5c5SAndroid Build Coastguard Worker [scripts/run_code_generation.py](../scripts/run_code_generation.py) 25*8975f5c5SAndroid Build Coastguard Worker . 26*8975f5c5SAndroid Build Coastguard Worker 27*8975f5c5SAndroid Build Coastguard Worker* The entry point itself goes in 28*8975f5c5SAndroid Build Coastguard Worker [entry_points_egl_ext.h](../src/libGLESv2/entry_points_egl_ext.h) 29*8975f5c5SAndroid Build Coastguard Worker and 30*8975f5c5SAndroid Build Coastguard Worker [entry_points_egl_ext.cpp](../src/libGLESv2/entry_points_egl_ext.cpp) 31*8975f5c5SAndroid Build Coastguard Worker . 32*8975f5c5SAndroid Build Coastguard Worker 33*8975f5c5SAndroid Build Coastguard Worker* Add the new function to [libEGL.cpp](../src/libEGL/libEGL.cpp) and 34*8975f5c5SAndroid Build Coastguard Worker [libEGL.def](../src/libEGL/libEGL.def) . 35*8975f5c5SAndroid Build Coastguard Worker 36*8975f5c5SAndroid Build Coastguard Worker* Update [eglext_angle.h](../include/EGL/eglext_angle.h) with the new 37*8975f5c5SAndroid Build Coastguard Worker entry points and/or enums. 38*8975f5c5SAndroid Build Coastguard Worker 39*8975f5c5SAndroid Build Coastguard Worker* Add members to the appropriate Extensions struct in 40*8975f5c5SAndroid Build Coastguard Worker [Caps.h](../src/libANGLE/Caps.h) and 41*8975f5c5SAndroid Build Coastguard Worker [Caps.cpp](../src/libANGLE/Caps.cpp) . 42*8975f5c5SAndroid Build Coastguard Worker 43*8975f5c5SAndroid Build Coastguard Worker* Initialize extension availability in the `Display` subclass's 44*8975f5c5SAndroid Build Coastguard Worker `generateExtensions` method for displays that can support the 45*8975f5c5SAndroid Build Coastguard Worker extension; for example, 46*8975f5c5SAndroid Build Coastguard Worker [DisplayCGL](../src/libANGLE/renderer/gl/cgl/DisplayCGL.mm). 47