| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 file implements the NativeViewGLContext and PbufferGLContext classes. | 5 // This file implements the NativeViewGLContext and PbufferGLContext classes. |
| 6 | 6 |
| 7 #include "app/gfx/gl/gl_context.h" | 7 #include "app/gfx/gl/gl_context.h" |
| 8 | 8 |
| 9 #include <GL/osmesa.h> | 9 #include <GL/osmesa.h> |
| 10 | 10 |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 | 326 |
| 327 | 327 |
| 328 std::string BaseWinGLContext::GetExtensions() { | 328 std::string BaseWinGLContext::GetExtensions() { |
| 329 if (wglGetExtensionsStringARB) { | 329 if (wglGetExtensionsStringARB) { |
| 330 const char* extensions = wglGetExtensionsStringARB(GetDC()); | 330 const char* extensions = wglGetExtensionsStringARB(GetDC()); |
| 331 if (extensions) { | 331 if (extensions) { |
| 332 return GLContext::GetExtensions() + " " + extensions; | 332 return GLContext::GetExtensions() + " " + extensions; |
| 333 } | 333 } |
| 334 } | 334 } |
| 335 | 335 |
| 336 return GetExtensions(); | 336 return GLContext::GetExtensions(); |
| 337 } | 337 } |
| 338 | 338 |
| 339 bool NativeViewGLContext::Initialize(bool multisampled) { | 339 bool NativeViewGLContext::Initialize(bool multisampled) { |
| 340 // The GL context will render to this window. | 340 // The GL context will render to this window. |
| 341 device_context_ = ::GetDC(window_); | 341 device_context_ = ::GetDC(window_); |
| 342 | 342 |
| 343 int pixel_format = | 343 int pixel_format = |
| 344 multisampled ? g_multisampled_pixel_format : g_regular_pixel_format; | 344 multisampled ? g_multisampled_pixel_format : g_regular_pixel_format; |
| 345 if (!SetPixelFormat(device_context_, | 345 if (!SetPixelFormat(device_context_, |
| 346 pixel_format, | 346 pixel_format, |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 } | 729 } |
| 730 case kGLImplementationMockGL: | 730 case kGLImplementationMockGL: |
| 731 return new StubGLContext; | 731 return new StubGLContext; |
| 732 default: | 732 default: |
| 733 NOTREACHED(); | 733 NOTREACHED(); |
| 734 return NULL; | 734 return NULL; |
| 735 } | 735 } |
| 736 } | 736 } |
| 737 | 737 |
| 738 } // namespace gfx | 738 } // namespace gfx |
| OLD | NEW |