diff options
author | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-01 00:07:21 +0000 |
---|---|---|
committer | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-01 00:07:21 +0000 |
commit | 52dd2f8464089b5b1f5c69c7ce32a9431549394b (patch) | |
tree | 717d67fcc4a123d9e9f6e441fdf46242be167861 /webkit/gpu | |
parent | d639366249df2e1e0e27911c3b1da585fd2fe35f (diff) | |
download | chromium_src-52dd2f8464089b5b1f5c69c7ce32a9431549394b.zip chromium_src-52dd2f8464089b5b1f5c69c7ce32a9431549394b.tar.gz chromium_src-52dd2f8464089b5b1f5c69c7ce32a9431549394b.tar.bz2 |
Change PluginWindowHandle to AcceleratedWidget in ui/gfx/gl
BUG=104551
TEST=compile
Review URL: http://codereview.chromium.org/9160012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119990 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/gpu')
4 files changed, 7 insertions, 86 deletions
diff --git a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc index c2c0f39..dd831da 100644 --- a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc +++ b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#if defined(ENABLE_GPU) - #include "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" #include <GLES2/gl2.h> @@ -90,28 +88,6 @@ class GLInProcessContext : public base::SupportsWeakPtr<GLInProcessContext> { void PumpCommands(); bool GetBufferChanged(int32 transfer_buffer_id); - // Create a GLInProcessContext that renders directly to a view. The view and - // the associated window must not be destroyed until the returned - // GLInProcessContext has been destroyed, otherwise the GPU process might - // attempt to render to an invalid window handle. - // - // NOTE: on Mac OS X, this entry point is only used to set up the - // accelerated compositor's output. On this platform, we actually pass - // a gfx::PluginWindowHandle in place of the gfx::NativeViewId, - // because the facility to allocate a fake PluginWindowHandle is - // already in place. We could add more entry points and messages to - // allocate both fake PluginWindowHandles and NativeViewIds and map - // from fake NativeViewIds to PluginWindowHandles, but this seems like - // unnecessary complexity at the moment. - // - static GLInProcessContext* CreateViewContext( - gfx::PluginWindowHandle render_surface, - GLInProcessContext* context_group, - const char* allowed_extensions, - const int32* attrib_list, - const GURL& active_url, - gfx::GpuPreference gpu_preference); - // Create a GLInProcessContext that renders to an offscreen frame buffer. If // parent is not NULL, that GLInProcessContext can access a copy of the // created GLInProcessContext's frame buffer that is updated every time @@ -171,9 +147,7 @@ class GLInProcessContext : public base::SupportsWeakPtr<GLInProcessContext> { private: explicit GLInProcessContext(GLInProcessContext* parent); - bool Initialize(bool onscreen, - gfx::PluginWindowHandle render_surface, - const gfx::Size& size, + bool Initialize(const gfx::Size& size, GLInProcessContext* context_group, const char* allowed_extensions, const int32* attrib_list, @@ -240,32 +214,6 @@ GLInProcessContext::~GLInProcessContext() { Destroy(); } -GLInProcessContext* GLInProcessContext::CreateViewContext( - gfx::PluginWindowHandle render_surface, - GLInProcessContext* context_group, - const char* allowed_extensions, - const int32* attrib_list, - const GURL& active_url, - gfx::GpuPreference gpu_preference) { -#if defined(ENABLE_GPU) - scoped_ptr<GLInProcessContext> context(new GLInProcessContext(NULL)); - if (!context->Initialize( - true, - render_surface, - gfx::Size(), - context_group, - allowed_extensions, - attrib_list, - active_url, - gpu_preference)) - return NULL; - - return context.release(); -#else - return NULL; -#endif -} - GLInProcessContext* GLInProcessContext::CreateOffscreenContext( GLInProcessContext* parent, const gfx::Size& size, @@ -274,11 +222,8 @@ GLInProcessContext* GLInProcessContext::CreateOffscreenContext( const int32* attrib_list, const GURL& active_url, gfx::GpuPreference gpu_preference) { -#if defined(ENABLE_GPU) scoped_ptr<GLInProcessContext> context(new GLInProcessContext(parent)); if (!context->Initialize( - false, - gfx::kNullPluginWindow, size, context_group, allowed_extensions, @@ -288,9 +233,6 @@ GLInProcessContext* GLInProcessContext::CreateOffscreenContext( return NULL; return context.release(); -#else - return NULL; -#endif } // In the normal command buffer implementation, all commands are passed over IPC @@ -399,9 +341,7 @@ GLInProcessContext::GLInProcessContext(GLInProcessContext* parent) last_error_(SUCCESS) { } -bool GLInProcessContext::Initialize(bool onscreen, - gfx::PluginWindowHandle render_surface, - const gfx::Size& size, +bool GLInProcessContext::Initialize(const gfx::Size& size, GLInProcessContext* context_group, const char* allowed_extensions, const int32* attrib_list, @@ -472,17 +412,7 @@ bool GLInProcessContext::Initialize(bool onscreen, decoder_->set_engine(gpu_scheduler_.get()); - if (onscreen) { - if (render_surface == gfx::kNullPluginWindow) { - LOG(ERROR) << "Invalid surface handle for onscreen context."; - command_buffer_.reset(); - } else { - surface_ = gfx::GLSurface::CreateViewGLSurface(false, render_surface); - } - } else { - surface_ = gfx::GLSurface::CreateOffscreenGLSurface(false, - gfx::Size(1, 1)); - } + surface_ = gfx::GLSurface::CreateOffscreenGLSurface(false, gfx::Size(1, 1)); if (!surface_.get()) { LOG(ERROR) << "Could not create GLSurface."; @@ -583,9 +513,6 @@ WebGraphicsContext3DInProcessCommandBufferImpl:: : context_(NULL), gl_(NULL), web_view_(NULL), -#if defined(OS_MACOSX) - plugin_handle_(NULL), -#endif // defined(OS_MACOSX) context_lost_callback_(NULL), context_lost_reason_(GL_NO_ERROR), cached_width_(0), @@ -1663,5 +1590,3 @@ void WebGraphicsContext3DInProcessCommandBufferImpl::OnContextLost() { } // namespace gpu } // namespace webkit - -#endif // defined(ENABLE_GPU) diff --git a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h index 9c27b2c..cd23e42 100644 --- a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h +++ b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h @@ -481,10 +481,6 @@ class WebGraphicsContext3DInProcessCommandBufferImpl // If rendering directly to WebView, weak pointer to it. WebKit::WebView* web_view_; -#if defined(OS_MACOSX) - // "Fake" plugin window handle in browser process for the compositor's output. - gfx::PluginWindowHandle plugin_handle_; -#endif WebGraphicsContext3D::WebGraphicsContextLostCallback* context_lost_callback_; WGC3Denum context_lost_reason_; diff --git a/webkit/gpu/webgraphicscontext3d_in_process_impl.cc b/webkit/gpu/webgraphicscontext3d_in_process_impl.cc index 16f4fb9..c3cc48f 100644 --- a/webkit/gpu/webgraphicscontext3d_in_process_impl.cc +++ b/webkit/gpu/webgraphicscontext3d_in_process_impl.cc @@ -44,7 +44,7 @@ struct WebGraphicsContext3DInProcessImpl::ShaderSourceEntry { }; WebGraphicsContext3DInProcessImpl::WebGraphicsContext3DInProcessImpl( - gfx::PluginWindowHandle window, + gfx::AcceleratedWidget window, gfx::GLShareGroup* share_group) : initialized_(false), render_directly_to_web_view_(false), diff --git a/webkit/gpu/webgraphicscontext3d_in_process_impl.h b/webkit/gpu/webgraphicscontext3d_in_process_impl.h index 4603afb..df4accb 100644 --- a/webkit/gpu/webgraphicscontext3d_in_process_impl.h +++ b/webkit/gpu/webgraphicscontext3d_in_process_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -57,7 +57,7 @@ class WebGraphicsContext3DInProcessImpl : public WebGraphicsContext3D { // is gfx::kNullPluginWindow, then it creates an offscreen context. // share_group is the group this context shares namespaces with. It's only // used for window-bound countexts. - WebGraphicsContext3DInProcessImpl(gfx::PluginWindowHandle window, + WebGraphicsContext3DInProcessImpl(gfx::AcceleratedWidget window, gfx::GLShareGroup* share_group); virtual ~WebGraphicsContext3DInProcessImpl(); @@ -522,7 +522,7 @@ class WebGraphicsContext3DInProcessImpl : public WebGraphicsContext3D { ShHandle fragment_compiler_; ShHandle vertex_compiler_; - gfx::PluginWindowHandle window_; + gfx::AcceleratedWidget window_; scoped_refptr<gfx::GLShareGroup> share_group_; }; |