diff options
author | backer@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-22 18:41:29 +0000 |
---|---|---|
committer | backer@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-22 18:41:29 +0000 |
commit | 2e7bbf2913e4327aab57e5c1b440c13711241609 (patch) | |
tree | ea7833ea4c0d051a0d3ef626c33fd043c4fea2f9 /ui | |
parent | c620fd59c67f5421b75e865075fb4e9aa2c24f7f (diff) | |
download | chromium_src-2e7bbf2913e4327aab57e5c1b440c13711241609.zip chromium_src-2e7bbf2913e4327aab57e5c1b440c13711241609.tar.gz chromium_src-2e7bbf2913e4327aab57e5c1b440c13711241609.tar.bz2 |
Create new GLSurface for cross process image transport.
Currently cross process image transport (on OSX and TOUCH_UI) uses the WebGL code path to render to a texture via FBO. This makes a clean break with path and centralizes the GL context specific IPC communication in one location.
By separating from the WebGL code, I was able to avoid wasting a texture attached to the FBO in the decoder (the old code ignored this attachment --- the new code makes no such attachment at the decoder level).
As a test of the new architecture, I have also implemented XComposite/GLX_texture_from_pixmap image transport (i.e. it's now possible to use the --use-gl=desktop backend on touch_ui builds).
BUG=none
TEST=3D CSS and WebGL on TOUCH_UI.
Review URL: http://codereview.chromium.org/7395020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93681 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/gfx/gl/generate_bindings.py | 4 | ||||
-rw-r--r-- | ui/gfx/gl/gl_context_cgl.cc | 1 | ||||
-rw-r--r-- | ui/gfx/gl/gl_context_egl.cc | 1 | ||||
-rw-r--r-- | ui/gfx/gl/gl_context_glx.cc | 1 | ||||
-rw-r--r-- | ui/gfx/gl/gl_context_osmesa.cc | 1 | ||||
-rw-r--r-- | ui/gfx/gl/gl_context_wgl.cc | 1 | ||||
-rw-r--r-- | ui/gfx/gl/gl_surface.cc | 3 | ||||
-rw-r--r-- | ui/gfx/gl/gl_surface.h | 3 | ||||
-rw-r--r-- | ui/gfx/gl/gl_surface_glx.cc | 5 | ||||
-rw-r--r-- | ui/gfx/gl/gl_surface_glx.h | 6 |
10 files changed, 25 insertions, 1 deletions
diff --git a/ui/gfx/gl/generate_bindings.py b/ui/gfx/gl/generate_bindings.py index 34baccd..a71e96e 100644 --- a/ui/gfx/gl/generate_bindings.py +++ b/ui/gfx/gl/generate_bindings.py @@ -377,6 +377,10 @@ GLX_FUNCTIONS = [ 'Display* dpy, int screen, int* attribList'], ['GLXContext', ['glXCreateContext'], 'Display* dpy, XVisualInfo* vis, GLXContext shareList, int direct'], +['void', ['glXBindTexImageEXT'], + 'Display* dpy, GLXDrawable drawable, int buffer, int* attribList'], +['void', ['glXReleaseTexImageEXT'], + 'Display* dpy, GLXDrawable drawable, int buffer'], ['void', ['glXDestroyContext'], 'Display* dpy, GLXContext ctx'], ['int', ['glXMakeCurrent'], 'Display* dpy, GLXDrawable drawable, GLXContext ctx'], diff --git a/ui/gfx/gl/gl_context_cgl.cc b/ui/gfx/gl/gl_context_cgl.cc index 1629cec..9ba5b53 100644 --- a/ui/gfx/gl/gl_context_cgl.cc +++ b/ui/gfx/gl/gl_context_cgl.cc @@ -64,6 +64,7 @@ bool GLContextCGL::MakeCurrent(GLSurface* surface) { return false; } + surface->OnMakeCurrent(); return true; } diff --git a/ui/gfx/gl/gl_context_egl.cc b/ui/gfx/gl/gl_context_egl.cc index f18d59f..a61e52b 100644 --- a/ui/gfx/gl/gl_context_egl.cc +++ b/ui/gfx/gl/gl_context_egl.cc @@ -95,6 +95,7 @@ bool GLContextEGL::MakeCurrent(GLSurface* surface) { return false; } + surface->OnMakeCurrent(); return true; } diff --git a/ui/gfx/gl/gl_context_glx.cc b/ui/gfx/gl/gl_context_glx.cc index aa863cc..0921037 100644 --- a/ui/gfx/gl/gl_context_glx.cc +++ b/ui/gfx/gl/gl_context_glx.cc @@ -171,6 +171,7 @@ bool GLContextGLX::MakeCurrent(GLSurface* surface) { return false; } + surface->OnMakeCurrent(); return true; } diff --git a/ui/gfx/gl/gl_context_osmesa.cc b/ui/gfx/gl/gl_context_osmesa.cc index 2b45836..a4396d4 100644 --- a/ui/gfx/gl/gl_context_osmesa.cc +++ b/ui/gfx/gl/gl_context_osmesa.cc @@ -67,6 +67,7 @@ bool GLContextOSMesa::MakeCurrent(GLSurface* surface) { // Row 0 is at the top. OSMesaPixelStore(OSMESA_Y_UP, 0); + surface->OnMakeCurrent(); return true; } diff --git a/ui/gfx/gl/gl_context_wgl.cc b/ui/gfx/gl/gl_context_wgl.cc index 8533be7..7d14b91 100644 --- a/ui/gfx/gl/gl_context_wgl.cc +++ b/ui/gfx/gl/gl_context_wgl.cc @@ -82,6 +82,7 @@ bool GLContextWGL::MakeCurrent(GLSurface* surface) { return false; } + surface->OnMakeCurrent(); return true; } diff --git a/ui/gfx/gl/gl_surface.cc b/ui/gfx/gl/gl_surface.cc index 3e4cb7e..6242f80 100644 --- a/ui/gfx/gl/gl_surface.cc +++ b/ui/gfx/gl/gl_surface.cc @@ -21,4 +21,7 @@ unsigned int GLSurface::GetBackingFrameBufferObject() { return 0; } +void GLSurface::OnMakeCurrent() { +} + } // namespace gfx diff --git a/ui/gfx/gl/gl_surface.h b/ui/gfx/gl/gl_surface.h index 7a89d5b..5bd9180 100644 --- a/ui/gfx/gl/gl_surface.h +++ b/ui/gfx/gl/gl_surface.h @@ -47,6 +47,9 @@ class GLSurface : public base::RefCounted<GLSurface> { static bool InitializeOneOff(); + // Called after a context is made current with this surface. + virtual void OnMakeCurrent(); + #if !defined(OS_MACOSX) // Create a GL surface that renders directly to a view. static scoped_refptr<GLSurface> CreateViewGLSurface( diff --git a/ui/gfx/gl/gl_surface_glx.cc b/ui/gfx/gl/gl_surface_glx.cc index b584080..30cf490 100644 --- a/ui/gfx/gl/gl_surface_glx.cc +++ b/ui/gfx/gl/gl_surface_glx.cc @@ -104,6 +104,11 @@ NativeViewGLSurfaceGLX::NativeViewGLSurfaceGLX(gfx::PluginWindowHandle window) config_(NULL) { } +NativeViewGLSurfaceGLX::NativeViewGLSurfaceGLX() + : window_(0), + config_(NULL) { +} + NativeViewGLSurfaceGLX::~NativeViewGLSurfaceGLX() { Destroy(); } diff --git a/ui/gfx/gl/gl_surface_glx.h b/ui/gfx/gl/gl_surface_glx.h index 54a52e0..7d8872c 100644 --- a/ui/gfx/gl/gl_surface_glx.h +++ b/ui/gfx/gl/gl_surface_glx.h @@ -52,8 +52,12 @@ class NativeViewGLSurfaceGLX : public GLSurfaceGLX { virtual void* GetHandle(); virtual void* GetConfig(); - private: + protected: + NativeViewGLSurfaceGLX(); + gfx::PluginWindowHandle window_; + + private: void* config_; DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceGLX); }; |