virtual EGLint getConfigID() const = 0;
virtual void finish() = 0;
+ Display *getDisplay() const { return display; }
+
protected:
Context(egl::Display *display) : display(display) {}
virtual ~Context() {};
UNIMPLEMENTED(); // FIXME
}
- egl::setCurrentDisplay(dpy);
egl::setCurrentDrawSurface(drawSurface);
egl::setCurrentReadSurface(readSurface);
egl::setCurrentContext(context);
{
TRACE("()");
- return success(egl::getCurrentDisplay());
+ egl::Context *context = egl::getCurrentContext();
+
+ if(!context)
+ {
+ return success(EGL_NO_DISPLAY);
+ }
+
+ return success(context->getDisplay());
}
EGLBoolean QueryContext(EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value)
current->error = EGL_SUCCESS;
current->API = EGL_OPENGL_ES_API;
- current->display = EGL_NO_DISPLAY;
current->context = nullptr;
current->drawSurface = nullptr;
current->readSurface = nullptr;
return current->API;
}
-void setCurrentDisplay(EGLDisplay dpy)
-{
- Current *current = getCurrent();
-
- current->display = dpy;
-}
-
-EGLDisplay getCurrentDisplay()
-{
- Current *current = getCurrent();
-
- return current->display;
-}
-
void setCurrentContext(egl::Context *ctx)
{
Current *current = getCurrent();
{
EGLint error;
EGLenum API;
- EGLDisplay display;
Context *context;
Surface *drawSurface;
Surface *readSurface;
void setCurrentAPI(EGLenum API);
EGLenum getCurrentAPI();
- void setCurrentDisplay(EGLDisplay dpy);
- EGLDisplay getCurrentDisplay();
-
void setCurrentContext(Context *ctx);
Context *getCurrentContext();
}
};
-TEST_F(SwiftShaderTest, CompilationOnly)
-{
- // Empty test to trigger compilation of SwiftShader on build bots
-}
-
TEST_F(SwiftShaderTest, Initalization)
{
EXPECT_EQ(EGL_SUCCESS, eglGetError());
EXPECT_EQ(EGL_SUCCESS, eglGetError());
EXPECT_EQ((EGLBoolean)EGL_TRUE, success);
-// currentDisplay = eglGetCurrentDisplay();
-// EXPECT_EQ(EGL_SUCCESS, eglGetError());
-// EXPECT_EQ(EGL_NO_DISPLAY, currentDisplay);
+ currentDisplay = eglGetCurrentDisplay();
+ EXPECT_EQ(EGL_SUCCESS, eglGetError());
+ EXPECT_EQ(EGL_NO_DISPLAY, currentDisplay);
currentDrawSurface = eglGetCurrentSurface(EGL_DRAW);
EXPECT_EQ(EGL_SUCCESS, eglGetError());