diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-28 01:42:43 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-28 01:42:43 +0000 |
commit | 13a11245535fb8332c1b416d3e7e5d82f6b3a17a (patch) | |
tree | 2c1518e242c68f0dd124f61cd004d0fadb6c9dce /ui | |
parent | 60ab3570d2f3355c1c0aa7fed780cf351ed2d940 (diff) | |
download | chromium_src-13a11245535fb8332c1b416d3e7e5d82f6b3a17a.zip chromium_src-13a11245535fb8332c1b416d3e7e5d82f6b3a17a.tar.gz chromium_src-13a11245535fb8332c1b416d3e7e5d82f6b3a17a.tar.bz2 |
Manual merge of 83248.
Removed "compositor" child window that was created by the GPU process.Removed the sync IPC that it used to ask the browser process to resize on Linux. Adapted windows to use the same mechanism.TEST=test webgl pages on windows (ANGLE and GL), linux and mac, run try job on windows, linux, mac. checkdeps failure look unrelated to patch.
BUG=77536
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=83248
git-svn-id: svn://svn.chromium.org/chrome/branches/742/src@83276 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/gfx/gl/gl_context.cc | 9 | ||||
-rw-r--r-- | ui/gfx/gl/gl_context.h | 10 | ||||
-rw-r--r-- | ui/gfx/gl/gl_context_egl.cc | 18 | ||||
-rw-r--r-- | ui/gfx/gl/gl_context_egl.h | 4 | ||||
-rw-r--r-- | ui/gfx/gl/gl_surface.cc | 4 | ||||
-rw-r--r-- | ui/gfx/gl/gl_surface.h | 6 |
6 files changed, 49 insertions, 2 deletions
diff --git a/ui/gfx/gl/gl_context.cc b/ui/gfx/gl/gl_context.cc index 847c9bb..630925d 100644 --- a/ui/gfx/gl/gl_context.cc +++ b/ui/gfx/gl/gl_context.cc @@ -13,6 +13,15 @@ namespace gfx { +void GLContext::ReleaseCurrent() { + // TODO(apatrick): Implement this in GLContext derivatives. +} + +GLSurface* GLContext::GetSurface() { + // TODO(apatrick): Remove this when surfaces are split from contexts. + return NULL; +} + unsigned int GLContext::GetBackingFrameBufferObject() { return 0; } diff --git a/ui/gfx/gl/gl_context.h b/ui/gfx/gl/gl_context.h index f39a77a..b27f8c9 100644 --- a/ui/gfx/gl/gl_context.h +++ b/ui/gfx/gl/gl_context.h @@ -14,6 +14,8 @@ namespace gfx { +class GLSurface; + // Encapsulates an OpenGL context, hiding platform specific management. class GLContext { public: @@ -26,6 +28,10 @@ class GLContext { // Makes the GL context current on the current thread. virtual bool MakeCurrent() = 0; + // Releases this GL context as current on the current thread. TODO(apatrick): + // implement this in the other GLContexts. + virtual void ReleaseCurrent(); + // Returns true if this context is current. virtual bool IsCurrent() = 0; @@ -39,6 +45,10 @@ class GLContext { // Get the size of the back buffer. virtual gfx::Size GetSize() = 0; + // Get the surface. TODO(apatrick): remove this when contexts are split from + // surfaces. + virtual GLSurface* GetSurface(); + // Get the underlying platform specific GL context "handle". virtual void* GetHandle() = 0; diff --git a/ui/gfx/gl/gl_context_egl.cc b/ui/gfx/gl/gl_context_egl.cc index 8f64041..0093e7f 100644 --- a/ui/gfx/gl/gl_context_egl.cc +++ b/ui/gfx/gl/gl_context_egl.cc @@ -111,9 +111,20 @@ bool GLContextEGL::MakeCurrent() { return true; } +void GLContextEGL::ReleaseCurrent() { + if (!IsCurrent()) + return; + + eglMakeCurrent(GLSurfaceEGL::GetDisplay(), + EGL_NO_SURFACE, + EGL_NO_SURFACE, + EGL_NO_CONTEXT); +} + bool GLContextEGL::IsCurrent() { DCHECK(context_); - return context_ == eglGetCurrentContext(); + return context_ == eglGetCurrentContext() && + surface_->GetHandle() == eglGetCurrentSurface(EGL_DRAW); } bool GLContextEGL::IsOffscreen() { @@ -131,6 +142,11 @@ gfx::Size GLContextEGL::GetSize() { return surface_->GetSize(); } +GLSurface* GLContextEGL::GetSurface() { + // TODO(apatrick): remove this from GLContext interface. + return surface_.get(); +} + void* GLContextEGL::GetHandle() { return context_; } diff --git a/ui/gfx/gl/gl_context_egl.h b/ui/gfx/gl/gl_context_egl.h index 43cbe922..7337d22 100644 --- a/ui/gfx/gl/gl_context_egl.h +++ b/ui/gfx/gl/gl_context_egl.h @@ -18,7 +18,7 @@ namespace gfx { class GLSurfaceEGL; -// Encapsulates an EGL OpenGL ES context that renders to a view. +// Encapsulates an EGL OpenGL ES context. class GLContextEGL : public GLContext { public: // Takes ownership of surface. TODO(apatrick): separate notion of surface @@ -33,10 +33,12 @@ class GLContextEGL : public GLContext { // Implement GLContext. virtual void Destroy(); virtual bool MakeCurrent(); + virtual void ReleaseCurrent(); virtual bool IsCurrent(); virtual bool IsOffscreen(); virtual bool SwapBuffers(); virtual gfx::Size GetSize(); + virtual GLSurface* GetSurface(); virtual void* GetHandle(); virtual void SetSwapInterval(int interval); virtual std::string GetExtensions(); diff --git a/ui/gfx/gl/gl_surface.cc b/ui/gfx/gl/gl_surface.cc index b1dd505..882b393 100644 --- a/ui/gfx/gl/gl_surface.cc +++ b/ui/gfx/gl/gl_surface.cc @@ -6,6 +6,10 @@ namespace gfx { +bool GLSurface::Initialize() { + return true; +} + unsigned int GLSurface::GetBackingFrameBufferObject() { return 0; } diff --git a/ui/gfx/gl/gl_surface.h b/ui/gfx/gl/gl_surface.h index 811b232..ca8afd1 100644 --- a/ui/gfx/gl/gl_surface.h +++ b/ui/gfx/gl/gl_surface.h @@ -19,6 +19,12 @@ class GLSurface { GLSurface() {} virtual ~GLSurface() {} + // (Re)create the surface. TODO(apatrick): This is an ugly hack to allow the + // EGL surface associated to be recreated without destroying the associated + // context. The implementation of this function for other GLSurface derived + // classes is in a pending changelist. + virtual bool Initialize(); + // Destroys the surface. virtual void Destroy() = 0; |