OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/bind.h" | 5 #include "base/bind.h" |
6 #include "ui/gl/gl_bindings.h" | 6 #include "ui/gl/gl_bindings.h" |
7 #include "ui/gl/gl_context_stub_with_extensions.h" | 7 #include "ui/gl/gl_context_stub_with_extensions.h" |
8 #include "ui/gl/gl_egl_api_implementation.h" | 8 #include "ui/gl/gl_egl_api_implementation.h" |
9 #include "ui/gl/gl_gl_api_implementation.h" | 9 #include "ui/gl/gl_gl_api_implementation.h" |
10 #include "ui/gl/gl_implementation.h" | 10 #include "ui/gl/gl_implementation.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 // Prevent reinitialization with a different implementation. Once the gpu | 37 // Prevent reinitialization with a different implementation. Once the gpu |
38 // unit tests have initialized with kGLImplementationMock, we don't want to | 38 // unit tests have initialized with kGLImplementationMock, we don't want to |
39 // later switch to another GL implementation. | 39 // later switch to another GL implementation. |
40 DCHECK_EQ(kGLImplementationNone, GetGLImplementation()); | 40 DCHECK_EQ(kGLImplementationNone, GetGLImplementation()); |
41 ui::OzonePlatform::InitializeForGPU(); | 41 ui::OzonePlatform::InitializeForGPU(); |
42 | 42 |
43 switch (implementation) { | 43 switch (implementation) { |
44 case kGLImplementationOSMesaGL: | 44 case kGLImplementationOSMesaGL: |
45 return InitializeStaticGLBindingsOSMesaGL(); | 45 return InitializeStaticGLBindingsOSMesaGL(); |
46 case kGLImplementationEGLGLES2: | 46 case kGLImplementationEGLGLES2: |
47 if (!ui::SurfaceFactoryOzone::GetInstance()->LoadEGLGLES2Bindings( | 47 if (!ui::OzonePlatform::GetInstance() |
48 base::Bind(&AddGLNativeLibrary), | 48 ->GetSurfaceFactoryOzone() |
49 base::Bind(&SetGLGetProcAddressProc))) | 49 ->LoadEGLGLES2Bindings(base::Bind(&AddGLNativeLibrary), |
| 50 base::Bind(&SetGLGetProcAddressProc))) |
50 return false; | 51 return false; |
51 SetGLImplementation(kGLImplementationEGLGLES2); | 52 SetGLImplementation(kGLImplementationEGLGLES2); |
52 InitializeStaticGLBindingsGL(); | 53 InitializeStaticGLBindingsGL(); |
53 InitializeStaticGLBindingsEGL(); | 54 InitializeStaticGLBindingsEGL(); |
54 | 55 |
55 // These two functions take single precision float rather than double | 56 // These two functions take single precision float rather than double |
56 // precision float parameters in GLES. | 57 // precision float parameters in GLES. |
57 ::gfx::g_driver_gl.fn.glClearDepthFn = MarshalClearDepthToClearDepthf; | 58 ::gfx::g_driver_gl.fn.glClearDepthFn = MarshalClearDepthToClearDepthf; |
58 ::gfx::g_driver_gl.fn.glDepthRangeFn = MarshalDepthRangeToDepthRangef; | 59 ::gfx::g_driver_gl.fn.glDepthRangeFn = MarshalDepthRangeToDepthRangef; |
59 break; | 60 break; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 switch (GetGLImplementation()) { | 109 switch (GetGLImplementation()) { |
109 case kGLImplementationEGLGLES2: | 110 case kGLImplementationEGLGLES2: |
110 return GetGLWindowSystemBindingInfoEGL(info); | 111 return GetGLWindowSystemBindingInfoEGL(info); |
111 default: | 112 default: |
112 return false; | 113 return false; |
113 } | 114 } |
114 return false; | 115 return false; |
115 } | 116 } |
116 | 117 |
117 } // namespace gfx | 118 } // namespace gfx |
OLD | NEW |