| Index: ui/gl/gl_context_cgl.h
|
| diff --git a/ui/gl/gl_context_glx.h b/ui/gl/gl_context_cgl.h
|
| similarity index 55%
|
| copy from ui/gl/gl_context_glx.h
|
| copy to ui/gl/gl_context_cgl.h
|
| index 6973542c0aa25b9824331e8bf5a9035bd4514b20..88813b39cc197b298ec4a34889a5fb003067aa8b 100644
|
| --- a/ui/gl/gl_context_glx.h
|
| +++ b/ui/gl/gl_context_cgl.h
|
| @@ -2,26 +2,21 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef UI_GL_GL_CONTEXT_GLX_H_
|
| -#define UI_GL_GL_CONTEXT_GLX_H_
|
| +#ifndef UI_GL_GL_CONTEXT_CGL_H_
|
| +#define UI_GL_GL_CONTEXT_CGL_H_
|
|
|
| -#include <string>
|
| +#include <OpenGL/CGLTypes.h>
|
|
|
| -#include "base/compiler_specific.h"
|
| -#include "ui/gfx/x/x11_types.h"
|
| #include "ui/gl/gl_context.h"
|
| -#include "ui/gl/gl_export.h"
|
|
|
| namespace gfx {
|
|
|
| class GLSurface;
|
|
|
| -// Encapsulates a GLX OpenGL context.
|
| -class GL_EXPORT GLContextGLX : public GLContextReal {
|
| +// Encapsulates a CGL OpenGL context.
|
| +class GLContextCGL : public GLContextReal {
|
| public:
|
| - explicit GLContextGLX(GLShareGroup* share_group);
|
| -
|
| - XDisplay* display();
|
| + explicit GLContextCGL(GLShareGroup* share_group);
|
|
|
| // Implement GLContext.
|
| bool Initialize(GLSurface* compatible_surface,
|
| @@ -32,20 +27,28 @@ class GL_EXPORT GLContextGLX : public GLContextReal {
|
| bool IsCurrent(GLSurface* surface) override;
|
| void* GetHandle() override;
|
| void OnSetSwapInterval(int interval) override;
|
| - std::string GetExtensions() override;
|
| bool GetTotalGpuMemory(size_t* bytes) override;
|
| - bool WasAllocatedUsingRobustnessExtension() override;
|
| + void SetSafeToForceGpuSwitch() override;
|
| + bool ForceGpuSwitchIfNeeded() override;
|
|
|
| protected:
|
| - ~GLContextGLX() override;
|
| + ~GLContextCGL() override;
|
|
|
| private:
|
| + GpuPreference GetGpuPreference();
|
| +
|
| void* context_;
|
| - XDisplay* display_;
|
| + GpuPreference gpu_preference_;
|
| +
|
| + CGLPixelFormatObj discrete_pixelformat_;
|
| +
|
| + int screen_;
|
| + int renderer_id_;
|
| + bool safe_to_force_gpu_switch_;
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(GLContextGLX);
|
| + DISALLOW_COPY_AND_ASSIGN(GLContextCGL);
|
| };
|
|
|
| } // namespace gfx
|
|
|
| -#endif // UI_GL_GL_CONTEXT_GLX_H_
|
| +#endif // UI_GL_GL_CONTEXT_CGL_H_
|
|
|