Update surfman to 0.2 and remove glutin

This commit is contained in:
Alan Jeffrey 2020-01-09 17:28:46 -06:00
parent 9dbc6554f0
commit 8bb1732258
94 changed files with 2265 additions and 1513 deletions

View file

@ -1,5 +1,6 @@
#include "pch.h"
#include "Servo.h"
#include <EGL/egl.h>
namespace winrt::servo {
@ -21,10 +22,6 @@ void on_url_changed(const char *url) {
sServo->Delegate().OnServoURLChanged(char2hstring(url));
}
void flush() { sServo->Delegate().Flush(); }
void make_current() { sServo->Delegate().MakeCurrent(); }
void wakeup() { sServo->Delegate().WakeUp(); }
bool on_allow_navigation(const char *url) {
@ -107,7 +104,8 @@ const char *prompt_input(const char *message, const char *default,
}
Servo::Servo(hstring url, hstring args, GLsizei width, GLsizei height,
float dpi, ServoDelegate &aDelegate)
EGLNativeWindowType eglNativeWindow, float dpi,
ServoDelegate &aDelegate)
: mWindowHeight(height), mWindowWidth(width), mDelegate(aDelegate) {
SetEnvironmentVariableA("PreviewRuntimeEnabled", "1");
@ -119,6 +117,7 @@ Servo::Servo(hstring url, hstring args, GLsizei width, GLsizei height,
o.height = mWindowHeight;
o.density = dpi;
o.enable_subpixel_text_antialiasing = false;
o.native_widget = eglNativeWindow;
// Note about logs:
// By default: all modules are enabled. Only warn level-logs are displayed.
@ -142,8 +141,6 @@ Servo::Servo(hstring url, hstring args, GLsizei width, GLsizei height,
sServo = this; // FIXME;
capi::CHostCallbacks c;
c.flush = &flush;
c.make_current = &make_current;
c.on_load_started = &on_load_started;
c.on_load_ended = &on_load_ended;
c.on_title_changed = &on_title_changed;