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

Unified Diff: core/cross/gl/renderer_gl.h

Issue 210005: Rewrote full-screen support on Windows. O3D now always creates its own... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
Patch Set: '' Created 11 years, 3 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 | « no previous file | core/cross/gl/renderer_gl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « no previous file | core/cross/gl/renderer_gl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698