Index: core/cross/gl/renderer_gl.h |
=================================================================== |
--- core/cross/gl/renderer_gl.h (revision 26426) |
+++ core/cross/gl/renderer_gl.h (working copy) |
@@ -65,17 +65,14 @@ |
// Released all hardware resources. |
virtual void Destroy(); |
- // Turns fullscreen display on or off. |
- // Parameters: |
- // fullscreen: true for fullscreen, false for in-browser display |
- // display: a platform-specific display identifier |
- // mode_id: a mode returned by GetDisplayModes, for fullscreen use. |
- // (Ignored in non-fullscreen mode.) |
- // Returns true on success, false on failure. |
- virtual bool SetFullscreen(bool fullscreen, |
- const DisplayWindow& display, |
- int mode_id); |
+ // Overridden from Renderer. |
+ virtual bool GoFullscreen(const DisplayWindow& display, |
+ int mode_id); |
+ // Overridden from Renderer. |
+ virtual bool CancelFullscreen(const DisplayWindow& display, |
+ int width, int height); |
+ |
// Tells whether we're currently displayed fullscreen or not. |
virtual bool fullscreen() const { |
return fullscreen_; |
@@ -118,23 +115,35 @@ |
// Makes this renderer active on the current thread if it is not active |
// already. |
void MakeCurrentLazy() { |
- if (!IsCurrent()) MakeCurrent(); |
+ if (!IsCurrent()) |
+ MakeCurrent(); |
} |
// Returns whether or not this renderer is active on the current thread. |
- // In the Mac case, also requires the correct GL context to be active. |
// Don't worry, the "get" calls are el cheapo. |
bool IsCurrent() { |
-#ifdef OS_MACOSX |
+#if defined(OS_MACOSX) |
if ((mac_agl_context_ != NULL) && |
- (mac_agl_context_ != aglGetCurrentContext())) { |
- return false; |
+ (mac_agl_context_ == aglGetCurrentContext())) { |
+ return true; |
} else if ((mac_cgl_context_ != NULL) && |
- (mac_cgl_context_ != CGLGetCurrentContext())) { |
- return false; |
+ (mac_cgl_context_ == CGLGetCurrentContext())) { |
+ return true; |
} |
+#elif defined(OS_WIN) |
+ if ((gl_context_ != NULL) && |
+ (gl_context_ == wglGetCurrentContext())) { |
+ return true; |
+ } |
+#elif defined(OS_LINUX) |
+ if ((context_ != NULL) && |
+ (context_ == glXGetCurrentContext())) { |
+ return true; |
+ } |
+#else |
+ Error: must port RendererGL::IsCurrent() to your platform. |
#endif |
- return this == current_renderer_; |
+ return false; |
} |
// Makes this renderer active on the current thread. |
@@ -221,12 +230,6 @@ |
ServiceDependency<SemanticManager> semantic_manager_; |
- // Current renderer, tracking which renderer has last called wglMakeCurrent |
- // (or equivalent on other platforms). |
- // NOTE: this should really be thread-local, but since we don't handle |
- // multiple threads currently, this is enough. |
- static RendererGL *current_renderer_; |
- |
// Indicates we're rendering fullscreen rather than in the plugin region. |
bool fullscreen_; |