Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Unified Diff: ui/gl/gl_context_cgl.h

Issue 1238983002: Initial ui/gl updates for Mac Sky shell target (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gl/BUILD.gn ('k') | ui/gl/gl_context_cgl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « ui/gl/BUILD.gn ('k') | ui/gl/gl_context_cgl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698