Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(960)

Unified Diff: gpu/gles2_conform_support/egl/egl.cc

Issue 10911086: Add support to test harness EGL for OpenGL ES 1.1 tests on Regal (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/gles2_conform_support/egl/display.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/gles2_conform_support/egl/egl.cc
diff --git a/gpu/gles2_conform_support/egl/egl.cc b/gpu/gles2_conform_support/egl/egl.cc
index b342b9de9f4823d6765100555857576b07e9e01d..443aeaf4b1c63b46d8345212be0ba69cbf95a11d 100644
--- a/gpu/gles2_conform_support/egl/egl.cc
+++ b/gpu/gles2_conform_support/egl/egl.cc
@@ -9,6 +9,16 @@
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_surface.h"
+#if REGAL_STATIC_EGL
+extern "C" {
+
+typedef EGLContext RegalSystemContext;
+#define REGAL_DECL
+REGAL_DECL void RegalMakeCurrent( RegalSystemContext ctx );
+
+} // extern "C"
+#endif
+
namespace {
void SetCurrentError(EGLint error_code) {
}
@@ -133,6 +143,25 @@ const char* eglQueryString(EGLDisplay dpy, EGLint name) {
}
}
+EGLBoolean eglChooseConfig(EGLDisplay dpy,
+ const EGLint* attrib_list,
+ EGLConfig* configs,
+ EGLint config_size,
+ EGLint* num_config) {
+ EGLint error_code = ValidateDisplay(dpy);
+ if (error_code != EGL_SUCCESS)
+ return EglError(error_code, EGL_FALSE);
+
+ if (num_config == NULL)
+ return EglError(EGL_BAD_PARAMETER, EGL_FALSE);
+
+ egl::Display* display = static_cast<egl::Display*>(dpy);
+ if (!display->ChooseConfigs(configs, config_size, num_config))
+ return EglError(EGL_BAD_ATTRIBUTE, EGL_FALSE);
+
+ return EglSuccess(EGL_TRUE);
+}
+
EGLBoolean eglGetConfigs(EGLDisplay dpy,
EGLConfig* configs,
EGLint config_size,
@@ -151,14 +180,6 @@ EGLBoolean eglGetConfigs(EGLDisplay dpy,
return EglSuccess(EGL_TRUE);
}
-EGLBoolean eglChooseConfig(EGLDisplay dpy,
- const EGLint* attrib_list,
- EGLConfig* configs,
- EGLint config_size,
- EGLint* num_config) {
- return EGL_FALSE;
-}
-
EGLBoolean eglGetConfigAttrib(EGLDisplay dpy,
EGLConfig config,
EGLint attribute,
@@ -323,6 +344,11 @@ EGLBoolean eglMakeCurrent(EGLDisplay dpy,
egl::Display* display = static_cast<egl::Display*>(dpy);
if (!display->MakeCurrent(draw, read, ctx))
return EglError(EGL_CONTEXT_LOST, EGL_FALSE);
+
+#if REGAL_STATIC_EGL
+ RegalMakeCurrent(ctx);
+#endif
+
return EGL_TRUE;
}
« no previous file with comments | « gpu/gles2_conform_support/egl/display.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698