~mmach/netext73/webkit2gtk

« back to all changes in this revision

Viewing changes to Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/cgl/DeviceCGL.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 2019 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
// DeviceCGL.cpp: CGL implementation of egl::Device
 
8
 
 
9
#include "common/platform.h"
 
10
 
 
11
#if defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_MACCATALYST)
 
12
 
 
13
#    include "libANGLE/renderer/gl/cgl/DeviceCGL.h"
 
14
 
 
15
#    include <EGL/eglext.h>
 
16
#    include "libANGLE/renderer/gl/cgl/DisplayCGL.h"
 
17
 
 
18
namespace rx
 
19
{
 
20
 
 
21
DeviceCGL::DeviceCGL() {}
 
22
 
 
23
DeviceCGL::~DeviceCGL() {}
 
24
 
 
25
egl::Error DeviceCGL::initialize()
 
26
{
 
27
    return egl::NoError();
 
28
}
 
29
 
 
30
egl::Error DeviceCGL::getAttribute(const egl::Display *display, EGLint attribute, void **outValue)
 
31
{
 
32
    DisplayCGL *displayImpl = GetImplAs<DisplayCGL>(display);
 
33
 
 
34
    switch (attribute)
 
35
    {
 
36
        case EGL_CGL_CONTEXT_ANGLE:
 
37
            *outValue = displayImpl->getCGLContext();
 
38
            break;
 
39
        case EGL_CGL_PIXEL_FORMAT_ANGLE:
 
40
            *outValue = displayImpl->getCGLPixelFormat();
 
41
            break;
 
42
        default:
 
43
            return egl::EglBadAttribute();
 
44
    }
 
45
 
 
46
    return egl::NoError();
 
47
}
 
48
 
 
49
EGLint DeviceCGL::getType()
 
50
{
 
51
    return 0;
 
52
}
 
53
 
 
54
void DeviceCGL::generateExtensions(egl::DeviceExtensions *outExtensions) const
 
55
{
 
56
    outExtensions->deviceCGL = true;
 
57
}
 
58
 
 
59
}  // namespace rx
 
60
 
 
61
#endif  // defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_MACCATALYST)