| 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 "ui/gl/gl_surface.h" | 5 #include "ui/gl/gl_surface.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| 11 #include "third_party/mesa/src/include/GL/osmesa.h" | 11 #include "third_party/mesa/src/include/GL/osmesa.h" |
| 12 #include "ui/gfx/native_widget_types.h" |
| 12 #include "ui/gl/gl_bindings.h" | 13 #include "ui/gl/gl_bindings.h" |
| 13 #include "ui/gl/gl_implementation.h" | 14 #include "ui/gl/gl_implementation.h" |
| 14 #include "ui/gl/gl_surface_egl.h" | 15 #include "ui/gl/gl_surface_egl.h" |
| 15 #include "ui/gl/gl_surface_glx.h" | 16 #include "ui/gl/gl_surface_glx.h" |
| 16 #include "ui/gl/gl_surface_osmesa.h" | 17 #include "ui/gl/gl_surface_osmesa.h" |
| 17 #include "ui/gl/gl_surface_stub.h" | 18 #include "ui/gl/gl_surface_stub.h" |
| 18 | 19 |
| 19 namespace gfx { | 20 namespace gfx { |
| 20 | 21 |
| 21 // This OSMesa GL surface can use XLib to swap the contents of the buffer to a | 22 // This OSMesa GL surface can use XLib to swap the contents of the buffer to a |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 return surface; | 287 return surface; |
| 287 } | 288 } |
| 288 case kGLImplementationDesktopGL: { | 289 case kGLImplementationDesktopGL: { |
| 289 scoped_refptr<GLSurface> surface(new NativeViewGLSurfaceGLX(window)); | 290 scoped_refptr<GLSurface> surface(new NativeViewGLSurfaceGLX(window)); |
| 290 if (!surface->Initialize()) | 291 if (!surface->Initialize()) |
| 291 return NULL; | 292 return NULL; |
| 292 | 293 |
| 293 return surface; | 294 return surface; |
| 294 } | 295 } |
| 295 case kGLImplementationEGLGLES2: { | 296 case kGLImplementationEGLGLES2: { |
| 297 DCHECK(window != gfx::kNullAcceleratedWidget); |
| 296 scoped_refptr<GLSurface> surface(new NativeViewGLSurfaceEGL(window)); | 298 scoped_refptr<GLSurface> surface(new NativeViewGLSurfaceEGL(window)); |
| 297 if (!surface->Initialize()) | 299 if (!surface->Initialize()) |
| 298 return NULL; | 300 return NULL; |
| 299 | 301 |
| 300 return surface; | 302 return surface; |
| 301 } | 303 } |
| 302 case kGLImplementationMockGL: | 304 case kGLImplementationMockGL: |
| 303 return new GLSurfaceStub; | 305 return new GLSurfaceStub; |
| 304 default: | 306 default: |
| 305 NOTREACHED(); | 307 NOTREACHED(); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 335 } | 337 } |
| 336 case kGLImplementationMockGL: | 338 case kGLImplementationMockGL: |
| 337 return new GLSurfaceStub; | 339 return new GLSurfaceStub; |
| 338 default: | 340 default: |
| 339 NOTREACHED(); | 341 NOTREACHED(); |
| 340 return NULL; | 342 return NULL; |
| 341 } | 343 } |
| 342 } | 344 } |
| 343 | 345 |
| 344 } // namespace gfx | 346 } // namespace gfx |
| OLD | NEW |