summaryrefslogtreecommitdiffstats
path: root/webkit/gpu
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-11 19:22:37 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-11 19:22:37 +0000
commit92c2bc5ac0f605a14dfa88649e7c5a844eb0922b (patch)
tree814efb2ec279b176a052713fba9ae8d000265116 /webkit/gpu
parentb6793a8d2f4af8c0ca6cfca6fbe3168f5de75b5e (diff)
downloadchromium_src-92c2bc5ac0f605a14dfa88649e7c5a844eb0922b.zip
chromium_src-92c2bc5ac0f605a14dfa88649e7c5a844eb0922b.tar.gz
chromium_src-92c2bc5ac0f605a14dfa88649e7c5a844eb0922b.tar.bz2
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 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85013 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/gpu')
-rw-r--r--webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc18
-rw-r--r--webkit/gpu/webgraphicscontext3d_in_process_impl.cc17
2 files changed, 27 insertions, 8 deletions
diff --git a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
index 2ee71e8..7b43d63 100644
--- a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
+++ b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
@@ -17,6 +17,7 @@
#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 {
@@ -102,7 +103,7 @@ bool WebGraphicsContext3DInProcessCommandBufferImpl::initialize(
WebGraphicsContext3D::Attributes attributes,
WebView* webView,
bool render_directly_to_web_view) {
- if (!gfx::GLContext::InitializeOneOff())
+ if (!gfx::GLSurface::InitializeOneOff())
return false;
gfx::BindSkiaToInProcessGL();
@@ -132,7 +133,13 @@ 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_context_.reset(gfx::GLContext::CreateOffscreenGLContext(share_context));
+ 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));
if (!gl_context_.get()) {
if (!is_gles2_)
return false;
@@ -145,7 +152,12 @@ bool WebGraphicsContext3DInProcessCommandBufferImpl::initialize(
// and force them to drop their contexts, sending a context lost event if
// necessary.
webView->mainFrame()->collectGarbage();
- gl_context_.reset(gfx::GLContext::CreateOffscreenGLContext(share_context));
+
+ surface.reset(gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1)));
+
+ gl_context_.reset(gfx::GLContext::CreateGLContext(
+ surface.release(),
+ 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 2fb703a..08d93ca 100644
--- a/webkit/gpu/webgraphicscontext3d_in_process_impl.cc
+++ b/webkit/gpu/webgraphicscontext3d_in_process_impl.cc
@@ -17,6 +17,7 @@
#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 {
@@ -102,7 +103,7 @@ bool WebGraphicsContext3DInProcessImpl::initialize(
WebGraphicsContext3D::Attributes attributes,
WebView* webView,
bool render_directly_to_web_view) {
- if (!gfx::GLContext::InitializeOneOff())
+ if (!gfx::GLSurface::InitializeOneOff())
return false;
gfx::BindSkiaToInProcessGL();
@@ -132,8 +133,9 @@ 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_context_.reset(gfx::GLContext::CreateOffscreenGLContext(share_context));
- if (!gl_context_.get()) {
+ scoped_ptr<gfx::GLSurface> surface(gfx::GLSurface::CreateOffscreenGLSurface(
+ gfx::Size(1, 1)));
+ if (!surface.get()) {
if (!is_gles2_)
return false;
@@ -145,11 +147,16 @@ bool WebGraphicsContext3DInProcessImpl::initialize(
// and force them to drop their contexts, sending a context lost event if
// necessary.
webView->mainFrame()->collectGarbage();
- gl_context_.reset(gfx::GLContext::CreateOffscreenGLContext(share_context));
- if (!gl_context_.get())
+ surface.reset(gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1)));
+ if (!surface.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.