| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ui/gl/init/gl_factory.h" | 5 #include "ui/gl/init/gl_factory.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.h" |
| 9 #include "ui/gl/gl_context.h" | 9 #include "ui/gl/gl_context.h" |
| 10 #include "ui/gl/gl_context_egl.h" | 10 #include "ui/gl/gl_context_egl.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 return GetGLWindowSystemBindingInfoWGL(info); | 40 return GetGLWindowSystemBindingInfoWGL(info); |
| 41 case kGLImplementationEGLGLES2: | 41 case kGLImplementationEGLGLES2: |
| 42 return GetGLWindowSystemBindingInfoEGL(info); | 42 return GetGLWindowSystemBindingInfoEGL(info); |
| 43 default: | 43 default: |
| 44 return false; | 44 return false; |
| 45 } | 45 } |
| 46 } | 46 } |
| 47 | 47 |
| 48 scoped_refptr<GLContext> CreateGLContext(GLShareGroup* share_group, | 48 scoped_refptr<GLContext> CreateGLContext(GLShareGroup* share_group, |
| 49 GLSurface* compatible_surface, | 49 GLSurface* compatible_surface, |
| 50 GpuPreference gpu_preference) { | 50 const GLContextAttribs& attribs) { |
| 51 TRACE_EVENT0("gpu", "gl::init::CreateGLContext"); | 51 TRACE_EVENT0("gpu", "gl::init::CreateGLContext"); |
| 52 switch (GetGLImplementation()) { | 52 switch (GetGLImplementation()) { |
| 53 case kGLImplementationOSMesaGL: | 53 case kGLImplementationOSMesaGL: |
| 54 return InitializeGLContext(new GLContextOSMesa(share_group), | 54 return InitializeGLContext(new GLContextOSMesa(share_group), |
| 55 compatible_surface, gpu_preference); | 55 compatible_surface, attribs); |
| 56 case kGLImplementationEGLGLES2: | 56 case kGLImplementationEGLGLES2: |
| 57 return InitializeGLContext(new GLContextEGL(share_group), | 57 return InitializeGLContext(new GLContextEGL(share_group), |
| 58 compatible_surface, gpu_preference); | 58 compatible_surface, attribs); |
| 59 case kGLImplementationDesktopGL: | 59 case kGLImplementationDesktopGL: |
| 60 return InitializeGLContext(new GLContextWGL(share_group), | 60 return InitializeGLContext(new GLContextWGL(share_group), |
| 61 compatible_surface, gpu_preference); | 61 compatible_surface, attribs); |
| 62 case kGLImplementationMockGL: | 62 case kGLImplementationMockGL: |
| 63 return new GLContextStub(share_group); | 63 return new GLContextStub(share_group); |
| 64 default: | 64 default: |
| 65 NOTREACHED(); | 65 NOTREACHED(); |
| 66 return nullptr; | 66 return nullptr; |
| 67 } | 67 } |
| 68 } | 68 } |
| 69 | 69 |
| 70 scoped_refptr<GLSurface> CreateViewGLSurface(gfx::AcceleratedWidget window) { | 70 scoped_refptr<GLSurface> CreateViewGLSurface(gfx::AcceleratedWidget window) { |
| 71 TRACE_EVENT0("gpu", "gl::init::CreateViewGLSurface"); | 71 TRACE_EVENT0("gpu", "gl::init::CreateViewGLSurface"); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 case kGLImplementationMockGL: | 106 case kGLImplementationMockGL: |
| 107 return new GLSurfaceStub; | 107 return new GLSurfaceStub; |
| 108 default: | 108 default: |
| 109 NOTREACHED(); | 109 NOTREACHED(); |
| 110 return nullptr; | 110 return nullptr; |
| 111 } | 111 } |
| 112 } | 112 } |
| 113 | 113 |
| 114 } // namespace init | 114 } // namespace init |
| 115 } // namespace gl | 115 } // namespace gl |
| OLD | NEW |