summaryrefslogtreecommitdiffstats
path: root/content/browser/android/in_process
diff options
context:
space:
mode:
authorkbr <kbr@chromium.org>2015-09-16 18:43:02 -0700
committerCommit bot <commit-bot@chromium.org>2015-09-17 01:43:38 +0000
commitd29c2783db449ea8c802423887fa4669abb453d5 (patch)
tree576477de4947fd51aefea73ec34c3a97e2836f4b /content/browser/android/in_process
parente3cc0a661b8abfdc74f569940949bc1f336ece40 (diff)
downloadchromium_src-d29c2783db449ea8c802423887fa4669abb453d5.zip
chromium_src-d29c2783db449ea8c802423887fa4669abb453d5.tar.gz
chromium_src-d29c2783db449ea8c802423887fa4669abb453d5.tar.bz2
Revert of cc: Implement shared worker contexts. (patchset #9 id:160001 of https://codereview.chromium.org/1336733002/ )
Reason for revert: Broke GPU rasterization on Mac OS; please see https://code.google.com/p/chromium/issues/detail?id=523411#c26 . I'm really sorry -- I don't know how this got past the CQ. Original issue's description: > cc: Implement shared worker contexts. > > This moves the responsibility to call BindToCurrentThread/SetupLock out > of cc::OutputSurface and to the maintainer of the (possibly) shared > context. > > OutputSurface now needs to be destroyed on the same thread they > were created. OutputSurface::DetachFromClient() can be used to > destroy any resources that need to be destroyed on the thread > that the OutputSurface has been bound to. > > BUG=523411 > CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel > > Committed: https://crrev.com/a47ef41ea03d3a5b8965eb700b682ddf8a1f055a > Cr-Commit-Position: refs/heads/master@{#349274} TBR=danakj@chromium.org,piman@chromium.org,sievers@chromium.org,reveman@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=523411 Review URL: https://codereview.chromium.org/1356463002 Cr-Commit-Position: refs/heads/master@{#349313}
Diffstat (limited to 'content/browser/android/in_process')
-rw-r--r--content/browser/android/in_process/synchronous_compositor_factory_impl.cc39
-rw-r--r--content/browser/android/in_process/synchronous_compositor_factory_impl.h3
-rw-r--r--content/browser/android/in_process/synchronous_compositor_output_surface.cc14
-rw-r--r--content/browser/android/in_process/synchronous_compositor_output_surface.h1
4 files changed, 8 insertions, 49 deletions
diff --git a/content/browser/android/in_process/synchronous_compositor_factory_impl.cc b/content/browser/android/in_process/synchronous_compositor_factory_impl.cc
index 9888c2d..b90edd6 100644
--- a/content/browser/android/in_process/synchronous_compositor_factory_impl.cc
+++ b/content/browser/android/in_process/synchronous_compositor_factory_impl.cc
@@ -24,7 +24,6 @@
#include "content/renderer/render_thread_impl.h"
#include "gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.h"
#include "gpu/command_buffer/client/gl_in_process_context.h"
-#include "gpu/command_buffer/client/gles2_interface.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
#include "ui/gl/android/surface_texture.h"
#include "ui/gl/gl_surface.h"
@@ -170,40 +169,11 @@ SynchronousCompositorFactoryImpl::CreateOutputSurface(
scoped_refptr<content::FrameSwapMessageQueue> frame_swap_message_queue) {
scoped_refptr<cc::ContextProvider> onscreen_context =
CreateContextProviderForCompositor(surface_id, RENDER_COMPOSITOR_CONTEXT);
-
- bool shared_worker_context_lost = false;
- if (shared_worker_context_) {
- // Note: If context is lost, we delete reference after releasing the lock.
- base::AutoLock lock(*shared_worker_context_->GetLock());
- if (shared_worker_context_->ContextGL()->GetGraphicsResetStatusKHR() !=
- GL_NO_ERROR) {
- shared_worker_context_lost = true;
- }
- }
- // Note: shared worker context support requires |use_ipc_command_buffer_|.
- if (use_ipc_command_buffer_ &&
- (!shared_worker_context_ || shared_worker_context_lost)) {
- // TODO(reveman): This limit is based on the usage required by async
- // uploads. Determine what a good limit is now that async uploads are
- // no longer used.
- unsigned int mapped_memory_reclaim_limit =
- (base::SysInfo::IsLowEndDevice() ? 2 : 6) * 1024 * 1024;
- WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits mem_limits;
- mem_limits.mapped_memory_reclaim_limit = mapped_memory_reclaim_limit;
- scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context =
- CreateContext3D(0, GetDefaultAttribs(), mem_limits);
- shared_worker_context_ =
- make_scoped_refptr(new SynchronousCompositorContextProvider(
- context.Pass(), RENDER_WORKER_CONTEXT));
- if (!shared_worker_context_->BindToCurrentThread())
- shared_worker_context_ = nullptr;
- if (shared_worker_context_)
- shared_worker_context_->SetupLock();
- }
+ scoped_refptr<cc::ContextProvider> worker_context =
+ CreateContextProviderForCompositor(0, RENDER_WORKER_CONTEXT);
return make_scoped_ptr(new SynchronousCompositorOutputSurface(
- onscreen_context, shared_worker_context_, routing_id,
- frame_swap_message_queue));
+ onscreen_context, worker_context, routing_id, frame_swap_message_queue));
}
InputHandlerManagerClient*
@@ -241,9 +211,6 @@ SynchronousCompositorFactoryImpl::CreateContextProviderForCompositor(
// This is half of what RenderWidget uses because synchronous compositor
// pipeline is only one frame deep. But twice of half for low end here
// because 16bit texture is not supported.
- // TODO(reveman): This limit is based on the usage required by async
- // uploads. Determine what a good limit is now that async uploads are
- // no longer used.
unsigned int mapped_memory_reclaim_limit =
(base::SysInfo::IsLowEndDevice() ? 2 : 6) * 1024 * 1024;
blink::WebGraphicsContext3D::Attributes attributes = GetDefaultAttribs();
diff --git a/content/browser/android/in_process/synchronous_compositor_factory_impl.h b/content/browser/android/in_process/synchronous_compositor_factory_impl.h
index 342b2a9..84ceb03 100644
--- a/content/browser/android/in_process/synchronous_compositor_factory_impl.h
+++ b/content/browser/android/in_process/synchronous_compositor_factory_impl.h
@@ -28,7 +28,6 @@ class WebGraphicsContext3DInProcessCommandBufferImpl;
namespace content {
class InProcessChildThreadParams;
-class SynchronousCompositorContextProvider;
class SynchronousCompositorFactoryImpl : public SynchronousCompositorFactory {
public:
@@ -89,8 +88,6 @@ class SynchronousCompositorFactoryImpl : public SynchronousCompositorFactory {
class VideoContextProvider;
scoped_refptr<VideoContextProvider> video_context_provider_;
- scoped_refptr<SynchronousCompositorContextProvider> shared_worker_context_;
-
bool use_ipc_command_buffer_;
// |num_hardware_compositor_lock_| is updated on UI thread only but can be
diff --git a/content/browser/android/in_process/synchronous_compositor_output_surface.cc b/content/browser/android/in_process/synchronous_compositor_output_surface.cc
index f03f992..85c7bcb 100644
--- a/content/browser/android/in_process/synchronous_compositor_output_surface.cc
+++ b/content/browser/android/in_process/synchronous_compositor_output_surface.cc
@@ -83,6 +83,11 @@ SynchronousCompositorOutputSurface::SynchronousCompositorOutputSurface(
}
SynchronousCompositorOutputSurface::~SynchronousCompositorOutputSurface() {
+ DCHECK(CalledOnValidThread());
+ if (registered_) {
+ SynchronousCompositorRegistry::GetInstance()->UnregisterOutputSurface(
+ routing_id_, this);
+ }
}
bool SynchronousCompositorOutputSurface::BindToClient(
@@ -100,15 +105,6 @@ bool SynchronousCompositorOutputSurface::BindToClient(
return true;
}
-void SynchronousCompositorOutputSurface::DetachFromClient() {
- DCHECK(CalledOnValidThread());
- if (registered_) {
- SynchronousCompositorRegistry::GetInstance()->UnregisterOutputSurface(
- routing_id_, this);
- }
- cc::OutputSurface::DetachFromClient();
-}
-
void SynchronousCompositorOutputSurface::SetCompositor(
SynchronousCompositorImpl* compositor) {
DCHECK(CalledOnValidThread());
diff --git a/content/browser/android/in_process/synchronous_compositor_output_surface.h b/content/browser/android/in_process/synchronous_compositor_output_surface.h
index b1baa64..4146952 100644
--- a/content/browser/android/in_process/synchronous_compositor_output_surface.h
+++ b/content/browser/android/in_process/synchronous_compositor_output_surface.h
@@ -58,7 +58,6 @@ class SynchronousCompositorOutputSurface
// OutputSurface.
bool BindToClient(cc::OutputSurfaceClient* surface_client) override;
- void DetachFromClient() override;
void Reshape(const gfx::Size& size, float scale_factor) override;
void SwapBuffers(cc::CompositorFrame* frame) override;
void Invalidate() override;