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 "third_party/mesa/src/include/GL/osmesa.h" | 10 #include "third_party/mesa/src/include/GL/osmesa.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 case kGLImplementationAppleGL: { | 40 case kGLImplementationAppleGL: { |
41 scoped_refptr<GLSurface> surface(new GLSurfaceNSView(window)); | 41 scoped_refptr<GLSurface> surface(new GLSurfaceNSView(window)); |
42 if (!surface->Initialize()) | 42 if (!surface->Initialize()) |
43 return NULL; | 43 return NULL; |
44 | 44 |
45 return surface; | 45 return surface; |
46 } | 46 } |
47 case kGLImplementationMockGL: | 47 case kGLImplementationMockGL: |
48 return new GLSurfaceStub; | 48 return new GLSurfaceStub; |
49 default: | 49 default: |
50 NOTREACHED(); | 50 NOTREACHED() << GetGLImplementation(); |
51 return NULL; | 51 return NULL; |
52 } | 52 } |
53 } | 53 } |
54 | 54 |
55 scoped_refptr<GLSurface> GLSurface::CreateOffscreenGLSurface( | 55 scoped_refptr<GLSurface> GLSurface::CreateOffscreenGLSurface( |
56 const gfx::Size& size) { | 56 const gfx::Size& size) { |
57 TRACE_EVENT0("gpu", "GLSurface::CreateOffscreenGLSurface"); | 57 TRACE_EVENT0("gpu", "GLSurface::CreateOffscreenGLSurface"); |
58 switch (GetGLImplementation()) { | 58 switch (GetGLImplementation()) { |
59 case kGLImplementationOSMesaGL: { | 59 case kGLImplementationOSMesaGL: { |
60 scoped_refptr<GLSurface> surface(new GLSurfaceOSMesa(OSMESA_RGBA, | 60 scoped_refptr<GLSurface> surface(new GLSurfaceOSMesa(OSMESA_RGBA, |
(...skipping 13 matching lines...) Expand all Loading... |
74 } | 74 } |
75 case kGLImplementationMockGL: | 75 case kGLImplementationMockGL: |
76 return new GLSurfaceStub; | 76 return new GLSurfaceStub; |
77 default: | 77 default: |
78 NOTREACHED(); | 78 NOTREACHED(); |
79 return NULL; | 79 return NULL; |
80 } | 80 } |
81 } | 81 } |
82 | 82 |
83 } // namespace gfx | 83 } // namespace gfx |
OLD | NEW |