diff options
author | sievers <sievers@chromium.org> | 2014-09-09 02:15:35 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-09 09:18:00 +0000 |
commit | a5be71900477280bd56786b39493a3399b52dfdb (patch) | |
tree | 5f1be8b6df2a4bf006411823cf3794c54d639e2a /android_webview/browser | |
parent | e0dd0295045531750465047312651a30aab5d6a2 (diff) | |
download | chromium_src-a5be71900477280bd56786b39493a3399b52dfdb.zip chromium_src-a5be71900477280bd56786b39493a3399b52dfdb.tar.gz chromium_src-a5be71900477280bd56786b39493a3399b52dfdb.tar.bz2 |
InProcessGL: Share MailboxManager per service
The current logic ends up creating a MailboxManager per ContextGroup,
so change this to share the mailbox manager across
InProcessCommandBuffer::Service instances.
This also allows for removing code in Android WebView that deals with
passing around the share group. None of these contexts (child, parent
compositor and video) need client-side share groups since mailbox names
are used.
TBR=tedchoc@chromium.org for content/public
Review URL: https://codereview.chromium.org/540143002
Cr-Commit-Position: refs/heads/master@{#293902}
Diffstat (limited to 'android_webview/browser')
-rw-r--r-- | android_webview/browser/browser_view_renderer.cc | 4 | ||||
-rw-r--r-- | android_webview/browser/hardware_renderer.cc | 8 | ||||
-rw-r--r-- | android_webview/browser/shared_renderer_state.cc | 15 | ||||
-rw-r--r-- | android_webview/browser/shared_renderer_state.h | 4 |
4 files changed, 4 insertions, 27 deletions
diff --git a/android_webview/browser/browser_view_renderer.cc b/android_webview/browser/browser_view_renderer.cc index d9d3d0b..40d9cbd 100644 --- a/android_webview/browser/browser_view_renderer.cc +++ b/android_webview/browser/browser_view_renderer.cc @@ -268,9 +268,6 @@ bool BrowserViewRenderer::OnDrawHardware(jobject java_canvas) { hardware_enabled_ = compositor_->InitializeHwDraw(); if (hardware_enabled_) { tile_manager_key_ = GlobalTileManager::GetInstance()->PushBack(this); - gpu::GLInProcessContext* share_context = compositor_->GetShareContext(); - DCHECK(share_context); - shared_renderer_state_->SetSharedContext(share_context); } } if (!hardware_enabled_) @@ -476,7 +473,6 @@ void BrowserViewRenderer::ReleaseHardware() { DCHECK(shared_renderer_state_->ReturnedResourcesEmpty()); compositor_->ReleaseHwDraw(); - shared_renderer_state_->SetSharedContext(NULL); hardware_enabled_ = false; SynchronousCompositorMemoryPolicy zero_policy; diff --git a/android_webview/browser/hardware_renderer.cc b/android_webview/browser/hardware_renderer.cc index 28cec80..873a621 100644 --- a/android_webview/browser/hardware_renderer.cc +++ b/android_webview/browser/hardware_renderer.cc @@ -38,8 +38,7 @@ using webkit::gpu::WebGraphicsContext3DImpl; scoped_refptr<cc::ContextProvider> CreateContext( scoped_refptr<gfx::GLSurface> surface, - scoped_refptr<gpu::InProcessCommandBuffer::Service> service, - gpu::GLInProcessContext* share_context) { + scoped_refptr<gpu::InProcessCommandBuffer::Service> service) { const gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu; blink::WebGraphicsContext3D::Attributes attributes; @@ -59,7 +58,7 @@ scoped_refptr<cc::ContextProvider> CreateContext( surface->IsOffscreen(), gfx::kNullAcceleratedWidget, surface->GetSize(), - share_context, + NULL /* share_context */, false /* share_resources */, attribs_for_gles2, gpu_preference, @@ -242,8 +241,7 @@ scoped_ptr<cc::OutputSurface> HardwareRenderer::CreateOutputSurface( DCHECK(!fallback); scoped_refptr<cc::ContextProvider> context_provider = CreateContext(gl_surface_, - DeferredGpuCommandService::GetInstance(), - shared_renderer_state_->GetSharedContext()); + DeferredGpuCommandService::GetInstance()); scoped_ptr<ParentOutputSurface> output_surface_holder( new ParentOutputSurface(context_provider)); output_surface_ = output_surface_holder.get(); diff --git a/android_webview/browser/shared_renderer_state.cc b/android_webview/browser/shared_renderer_state.cc index 508fdc4..fddbe71 100644 --- a/android_webview/browser/shared_renderer_state.cc +++ b/android_webview/browser/shared_renderer_state.cc @@ -80,8 +80,7 @@ SharedRendererState::SharedRendererState( client_on_ui_(client), weak_factory_on_ui_thread_(this), ui_thread_weak_ptr_(weak_factory_on_ui_thread_.GetWeakPtr()), - inside_hardware_release_(false), - share_context_(NULL) { + inside_hardware_release_(false) { DCHECK(ui_loop_->BelongsToCurrentThread()); DCHECK(client_on_ui_); ResetRequestDrawGLCallback(); @@ -179,18 +178,6 @@ bool SharedRendererState::IsInsideHardwareRelease() const { return inside_hardware_release_; } -void SharedRendererState::SetSharedContext(gpu::GLInProcessContext* context) { - base::AutoLock lock(lock_); - DCHECK(!share_context_ || !context); - share_context_ = context; -} - -gpu::GLInProcessContext* SharedRendererState::GetSharedContext() const { - base::AutoLock lock(lock_); - DCHECK(share_context_); - return share_context_; -} - void SharedRendererState::InsertReturnedResources( const cc::ReturnedResourceArray& resources) { base::AutoLock lock(lock_); diff --git a/android_webview/browser/shared_renderer_state.h b/android_webview/browser/shared_renderer_state.h index 2245f73..e4a5827 100644 --- a/android_webview/browser/shared_renderer_state.h +++ b/android_webview/browser/shared_renderer_state.h @@ -64,9 +64,6 @@ class SharedRendererState { const ParentCompositorDrawConstraints ParentDrawConstraints() const; - void SetSharedContext(gpu::GLInProcessContext* context); - gpu::GLInProcessContext* GetSharedContext() const; - void InsertReturnedResources(const cc::ReturnedResourceArray& resources); void SwapReturnedResources(cc::ReturnedResourceArray* resources); bool ReturnedResourcesEmpty() const; @@ -91,7 +88,6 @@ class SharedRendererState { scoped_ptr<DrawGLInput> draw_gl_input_; bool inside_hardware_release_; ParentCompositorDrawConstraints parent_draw_constraints_; - gpu::GLInProcessContext* share_context_; cc::ReturnedResourceArray returned_resources_; base::Closure request_draw_gl_closure_; |