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

Side by Side Diff: ui/gl/gl_implementation_ozone.cc

Issue 1167533007: Revert of ozone: Remove singleton pattern for SurfaceFactoryOzone. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
OLDNEW
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
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::OzonePlatform::GetInstance() 47 if (!ui::SurfaceFactoryOzone::GetInstance()->LoadEGLGLES2Bindings(
48 ->GetSurfaceFactoryOzone() 48 base::Bind(&AddGLNativeLibrary),
49 ->LoadEGLGLES2Bindings(base::Bind(&AddGLNativeLibrary), 49 base::Bind(&SetGLGetProcAddressProc)))
50 base::Bind(&SetGLGetProcAddressProc)))
51 return false; 50 return false;
52 SetGLImplementation(kGLImplementationEGLGLES2); 51 SetGLImplementation(kGLImplementationEGLGLES2);
53 InitializeStaticGLBindingsGL(); 52 InitializeStaticGLBindingsGL();
54 InitializeStaticGLBindingsEGL(); 53 InitializeStaticGLBindingsEGL();
55 54
56 // These two functions take single precision float rather than double 55 // These two functions take single precision float rather than double
57 // precision float parameters in GLES. 56 // precision float parameters in GLES.
58 ::gfx::g_driver_gl.fn.glClearDepthFn = MarshalClearDepthToClearDepthf; 57 ::gfx::g_driver_gl.fn.glClearDepthFn = MarshalClearDepthToClearDepthf;
59 ::gfx::g_driver_gl.fn.glDepthRangeFn = MarshalDepthRangeToDepthRangef; 58 ::gfx::g_driver_gl.fn.glDepthRangeFn = MarshalDepthRangeToDepthRangef;
60 break; 59 break;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 switch (GetGLImplementation()) { 108 switch (GetGLImplementation()) {
110 case kGLImplementationEGLGLES2: 109 case kGLImplementationEGLGLES2:
111 return GetGLWindowSystemBindingInfoEGL(info); 110 return GetGLWindowSystemBindingInfoEGL(info);
112 default: 111 default:
113 return false; 112 return false;
114 } 113 }
115 return false; 114 return false;
116 } 115 }
117 116
118 } // namespace gfx 117 } // namespace gfx
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc ('k') | ui/gl/gl_surface_egl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698