diff options
Diffstat (limited to 'chromium/ui/gl/gl_context_cgl.cc')
-rw-r--r-- | chromium/ui/gl/gl_context_cgl.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/chromium/ui/gl/gl_context_cgl.cc b/chromium/ui/gl/gl_context_cgl.cc index 7d4fc5d5279..02c0e34efc0 100644 --- a/chromium/ui/gl/gl_context_cgl.cc +++ b/chromium/ui/gl/gl_context_cgl.cc @@ -33,9 +33,9 @@ bool g_support_renderer_switching; } // namespace -static CGLPixelFormatObj GetPixelFormat() { +static CGLPixelFormatObj GetPixelFormat(const int core_profile = 0) { static CGLPixelFormatObj format; - if (format) + if (format && core_profile == 0) return format; std::vector<CGLPixelFormatAttribute> attribs; // If the system supports dual gpus then allow offline renderers for every @@ -53,9 +53,8 @@ static CGLPixelFormatObj GetPixelFormat() { // These constants don't exist in the 10.6 SDK against which // Chromium currently compiles. const int kOpenGLProfile = 99; - const int kOpenGL3_2Core = 0x3200; attribs.push_back(static_cast<CGLPixelFormatAttribute>(kOpenGLProfile)); - attribs.push_back(static_cast<CGLPixelFormatAttribute>(kOpenGL3_2Core)); + attribs.push_back(static_cast<CGLPixelFormatAttribute>(core_profile)); } attribs.push_back((CGLPixelFormatAttribute) 0); @@ -75,8 +74,9 @@ static CGLPixelFormatObj GetPixelFormat() { return format; } -GLContextCGL::GLContextCGL(GLShareGroup* share_group) - : GLContextReal(share_group) {} +GLContextCGL::GLContextCGL(GLShareGroup* share_group, int core_profile_number) + : GLContextReal(share_group) + , core_profile_number_(core_profile_number) {} bool GLContextCGL::Initialize(GLSurface* compatible_surface, const GLContextAttribs& attribs) { @@ -93,7 +93,7 @@ bool GLContextCGL::Initialize(GLSurface* compatible_surface, GLContextCGL* share_context = share_group() ? static_cast<GLContextCGL*>(share_group()->GetContext()) : nullptr; - CGLPixelFormatObj format = GetPixelFormat(); + CGLPixelFormatObj format = GetPixelFormat(core_profile_number_); if (!format) return false; |