~mmach/netext73/webkit2gtk

« back to all changes in this revision

Viewing changes to Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/eagl/DeviceEAGL.cpp

  • Committer: mmach
  • Date: 2023-06-16 17:21:37 UTC
  • Revision ID: netbit73@gmail.com-20230616172137-2rqx6yr96ga9g3kp
1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
22
DeviceEAGL::DeviceEAGL() {}
 
23
 
 
24
DeviceEAGL::~DeviceEAGL() {}
 
25
 
 
26
egl::Error DeviceEAGL::initialize()
 
27
{
 
28
    return egl::NoError();
 
29
}
 
30
 
 
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
 
 
47
EGLint DeviceEAGL::getType()
 
48
{
 
49
    return 0;
 
50
}
 
51
 
 
52
void DeviceEAGL::generateExtensions(egl::DeviceExtensions *outExtensions) const
 
53
{
 
54
    outExtensions->deviceEAGL = true;
 
55
}
 
56
 
 
57
}  // namespace rx
 
58
 
 
59
#endif  // defined(ANGLE_PLATFORM_IOS)