Hash :
12ce8f68
Author :
Date :
2020-01-03T16:40:06
Upstream WebKit's iOS port of ANGLE. Added the EAGL backend authored by Dean Jackson from Apple, and the refactoring changes needed to support it side-by-side with the macOS backend. Ran "git cl format" against these diffs. Defined the EGL_ANGLE_device_eagl extension and allocated an enum out of ANGLE's reserved range. The iOS backend is not yet included in any of the GN files. Bug: angleproject:4263 Change-Id: I631c32930433c03bb16a242955ffedf55174bb29 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1987278 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: James Darpinian <jdarpinian@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
//
// Copyright 2019 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// DeviceCGL.cpp: CGL implementation of egl::Device
#include "common/platform.h"
#if defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_MACCATALYST)
# include "libANGLE/renderer/gl/cgl/DeviceCGL.h"
# include <EGL/eglext.h>
# include "libANGLE/renderer/gl/cgl/DisplayCGL.h"
namespace rx
{
DeviceCGL::DeviceCGL() {}
DeviceCGL::~DeviceCGL() {}
egl::Error DeviceCGL::initialize()
{
return egl::NoError();
}
egl::Error DeviceCGL::getAttribute(const egl::Display *display, EGLint attribute, void **outValue)
{
DisplayCGL *displayImpl = GetImplAs<DisplayCGL>(display);
switch (attribute)
{
case EGL_CGL_CONTEXT_ANGLE:
*outValue = displayImpl->getCGLContext();
break;
case EGL_CGL_PIXEL_FORMAT_ANGLE:
*outValue = displayImpl->getCGLPixelFormat();
break;
default:
return egl::EglBadAttribute();
}
return egl::NoError();
}
EGLint DeviceCGL::getType()
{
return 0;
}
void DeviceCGL::generateExtensions(egl::DeviceExtensions *outExtensions) const
{
outExtensions->deviceCGL = true;
}
} // namespace rx
#endif // defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_MACCATALYST)