mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Update surfman to 0.2 and remove glutin
This commit is contained in:
parent
9dbc6554f0
commit
8bb1732258
94 changed files with 2265 additions and 1513 deletions
|
@ -187,51 +187,3 @@ void OpenGLES::Reset() {
|
|||
Cleanup();
|
||||
Initialize();
|
||||
}
|
||||
|
||||
EGLSurface OpenGLES::CreateSurface(SwapChainPanel const &panel, float dpi) {
|
||||
EGLSurface surface = EGL_NO_SURFACE;
|
||||
|
||||
const EGLint surfaceAttributes[] = {EGL_NONE};
|
||||
|
||||
PropertySet surfaceCreationProperties;
|
||||
|
||||
surfaceCreationProperties.Insert(EGLNativeWindowTypeProperty, panel);
|
||||
// How to set size and or scale:
|
||||
// Insert(EGLRenderSurfaceSizeProperty),
|
||||
// PropertyValue::CreateSize(*renderSurfaceSize));
|
||||
surfaceCreationProperties.Insert(EGLRenderResolutionScaleProperty,
|
||||
PropertyValue::CreateSingle(dpi));
|
||||
|
||||
EGLNativeWindowType win = static_cast<EGLNativeWindowType>(
|
||||
winrt::get_abi(surfaceCreationProperties));
|
||||
surface =
|
||||
eglCreateWindowSurface(mEglDisplay, mEglConfig, win, surfaceAttributes);
|
||||
|
||||
if (surface == EGL_NO_SURFACE) {
|
||||
throw winrt::hresult_error(E_FAIL, L"Failed to create EGL surface");
|
||||
}
|
||||
|
||||
return surface;
|
||||
}
|
||||
|
||||
void OpenGLES::GetSurfaceDimensions(const EGLSurface surface, EGLint *width,
|
||||
EGLint *height) {
|
||||
eglQuerySurface(mEglDisplay, surface, EGL_WIDTH, width);
|
||||
eglQuerySurface(mEglDisplay, surface, EGL_HEIGHT, height);
|
||||
}
|
||||
|
||||
void OpenGLES::DestroySurface(const EGLSurface surface) {
|
||||
if (mEglDisplay != EGL_NO_DISPLAY && surface != EGL_NO_SURFACE) {
|
||||
eglDestroySurface(mEglDisplay, surface);
|
||||
}
|
||||
}
|
||||
|
||||
void OpenGLES::MakeCurrent(const EGLSurface surface) {
|
||||
if (eglMakeCurrent(mEglDisplay, surface, surface, mEglContext) == EGL_FALSE) {
|
||||
throw winrt::hresult_error(E_FAIL, L"Failed to make EGLSurface current");
|
||||
}
|
||||
}
|
||||
|
||||
EGLBoolean OpenGLES::SwapBuffers(const EGLSurface surface) {
|
||||
return (eglSwapBuffers(mEglDisplay, surface));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue