diff options
author | boliu <boliu@chromium.org> | 2015-07-28 20:09:38 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-29 03:10:42 +0000 |
commit | aeb1e4c6e211155dc9fa02977b53a7924a935819 (patch) | |
tree | 15005942526db3aa3ea0e69ac986ebeaed63eeab /content/browser/android/in_process | |
parent | fea09fe47250e3516dd2107b8a110ff31ff4683f (diff) | |
download | chromium_src-aeb1e4c6e211155dc9fa02977b53a7924a935819.zip chromium_src-aeb1e4c6e211155dc9fa02977b53a7924a935819.tar.gz chromium_src-aeb1e4c6e211155dc9fa02977b53a7924a935819.tar.bz2 |
Sync Compositor: Create onscreen ipc context
Pass surface_id when trying to create OutputSurface. surface_id is used
to create the onscreen ipc context, which matches rest of chrome, and
also works around an initialization issue on start up.
BUG=509702
Review URL: https://codereview.chromium.org/1257723005
Cr-Commit-Position: refs/heads/master@{#340847}
Diffstat (limited to 'content/browser/android/in_process')
-rw-r--r-- | content/browser/android/in_process/synchronous_compositor_factory_impl.cc | 10 | ||||
-rw-r--r-- | content/browser/android/in_process/synchronous_compositor_factory_impl.h | 2 |
2 files changed, 8 insertions, 4 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 4aa5ddb..b98e3cc 100644 --- a/content/browser/android/in_process/synchronous_compositor_factory_impl.cc +++ b/content/browser/android/in_process/synchronous_compositor_factory_impl.cc @@ -81,6 +81,7 @@ ContextHolder CreateContextHolder( } scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateContext3D( + int surface_id, const blink::WebGraphicsContext3D::Attributes& attributes, const content::WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits& mem_limits) { @@ -91,7 +92,6 @@ scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateContext3D( RenderThreadImpl::current()->EstablishGpuChannelSync(cause)); CHECK(gpu_channel_host.get()); - int surface_id = 0; bool lose_context_when_out_of_memory = true; return make_scoped_ptr(new WebGraphicsContext3DCommandBufferImpl( surface_id, GURL(), gpu_channel_host.get(), attributes, @@ -167,11 +167,12 @@ SynchronousCompositorFactoryImpl::RecordFullLayer() { scoped_ptr<cc::OutputSurface> SynchronousCompositorFactoryImpl::CreateOutputSurface( int routing_id, + int surface_id, scoped_refptr<content::FrameSwapMessageQueue> frame_swap_message_queue) { scoped_refptr<cc::ContextProvider> onscreen_context = - CreateContextProviderForCompositor(RENDER_COMPOSITOR_CONTEXT); + CreateContextProviderForCompositor(surface_id, RENDER_COMPOSITOR_CONTEXT); scoped_refptr<cc::ContextProvider> worker_context = - CreateContextProviderForCompositor(RENDER_WORKER_CONTEXT); + CreateContextProviderForCompositor(0, RENDER_WORKER_CONTEXT); return make_scoped_ptr(new SynchronousCompositorOutputSurface( onscreen_context, worker_context, routing_id, frame_swap_message_queue)); @@ -207,6 +208,7 @@ SynchronousCompositorFactoryImpl::CreateOffscreenContextProvider( scoped_refptr<cc::ContextProvider> SynchronousCompositorFactoryImpl::CreateContextProviderForCompositor( + int surface_id, CommandBufferContextType type) { // This is half of what RenderWidget uses because synchronous compositor // pipeline is only one frame deep. But twice of half for low end here @@ -219,7 +221,7 @@ SynchronousCompositorFactoryImpl::CreateContextProviderForCompositor( WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits mem_limits; mem_limits.mapped_memory_reclaim_limit = mapped_memory_reclaim_limit; scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context = - CreateContext3D(GetDefaultAttribs(), mem_limits); + CreateContext3D(surface_id, GetDefaultAttribs(), mem_limits); return ContextProviderCommandBuffer::Create(context.Pass(), type); } 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 e15daf2..4e262f0 100644 --- a/content/browser/android/in_process/synchronous_compositor_factory_impl.h +++ b/content/browser/android/in_process/synchronous_compositor_factory_impl.h @@ -40,6 +40,7 @@ class SynchronousCompositorFactoryImpl : public SynchronousCompositorFactory { bool RecordFullLayer() override; scoped_ptr<cc::OutputSurface> CreateOutputSurface( int routing_id, + int surface_id, scoped_refptr<content::FrameSwapMessageQueue> frame_swap_message_queue) override; InputHandlerManagerClient* GetInputHandlerManagerClient() override; @@ -73,6 +74,7 @@ class SynchronousCompositorFactoryImpl : public SynchronousCompositorFactory { private: scoped_refptr<cc::ContextProvider> CreateContextProviderForCompositor( + int surface_id, CommandBufferContextType type); bool CanCreateMainThreadContext(); scoped_refptr<StreamTextureFactorySynchronousImpl::ContextProvider> |