summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-11 19:41:58 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-11 19:41:58 +0000
commit333c5c9ca65425d1796d9d13abda37ecbce2c9fb (patch)
tree85b92482a6ed18f7be48b153352436be89eb5b3e /webkit
parent374d9094395c15cd3b337de5c36587312fcc8a1e (diff)
downloadchromium_src-333c5c9ca65425d1796d9d13abda37ecbce2c9fb.zip
chromium_src-333c5c9ca65425d1796d9d13abda37ecbce2c9fb.tar.gz
chromium_src-333c5c9ca65425d1796d9d13abda37ecbce2c9fb.tar.bz2
Revert 85013 - Split GLContext::Create*GLContext into GLSurface::Create*GLSurface plus a surface type independent GLContext::CreateGLContext.
TEST=webgl on windows and mac, trybots BUG=none Review URL: http://codereview.chromium.org/6997003 TBR=apatrick@chromium.org Review URL: http://codereview.chromium.org/7015003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85016 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc18
-rw-r--r--webkit/gpu/webgraphicscontext3d_in_process_impl.cc17
-rw-r--r--webkit/plugins/npapi/plugin_host.cc4
-rw-r--r--webkit/support/webkit_support.cc3
4 files changed, 11 insertions, 31 deletions
diff --git a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
index 7b43d63..2ee71e8 100644
--- a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
+++ b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
@@ -17,7 +17,6 @@
#include "ui/gfx/gl/gl_bindings_skia_in_process.h"
#include "ui/gfx/gl/gl_context.h"
#include "ui/gfx/gl/gl_implementation.h"
-#include "ui/gfx/gl/gl_surface.h"
namespace webkit {
namespace gpu {
@@ -103,7 +102,7 @@ bool WebGraphicsContext3DInProcessCommandBufferImpl::initialize(
WebGraphicsContext3D::Attributes attributes,
WebView* webView,
bool render_directly_to_web_view) {
- if (!gfx::GLSurface::InitializeOneOff())
+ if (!gfx::GLContext::InitializeOneOff())
return false;
gfx::BindSkiaToInProcessGL();
@@ -133,13 +132,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.
- scoped_ptr<gfx::GLSurface> surface(gfx::GLSurface::CreateOffscreenGLSurface(
- gfx::Size(1, 1)));
- if (!surface->Initialize())
- return false;
-
- gl_context_.reset(gfx::GLContext::CreateGLContext(surface.release(),
- share_context));
+ gl_context_.reset(gfx::GLContext::CreateOffscreenGLContext(share_context));
if (!gl_context_.get()) {
if (!is_gles2_)
return false;
@@ -152,12 +145,7 @@ bool WebGraphicsContext3DInProcessCommandBufferImpl::initialize(
// and force them to drop their contexts, sending a context lost event if
// necessary.
webView->mainFrame()->collectGarbage();
-
- surface.reset(gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1)));
-
- gl_context_.reset(gfx::GLContext::CreateGLContext(
- surface.release(),
- share_context));
+ gl_context_.reset(gfx::GLContext::CreateOffscreenGLContext(share_context));
if (!gl_context_.get())
return false;
}
diff --git a/webkit/gpu/webgraphicscontext3d_in_process_impl.cc b/webkit/gpu/webgraphicscontext3d_in_process_impl.cc
index 08d93ca..2fb703a 100644
--- a/webkit/gpu/webgraphicscontext3d_in_process_impl.cc
+++ b/webkit/gpu/webgraphicscontext3d_in_process_impl.cc
@@ -17,7 +17,6 @@
#include "ui/gfx/gl/gl_bindings_skia_in_process.h"
#include "ui/gfx/gl/gl_context.h"
#include "ui/gfx/gl/gl_implementation.h"
-#include "ui/gfx/gl/gl_surface.h"
namespace webkit {
namespace gpu {
@@ -103,7 +102,7 @@ bool WebGraphicsContext3DInProcessImpl::initialize(
WebGraphicsContext3D::Attributes attributes,
WebView* webView,
bool render_directly_to_web_view) {
- if (!gfx::GLSurface::InitializeOneOff())
+ if (!gfx::GLContext::InitializeOneOff())
return false;
gfx::BindSkiaToInProcessGL();
@@ -133,9 +132,8 @@ 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.
- scoped_ptr<gfx::GLSurface> surface(gfx::GLSurface::CreateOffscreenGLSurface(
- gfx::Size(1, 1)));
- if (!surface.get()) {
+ gl_context_.reset(gfx::GLContext::CreateOffscreenGLContext(share_context));
+ if (!gl_context_.get()) {
if (!is_gles2_)
return false;
@@ -147,16 +145,11 @@ bool WebGraphicsContext3DInProcessImpl::initialize(
// and force them to drop their contexts, sending a context lost event if
// necessary.
webView->mainFrame()->collectGarbage();
- surface.reset(gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1)));
- if (!surface.get())
+ gl_context_.reset(gfx::GLContext::CreateOffscreenGLContext(share_context));
+ if (!gl_context_.get())
return false;
}
- gl_context_.reset(gfx::GLContext::CreateGLContext(surface.release(),
- share_context));
- if (!gl_context_.get())
- return false;
-
attributes_ = attributes;
// FIXME: for the moment we disable multisampling for the compositor.
diff --git a/webkit/plugins/npapi/plugin_host.cc b/webkit/plugins/npapi/plugin_host.cc
index e92c22e..b6021d46 100644
--- a/webkit/plugins/npapi/plugin_host.cc
+++ b/webkit/plugins/npapi/plugin_host.cc
@@ -17,8 +17,8 @@
#include "third_party/npapi/bindings/npruntime.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h"
+#include "ui/gfx/gl/gl_context.h"
#include "ui/gfx/gl/gl_implementation.h"
-#include "ui/gfx/gl/gl_surface.h"
#include "webkit/glue/webkit_glue.h"
#include "webkit/plugins/npapi/default_plugin_shared.h"
#include "webkit/plugins/npapi/npapi_extension_thunk.h"
@@ -62,7 +62,7 @@ static bool SupportsSharingAcceleratedSurfaces() {
gfx::GLImplementation implementation = gfx::GetGLImplementation();
if (implementation == gfx::kGLImplementationNone) {
// Not initialized yet.
- if (!gfx::GLSurface::InitializeOneOff()) {
+ if (!gfx::GLContext::InitializeOneOff()) {
return false;
}
implementation = gfx::GetGLImplementation();
diff --git a/webkit/support/webkit_support.cc b/webkit/support/webkit_support.cc
index 8210aaa..520b988 100644
--- a/webkit/support/webkit_support.cc
+++ b/webkit/support/webkit_support.cc
@@ -36,7 +36,6 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebURLError.h"
#include "ui/gfx/gl/gl_context.h"
#include "ui/gfx/gl/gl_implementation.h"
-#include "ui/gfx/gl/gl_surface.h"
#include "webkit/appcache/web_application_cache_host_impl.h"
#include "webkit/glue/media/video_renderer_impl.h"
#include "webkit/glue/webkit_constants.h"
@@ -324,7 +323,7 @@ WebKit::WebString GetWebKitRootDir() {
void SetUpGLBindings(GLBindingPreferences bindingPref) {
switch(bindingPref) {
case GL_BINDING_DEFAULT:
- gfx::GLSurface::InitializeOneOff();
+ gfx::GLContext::InitializeOneOff();
break;
case GL_BINDING_SOFTWARE_RENDERER:
gfx::InitializeGLBindings(gfx::kGLImplementationOSMesaGL);