diff options
author | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-31 21:42:02 +0000 |
---|---|---|
committer | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-31 21:42:02 +0000 |
commit | 9d756882750dabd1abbe70b30292531abb86a34b (patch) | |
tree | cd6f3ba4d5481a39953e87570abf9a1402630772 /webkit/gpu | |
parent | 8ca0b64248afd305ff938b080afdcb880a98e61b (diff) | |
download | chromium_src-9d756882750dabd1abbe70b30292531abb86a34b.zip chromium_src-9d756882750dabd1abbe70b30292531abb86a34b.tar.gz chromium_src-9d756882750dabd1abbe70b30292531abb86a34b.tar.bz2 |
Support for glSetSurfaceCHROMIUM.
This command allows a previously created GPU surface to be made current for a command buffer. There are no surfaces registered at this point so this command is currently a no-op.
Review URL: http://codereview.chromium.org/7077001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87371 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/gpu')
4 files changed, 22 insertions, 23 deletions
diff --git a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc index 62439d8..dfb4959 100644 --- a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc +++ b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc @@ -10,6 +10,7 @@ #include <string> #include "base/logging.h" +#include "base/memory/scoped_ptr.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" @@ -133,7 +134,7 @@ bool WebGraphicsContext3DInProcessCommandBufferImpl::initialize( // and from there to the window, and WebViewImpl::paint already // correctly handles the case where the compositor is active but // the output needs to go to a WebCanvas. - gl_surface_.reset(gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1))); + gl_surface_ = gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1)); if (!gl_surface_.get()) { if (!is_gles2_) @@ -148,14 +149,13 @@ bool WebGraphicsContext3DInProcessCommandBufferImpl::initialize( // necessary. webView->mainFrame()->collectGarbage(); - gl_surface_.reset(gfx::GLSurface::CreateOffscreenGLSurface( - gfx::Size(1, 1))); + gl_surface_ = gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1)); if (!gl_surface_.get()) return false; } - gl_context_.reset(gfx::GLContext::CreateGLContext(share_context, - gl_surface_.get())); + gl_context_ = gfx::GLContext::CreateGLContext(share_context, + gl_surface_.get()); if (!gl_context_.get()) { if (!is_gles2_) return false; @@ -169,8 +169,8 @@ bool WebGraphicsContext3DInProcessCommandBufferImpl::initialize( // necessary. webView->mainFrame()->collectGarbage(); - gl_context_.reset(gfx::GLContext::CreateGLContext(share_context, - gl_surface_.get())); + gl_context_ = gfx::GLContext::CreateGLContext(share_context, + gl_surface_.get()); if (!gl_context_.get()) return false; } @@ -189,7 +189,7 @@ bool WebGraphicsContext3DInProcessCommandBufferImpl::initialize( attributes_.antialias = false; if (!gl_context_->MakeCurrent(gl_surface_.get())) { - gl_context_.reset(); + gl_context_ = NULL; return false; } diff --git a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h index 08c8df1..dc51c80 100644 --- a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h +++ b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h @@ -9,7 +9,7 @@ #include <set> #include "base/hash_tables.h" -#include "base/memory/scoped_ptr.h" +#include "base/memory/ref_counted.h" #include "third_party/angle/include/GLSLANG/ShaderLang.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebGraphicsContext3D.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" @@ -464,8 +464,8 @@ class WebGraphicsContext3DInProcessCommandBufferImpl : public WebGraphicsContext std::list<WGC3Denum> synthetic_errors_list_; std::set<WGC3Denum> synthetic_errors_set_; - scoped_ptr<gfx::GLContext> gl_context_; - scoped_ptr<gfx::GLSurface> gl_surface_; + scoped_refptr<gfx::GLContext> gl_context_; + scoped_refptr<gfx::GLSurface> gl_surface_; ShaderSourceMap shader_source_map_; diff --git a/webkit/gpu/webgraphicscontext3d_in_process_impl.cc b/webkit/gpu/webgraphicscontext3d_in_process_impl.cc index f2fc2e9..f79f4a6 100644 --- a/webkit/gpu/webgraphicscontext3d_in_process_impl.cc +++ b/webkit/gpu/webgraphicscontext3d_in_process_impl.cc @@ -10,6 +10,7 @@ #include <string> #include "base/logging.h" +#include "base/memory/scoped_ptr.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" @@ -134,8 +135,7 @@ bool WebGraphicsContext3DInProcessImpl::initialize( // and from there to the window, and WebViewImpl::paint already // correctly handles the case where the compositor is active but // the output needs to go to a WebCanvas. - gl_surface_.reset(gfx::GLSurface::CreateOffscreenGLSurface( - gfx::Size(1, 1))); + gl_surface_ = gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1)); if (!gl_surface_.get()) { if (!is_gles2_) return false; @@ -149,14 +149,13 @@ bool WebGraphicsContext3DInProcessImpl::initialize( // necessary. webView->mainFrame()->collectGarbage(); - gl_surface_.reset( - gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1))); + gl_surface_ = gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1)); if (!gl_surface_.get()) return false; } - gl_context_.reset(gfx::GLContext::CreateGLContext(share_context, - gl_surface_.get())); + gl_context_ = gfx::GLContext::CreateGLContext(share_context, + gl_surface_.get()); if (!gl_context_.get()) { if (!is_gles2_) return false; @@ -170,8 +169,8 @@ bool WebGraphicsContext3DInProcessImpl::initialize( // necessary. webView->mainFrame()->collectGarbage(); - gl_context_.reset(gfx::GLContext::CreateGLContext(share_context, - gl_surface_.get())); + gl_context_ = gfx::GLContext::CreateGLContext(share_context, + gl_surface_.get()); if (!gl_context_.get()) return false; } @@ -190,7 +189,7 @@ bool WebGraphicsContext3DInProcessImpl::initialize( attributes_.antialias = false; if (!gl_context_->MakeCurrent(gl_surface_.get())) { - gl_context_.reset(); + gl_context_ = NULL; return false; } diff --git a/webkit/gpu/webgraphicscontext3d_in_process_impl.h b/webkit/gpu/webgraphicscontext3d_in_process_impl.h index ae3fac2..304f9fb 100644 --- a/webkit/gpu/webgraphicscontext3d_in_process_impl.h +++ b/webkit/gpu/webgraphicscontext3d_in_process_impl.h @@ -9,7 +9,7 @@ #include <set> #include "base/hash_tables.h" -#include "base/memory/scoped_ptr.h" +#include "base/memory/ref_counted.h" #include "third_party/angle/include/GLSLANG/ShaderLang.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebGraphicsContext3D.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" @@ -468,8 +468,8 @@ class WebGraphicsContext3DInProcessImpl : public WebGraphicsContext3D { std::list<WGC3Denum> synthetic_errors_list_; std::set<WGC3Denum> synthetic_errors_set_; - scoped_ptr<gfx::GLContext> gl_context_; - scoped_ptr<gfx::GLSurface> gl_surface_; + scoped_refptr<gfx::GLContext> gl_context_; + scoped_refptr<gfx::GLSurface> gl_surface_; ShaderSourceMap shader_source_map_; |