summaryrefslogtreecommitdiffstats
path: root/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc')
-rw-r--r--content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc28
1 files changed, 8 insertions, 20 deletions
diff --git a/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc b/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc
index ffb997f..57cac38 100644
--- a/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc
+++ b/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc
@@ -106,7 +106,6 @@ bool WebGraphicsContext3DCommandBufferImpl::initialize(
if (web_view && web_view->mainFrame())
active_url = GURL(web_view->mainFrame()->document().url());
- RendererGLContext* parent_context = NULL;
if (render_directly_to_web_view) {
RenderView* renderview = RenderView::FromWebView(web_view);
if (!renderview)
@@ -125,22 +124,6 @@ bool WebGraphicsContext3DCommandBufferImpl::initialize(
&WebGraphicsContext3DCommandBufferImpl::OnSwapBuffersComplete));
}
} else {
- bool compositing_enabled = !CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDisableAcceleratedCompositing);
- // If GPU compositing is enabled we need to create a GL context that shares
- // resources with the compositor's context.
- if (compositing_enabled) {
- // Asking for the WebGraphicsContext3D on the WebView will force one to
- // be created if it doesn't already exist. When the compositor is created
- // for the view it will use the same context.
- WebKit::WebGraphicsContext3D* view_context =
- web_view->graphicsContext3D();
- if (view_context) {
- WebGraphicsContext3DCommandBufferImpl* context_impl =
- static_cast<WebGraphicsContext3DCommandBufferImpl*>(view_context);
- parent_context = context_impl->context_;
- }
- }
context_ = RendererGLContext::CreateOffscreenContext(
host,
gfx::Size(1, 1),
@@ -152,9 +135,6 @@ bool WebGraphicsContext3DCommandBufferImpl::initialize(
if (!context_)
return false;
- if (!context_->SetParent(parent_context))
- return false;
-
gl_ = context_->GetImplementation();
context_->SetContextLostCallback(
NewCallback(this,
@@ -202,6 +182,14 @@ bool WebGraphicsContext3DCommandBufferImpl::isGLES2Compliant() {
return true;
}
+bool WebGraphicsContext3DCommandBufferImpl::setParentContext(
+ WebGraphicsContext3D* parent_context) {
+ WebGraphicsContext3DCommandBufferImpl* parent_context_impl =
+ static_cast<WebGraphicsContext3DCommandBufferImpl*>(parent_context);
+ return context_->SetParent(
+ parent_context_impl ? parent_context_impl->context() : NULL);
+}
+
WebGLId WebGraphicsContext3DCommandBufferImpl::getPlatformTextureId() {
DCHECK(context_);
return context_->GetParentTextureId();