1 // 2 // Copyright 2020 The ANGLE Project Authors. All rights reserved. 3 // Use of this source code is governed by a BSD-style license that can be 4 // found in the LICENSE file. 5 // 6 7 // DeviceEAGL.cpp: EAGL implementation of egl::Device 8 9 #include "libANGLE/renderer/gl/eagl/DeviceEAGL.h" 10 11 #include <EGL/eglext.h> 12 13 #include "libANGLE/renderer/gl/eagl/DisplayEAGL.h" 14 15 namespace rx 16 { 17 DeviceEAGL()18DeviceEAGL::DeviceEAGL() {} 19 ~DeviceEAGL()20DeviceEAGL::~DeviceEAGL() {} 21 initialize()22egl::Error DeviceEAGL::initialize() 23 { 24 return egl::NoError(); 25 } 26 getAttribute(const egl::Display * display,EGLint attribute,void ** outValue)27egl::Error DeviceEAGL::getAttribute(const egl::Display *display, EGLint attribute, void **outValue) 28 { 29 DisplayEAGL *displayImpl = GetImplAs<DisplayEAGL>(display); 30 31 switch (attribute) 32 { 33 case EGL_EAGL_CONTEXT_ANGLE: 34 *outValue = displayImpl->getEAGLContext(); 35 break; 36 default: 37 return egl::EglBadAttribute(); 38 } 39 40 return egl::NoError(); 41 } 42 getType()43EGLint DeviceEAGL::getType() 44 { 45 return 0; 46 } 47 generateExtensions(egl::DeviceExtensions * outExtensions) const48void DeviceEAGL::generateExtensions(egl::DeviceExtensions *outExtensions) const 49 { 50 outExtensions->deviceEAGL = true; 51 } 52 53 } // namespace rx 54