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 <stdlib.h> | 5 #include <stdlib.h> |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <dwmapi.h> | 8 #include <dwmapi.h> |
9 #include <windows.h> | 9 #include <windows.h> |
10 #endif | 10 #endif |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 child_thread->StopWatchdog(); | 376 child_thread->StopWatchdog(); |
377 | 377 |
378 return 0; | 378 return 0; |
379 } | 379 } |
380 | 380 |
381 namespace { | 381 namespace { |
382 | 382 |
383 #if defined(OS_LINUX) | 383 #if defined(OS_LINUX) |
384 void CreateDummyGlContext() { | 384 void CreateDummyGlContext() { |
385 scoped_refptr<gfx::GLSurface> surface( | 385 scoped_refptr<gfx::GLSurface> surface( |
386 gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1))); | 386 gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size())); |
387 if (!surface.get()) { | 387 if (!surface.get()) { |
388 VLOG(1) << "gfx::GLSurface::CreateOffscreenGLSurface failed"; | 388 VLOG(1) << "gfx::GLSurface::CreateOffscreenGLSurface failed"; |
389 return; | 389 return; |
390 } | 390 } |
391 | 391 |
392 // On Linux, this is needed to make sure /dev/nvidiactl has | 392 // On Linux, this is needed to make sure /dev/nvidiactl has |
393 // been opened and its descriptor cached. | 393 // been opened and its descriptor cached. |
394 scoped_refptr<gfx::GLContext> context(gfx::GLContext::CreateGLContext( | 394 scoped_refptr<gfx::GLContext> context(gfx::GLContext::CreateGLContext( |
395 NULL, surface.get(), gfx::PreferDiscreteGpu)); | 395 NULL, surface.get(), gfx::PreferDiscreteGpu)); |
396 if (!context.get()) { | 396 if (!context.get()) { |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 return true; | 468 return true; |
469 } | 469 } |
470 | 470 |
471 return false; | 471 return false; |
472 } | 472 } |
473 #endif // defined(OS_WIN) | 473 #endif // defined(OS_WIN) |
474 | 474 |
475 } // namespace. | 475 } // namespace. |
476 | 476 |
477 } // namespace content | 477 } // namespace content |
OLD | NEW |