| Index: ui/gfx/gl/gl_context_mac.mm
|
| diff --git a/ui/gfx/gl/gl_context_mac.cc b/ui/gfx/gl/gl_context_mac.mm
|
| similarity index 86%
|
| rename from ui/gfx/gl/gl_context_mac.cc
|
| rename to ui/gfx/gl/gl_context_mac.mm
|
| index 0c870e21726672dff608fe795a4d5fea110b7b4a..508ccf925f0ba11cd62a69c97886c5f71d6e3b23 100644
|
| --- a/ui/gfx/gl/gl_context_mac.cc
|
| +++ b/ui/gfx/gl/gl_context_mac.mm
|
| @@ -13,8 +13,11 @@
|
| #include "ui/gfx/gl/gl_context_osmesa.h"
|
| #include "ui/gfx/gl/gl_context_stub.h"
|
| #include "ui/gfx/gl/gl_implementation.h"
|
| -#include "ui/gfx/gl/gl_surface_cgl.h"
|
| -#include "ui/gfx/gl/gl_surface_osmesa.h"
|
| +#include "ui/gfx/gl/gl_surface.h"
|
| +
|
| +#if defined(USE_AURA)
|
| +#include "ui/gfx/gl/gl_context_nsview.h"
|
| +#endif
|
|
|
| namespace {
|
|
|
| @@ -38,9 +41,18 @@ scoped_refptr<GLContext> GLContext::CreateGLContext(
|
| GpuPreference gpu_preference) {
|
| switch (GetGLImplementation()) {
|
| case kGLImplementationDesktopGL: {
|
| - scoped_refptr<GLContext> context(new GLContextCGL(share_group));
|
| - if (!context->Initialize(compatible_surface, gpu_preference))
|
| - return NULL;
|
| + scoped_refptr<GLContext> context;
|
| + if (compatible_surface->IsOffscreen()) {
|
| + context = new GLContextCGL(share_group);
|
| + if (!context->Initialize(compatible_surface, gpu_preference))
|
| + return NULL;
|
| + } else {
|
| +#if defined(USE_AURA)
|
| + context = new GLContextNSView(share_group);
|
| + if (!context->Initialize(compatible_surface, gpu_preference))
|
| + return NULL;
|
| +#endif
|
| + }
|
|
|
| return context;
|
| }
|
|
|