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 <dwmapi.h> | 7 #include <dwmapi.h> |
8 | 8 |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 scoped_refptr<GLSurface> surface( | 223 scoped_refptr<GLSurface> surface( |
224 new NativeViewGLSurfaceOSMesa(window)); | 224 new NativeViewGLSurfaceOSMesa(window)); |
225 if (!surface->Initialize()) | 225 if (!surface->Initialize()) |
226 return NULL; | 226 return NULL; |
227 | 227 |
228 return surface; | 228 return surface; |
229 } | 229 } |
230 case kGLImplementationEGLGLES2: { | 230 case kGLImplementationEGLGLES2: { |
231 scoped_refptr<NativeViewGLSurfaceEGL> surface( | 231 scoped_refptr<NativeViewGLSurfaceEGL> surface( |
232 new NativeViewGLSurfaceEGL(window)); | 232 new NativeViewGLSurfaceEGL(window)); |
233 DWMVSyncProvider* sync_provider = NULL; | 233 scoped_ptr<VSyncProvider> sync_provider; |
234 if (base::win::GetVersion() >= base::win::VERSION_VISTA) | 234 if (base::win::GetVersion() >= base::win::VERSION_VISTA) |
235 sync_provider = new DWMVSyncProvider; | 235 sync_provider.reset(new DWMVSyncProvider); |
236 if (!surface->Initialize(sync_provider)) | 236 if (!surface->Initialize(sync_provider.Pass())) |
237 return NULL; | 237 return NULL; |
238 | 238 |
239 return surface; | 239 return surface; |
240 } | 240 } |
241 case kGLImplementationDesktopGL: { | 241 case kGLImplementationDesktopGL: { |
242 scoped_refptr<GLSurface> surface(new NativeViewGLSurfaceWGL( | 242 scoped_refptr<GLSurface> surface(new NativeViewGLSurfaceWGL( |
243 window)); | 243 window)); |
244 if (!surface->Initialize()) | 244 if (!surface->Initialize()) |
245 return NULL; | 245 return NULL; |
246 | 246 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 } | 282 } |
283 case kGLImplementationMockGL: | 283 case kGLImplementationMockGL: |
284 return new GLSurfaceStub; | 284 return new GLSurfaceStub; |
285 default: | 285 default: |
286 NOTREACHED(); | 286 NOTREACHED(); |
287 return NULL; | 287 return NULL; |
288 } | 288 } |
289 } | 289 } |
290 | 290 |
291 } // namespace gfx | 291 } // namespace gfx |
OLD | NEW |