• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #import "common/platform.h"
10 
11 #if defined(ANGLE_PLATFORM_IOS)
12 
13 #    include "libANGLE/renderer/gl/eagl/DeviceEAGL.h"
14 
15 #    include "libANGLE/renderer/gl/eagl/DisplayEAGL.h"
16 
17 #    include <EGL/eglext.h>
18 
19 namespace rx
20 {
21 
DeviceEAGL()22 DeviceEAGL::DeviceEAGL() {}
23 
~DeviceEAGL()24 DeviceEAGL::~DeviceEAGL() {}
25 
initialize()26 egl::Error DeviceEAGL::initialize()
27 {
28     return egl::NoError();
29 }
30 
getAttribute(const egl::Display * display,EGLint attribute,void ** outValue)31 egl::Error DeviceEAGL::getAttribute(const egl::Display *display, EGLint attribute, void **outValue)
32 {
33     DisplayEAGL *displayImpl = GetImplAs<DisplayEAGL>(display);
34 
35     switch (attribute)
36     {
37         case EGL_EAGL_CONTEXT_ANGLE:
38             *outValue = displayImpl->getEAGLContext();
39             break;
40         default:
41             return egl::EglBadAttribute();
42     }
43 
44     return egl::NoError();
45 }
46 
getType()47 EGLint DeviceEAGL::getType()
48 {
49     return 0;
50 }
51 
generateExtensions(egl::DeviceExtensions * outExtensions) const52 void DeviceEAGL::generateExtensions(egl::DeviceExtensions *outExtensions) const
53 {
54     outExtensions->deviceEAGL = true;
55 }
56 
57 }  // namespace rx
58 
59 #endif  // defined(ANGLE_PLATFORM_IOS)
60