| 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 // This include must be here so that the includes provided transitively | 5 // This include must be here so that the includes provided transitively |
| 6 // by gl_surface_egl.h don't make it impossible to compile this code. | 6 // by gl_surface_egl.h don't make it impossible to compile this code. |
| 7 #include "third_party/mesa/src/include/GL/osmesa.h" | 7 #include "third_party/mesa/src/include/GL/osmesa.h" |
| 8 | 8 |
| 9 #include "ui/gl/gl_surface_egl.h" | 9 #include "ui/gl/gl_surface_egl.h" |
| 10 | 10 |
| (...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 | 777 |
| 778 GLSurfaceOSMesaHeadless::GLSurfaceOSMesaHeadless(gfx::AcceleratedWidget window) | 778 GLSurfaceOSMesaHeadless::GLSurfaceOSMesaHeadless(gfx::AcceleratedWidget window) |
| 779 : GLSurfaceOSMesa(OSMESA_BGRA, gfx::Size(1, 1)) { | 779 : GLSurfaceOSMesa(OSMESA_BGRA, gfx::Size(1, 1)) { |
| 780 DCHECK(window); | 780 DCHECK(window); |
| 781 } | 781 } |
| 782 | 782 |
| 783 GLSurfaceOSMesaHeadless::~GLSurfaceOSMesaHeadless() { Destroy(); } | 783 GLSurfaceOSMesaHeadless::~GLSurfaceOSMesaHeadless() { Destroy(); } |
| 784 | 784 |
| 785 // static | 785 // static |
| 786 bool GLSurface::InitializeOneOffInternal() { | 786 bool GLSurface::InitializeOneOffInternal() { |
| 787 switch (GetGLImplementation()) { | 787 if (GetGLImplementation() == kGLImplementationOSMesaGL) { |
| 788 case kGLImplementationEGLGLES2: | 788 return true; |
| 789 if (!GLSurfaceEGL::InitializeOneOff()) { | 789 } |
| 790 LOG(ERROR) << "GLSurfaceEGL::InitializeOneOff failed."; | 790 DCHECK(GetGLImplementation() == kGLImplementationEGLGLES2); |
| 791 return false; | 791 |
| 792 } | 792 if (!GLSurfaceEGL::InitializeOneOff()) { |
| 793 default: | 793 LOG(ERROR) << "GLSurfaceEGL::InitializeOneOff failed."; |
| 794 break; | 794 return false; |
| 795 } | 795 } |
| 796 return true; | 796 return true; |
| 797 } | 797 } |
| 798 | 798 |
| 799 // static | 799 // static |
| 800 scoped_refptr<GLSurface> | 800 scoped_refptr<GLSurface> |
| 801 GLSurface::CreateViewGLSurface(gfx::AcceleratedWidget window) { | 801 GLSurface::CreateViewGLSurface(gfx::AcceleratedWidget window) { |
| 802 | 802 |
| 803 if (GetGLImplementation() == kGLImplementationOSMesaGL) { | 803 if (GetGLImplementation() == kGLImplementationOSMesaGL) { |
| 804 scoped_refptr<GLSurface> surface(new GLSurfaceOSMesaHeadless(window)); | 804 scoped_refptr<GLSurface> surface(new GLSurfaceOSMesaHeadless(window)); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 852 } | 852 } |
| 853 default: | 853 default: |
| 854 NOTREACHED(); | 854 NOTREACHED(); |
| 855 return NULL; | 855 return NULL; |
| 856 } | 856 } |
| 857 } | 857 } |
| 858 | 858 |
| 859 #endif | 859 #endif |
| 860 | 860 |
| 861 } // namespace gfx | 861 } // namespace gfx |
| OLD | NEW |