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

Unified Diff: ui/gl/gl_egl_api_implementation.cc

Issue 2094513002: Move static GL binding initialization to //ui/gl/init. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix for comment. Created 4 years, 6 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 | « ui/gl/gl_egl_api_implementation.h ('k') | ui/gl/gl_gl_api_implementation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_egl_api_implementation.cc
diff --git a/ui/gl/gl_egl_api_implementation.cc b/ui/gl/gl_egl_api_implementation.cc
index 2a81a17493633417182215cab0b034288813769c..22e8f6b722950bdfa4c3ef548fad8500bec4ab05 100644
--- a/ui/gl/gl_egl_api_implementation.cc
+++ b/ui/gl/gl_egl_api_implementation.cc
@@ -12,6 +12,19 @@
namespace gl {
+namespace {
+
+void GL_BINDING_CALL MarshalClearDepthToClearDepthf(GLclampd depth) {
+ glClearDepthf(static_cast<GLclampf>(depth));
+}
+
+void GL_BINDING_CALL MarshalDepthRangeToDepthRangef(GLclampd z_near,
+ GLclampd z_far) {
+ glDepthRangef(static_cast<GLclampf>(z_near), static_cast<GLclampf>(z_far));
+}
+
+} // namespace
+
RealEGLApi* g_real_egl;
void InitializeStaticGLBindingsEGL() {
@@ -22,6 +35,11 @@ void InitializeStaticGLBindingsEGL() {
g_real_egl->Initialize(&g_driver_egl);
g_current_egl_context = g_real_egl;
g_driver_egl.InitializeExtensionBindings();
+
+ // These two functions take single precision float rather than double
+ // precision float parameters in GLES.
+ ::gl::g_driver_gl.fn.glClearDepthFn = MarshalClearDepthToClearDepthf;
+ ::gl::g_driver_gl.fn.glDepthRangeFn = MarshalDepthRangeToDepthRangef;
}
void InitializeDebugGLBindingsEGL() {
« no previous file with comments | « ui/gl/gl_egl_api_implementation.h ('k') | ui/gl/gl_gl_api_implementation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698