18 #ifndef ION_PORTGFX_VISUAL_H_
19 #define ION_PORTGFX_VISUAL_H_
23 #include "base/integral_types.h"
24 #include "base/macros.h"
46 bool IsCurrent()
const {
return this == GetCurrent(); }
51 virtual bool IsValid()
const;
54 size_t GetId()
const {
return id_; }
58 int GetGlVersion()
const;
63 static void RefreshCurrentVisual();
77 static const Visual* GetCurrent();
81 static std::unique_ptr<Visual> CreateVisual();
85 static std::unique_ptr<Visual> CreateVisualInCurrentShareGroup();
90 static bool MakeCurrent(
const Visual* new_current);
96 static void DestroyWrappingVisual(
const Visual* visual);
101 static size_t GetCurrentId();
109 virtual Visual* CreateVisualInShareGroup()
const;
114 virtual bool MakeCurrent()
const;
117 virtual void TeardownContextNew();
121 virtual void TeardownContextShared();
124 virtual void UpdateId();
136 static void TeardownVisual(
Visual* visual);
140 static void RegisterVisual(
Visual *visual);
164 explicit Visual(Type
type);
167 std::unique_ptr<VisualInfo> visual_;
175 friend class MockVisual;
177 DISALLOW_COPY_AND_ASSIGN(
Visual);
183 #endif // ION_PORTGFX_VISUAL_H_
bool IsCurrent() const
Return true if this is the current Visual on this thread.
size_t GetId() const
Returns the ID associated with this Visual.
Opaque class that sets up an offscreen OpenGL context/surface/visual in a platform-specific way to al...
void SetId(size_t id)
Sets the ID of this.