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_bindings.h" | 9 #include "ui/gl/gl_bindings.h" |
10 #include "ui/gl/gl_context.h" | 10 #include "ui/gl/gl_context.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 } | 120 } |
121 | 121 |
122 scoped_refptr<GLSurface> CreateViewGLSurface(gfx::AcceleratedWidget window) { | 122 scoped_refptr<GLSurface> CreateViewGLSurface(gfx::AcceleratedWidget window) { |
123 TRACE_EVENT0("gpu", "gl::init::CreateViewGLSurface"); | 123 TRACE_EVENT0("gpu", "gl::init::CreateViewGLSurface"); |
124 CHECK_NE(kGLImplementationNone, GetGLImplementation()); | 124 CHECK_NE(kGLImplementationNone, GetGLImplementation()); |
125 switch (GetGLImplementation()) { | 125 switch (GetGLImplementation()) { |
126 case kGLImplementationOSMesaGL: | 126 case kGLImplementationOSMesaGL: |
127 return InitializeGLSurface(new GLSurfaceOSMesaHeadless()); | 127 return InitializeGLSurface(new GLSurfaceOSMesaHeadless()); |
128 case kGLImplementationEGLGLES2: | 128 case kGLImplementationEGLGLES2: |
129 if (window != gfx::kNullAcceleratedWidget) { | 129 if (window != gfx::kNullAcceleratedWidget) { |
130 return InitializeGLSurface(new NativeViewGLSurfaceEGL(window)); | 130 return InitializeGLSurface(new NativeViewGLSurfaceEGL(window, nullptr)); |
131 } else { | 131 } else { |
132 return InitializeGLSurface(new GLSurfaceStub()); | 132 return InitializeGLSurface(new GLSurfaceStub()); |
133 } | 133 } |
134 default: | 134 default: |
135 NOTREACHED(); | 135 NOTREACHED(); |
136 return nullptr; | 136 return nullptr; |
137 } | 137 } |
138 } | 138 } |
139 | 139 |
140 scoped_refptr<GLSurface> CreateOffscreenGLSurfaceWithFormat( | 140 scoped_refptr<GLSurface> CreateOffscreenGLSurfaceWithFormat( |
(...skipping 20 matching lines...) Expand all Loading... |
161 case kGLImplementationStubGL: | 161 case kGLImplementationStubGL: |
162 return new GLSurfaceStub; | 162 return new GLSurfaceStub; |
163 default: | 163 default: |
164 NOTREACHED(); | 164 NOTREACHED(); |
165 return nullptr; | 165 return nullptr; |
166 } | 166 } |
167 } | 167 } |
168 | 168 |
169 } // namespace init | 169 } // namespace init |
170 } // namespace gl | 170 } // namespace gl |
OLD | NEW |