Chromium Code Reviews

Side by Side Diff: app/gfx/gl/gl_context_win.cc

Issue 5087001: Fixed stack overflow if wglGetExtensionsStringARB is not available.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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...)
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...)
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine