From: Arnaud Renevier Date: Wed, 17 Jun 2015 01:00:17 +0000 (-0700) Subject: Create shared mailbox manager in content module X-Git-Tag: submit/tizen/20201118.160233~758 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4e20b44c4225deb5b550fd9278e3732b09ad2870;p=platform%2Fframework%2Fweb%2Fchromium-efl.git Create shared mailbox manager in content module Right now, mailbox manager is created gl_shared_context_efl.cc But gpu targets depend on 'gl' So that means that 'gl' target depends on an object defined in gpu. But gpu itself depend on gl target. In order to build with shared component, we need to break that cycle. So, this patch creates a shared mailbox manager object which resides in content module. Bug: http://107.108.218.239/bugzilla/show_bug.cgi?id=13303 Reviewed by: Antonio Gomes, Prashant Nevase Change-Id: Iee44b421448b95a7c0896cd8f080a7b66ed46a80 Signed-off-by: Arnaud Renevier --- diff --git a/tizen_src/chromium_impl/content/browser/renderer_host/render_widget_host_view_efl.cc b/tizen_src/chromium_impl/content/browser/renderer_host/render_widget_host_view_efl.cc index 8b95b57..acce237 100755 --- a/tizen_src/chromium_impl/content/browser/renderer_host/render_widget_host_view_efl.cc +++ b/tizen_src/chromium_impl/content/browser/renderer_host/render_widget_host_view_efl.cc @@ -46,6 +46,7 @@ #include "content/common/input_messages.h" #include "content/common/gpu/gpu_messages.h" #include "content/common/cursors/webcursor_efl.h" +#include "content/gpu/shared_mailbox_manager.h" #include "content/public/browser/render_widget_host_view_frame_subscriber.h" #include "content/public/browser/screen_orientation_dispatcher_host.h" #include "content/public/browser/web_contents_delegate.h" @@ -1816,7 +1817,7 @@ extern GLuint GetTextureIdFromTexture(gpu::gles2::Texture* texture); void RenderWidgetHostViewEfl::GetTextureFromMailbox(gpu::Mailbox* mailbox, gfx::Size surface_size) { - gpu::gles2::MailboxManager* manager = GLSharedContextEfl::GetMailboxManager(); + gpu::gles2::MailboxManager* manager = SharedMailboxManager::GetMailboxManager(); gpu::gles2::Texture* texture = manager->ConsumeTexture(*mailbox); if (texture != NULL) { surface_size_ = surface_size; @@ -1839,7 +1840,7 @@ void RenderWidgetHostViewEfl::OnSwapCompositorFrame( if (evas_gl_initialized_) { std::swap(ack.gl_frame_data->mailbox, pending_mailbox_); gpu::gles2::MailboxManager* manager = - GLSharedContextEfl::GetMailboxManager(); + SharedMailboxManager::GetMailboxManager(); gpu::gles2::Texture* texture = manager->ConsumeTexture(pending_mailbox_); diff --git a/tizen_src/chromium_impl/content/content_gpu_efl.gypi b/tizen_src/chromium_impl/content/content_gpu_efl.gypi index c8edad6..5b7fa26 100644 --- a/tizen_src/chromium_impl/content/content_gpu_efl.gypi +++ b/tizen_src/chromium_impl/content/content_gpu_efl.gypi @@ -6,6 +6,8 @@ 'sources': [ 'gpu/gpu_thread_override_efl.cc', 'gpu/in_process_gpu_thread_efl.cc', + 'gpu/shared_mailbox_manager.h', + 'gpu/shared_mailbox_manager.cc', ], 'sources/': [ [ 'exclude', 'gpu/in_process_gpu_thread.cc$' ], diff --git a/tizen_src/chromium_impl/content/gpu/in_process_gpu_thread_efl.cc b/tizen_src/chromium_impl/content/gpu/in_process_gpu_thread_efl.cc index c1365f0..2e56b89d 100644 --- a/tizen_src/chromium_impl/content/gpu/in_process_gpu_thread_efl.cc +++ b/tizen_src/chromium_impl/content/gpu/in_process_gpu_thread_efl.cc @@ -4,6 +4,7 @@ #include "content/common/gpu/gpu_messages.h" #include "content/gpu/gpu_process.h" +#include "content/gpu/shared_mailbox_manager.h" #include "ui/gl/gl_shared_context_efl.h" #include "gpu/command_buffer/service/mailbox_manager.h" #include "ipc/ipc_channel.h" @@ -44,7 +45,7 @@ struct GpuChildThreadEfl : public content::GpuChildThread { gpu_channel_manager_->share_group_ = GLSharedContextEfl::GetShareGroup(); gpu_channel_manager_->mailbox_manager_ = - GLSharedContextEfl::GetMailboxManager(); + SharedMailboxManager::GetMailboxManager(); } }; diff --git a/tizen_src/chromium_impl/content/gpu/shared_mailbox_manager.cc b/tizen_src/chromium_impl/content/gpu/shared_mailbox_manager.cc new file mode 100644 index 0000000..c7df3a4 --- /dev/null +++ b/tizen_src/chromium_impl/content/gpu/shared_mailbox_manager.cc @@ -0,0 +1,18 @@ +// Copyright 2015 Samsung Electronics. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "shared_mailbox_manager.h" + +#include "gpu/command_buffer/service/mailbox_manager_impl.h" + +namespace content { + +// static +gpu::gles2::MailboxManager* SharedMailboxManager::GetMailboxManager() { + static scoped_refptr mailbox_manager_ = + new gpu::gles2::MailboxManagerImpl(); + return mailbox_manager_.get(); +} + +} diff --git a/tizen_src/chromium_impl/content/gpu/shared_mailbox_manager.h b/tizen_src/chromium_impl/content/gpu/shared_mailbox_manager.h new file mode 100644 index 0000000..a2bf290 --- /dev/null +++ b/tizen_src/chromium_impl/content/gpu/shared_mailbox_manager.h @@ -0,0 +1,15 @@ +// Copyright 2015 Samsung Electronics. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +namespace gpu { +namespace gles2 { + class MailboxManager; +} +} + +namespace content { + struct SharedMailboxManager { + static gpu::gles2::MailboxManager* GetMailboxManager(); + }; +} diff --git a/tizen_src/chromium_impl/ui/gl/gl_shared_context_efl.cc b/tizen_src/chromium_impl/ui/gl/gl_shared_context_efl.cc index e581782..969835f 100644 --- a/tizen_src/chromium_impl/ui/gl/gl_shared_context_efl.cc +++ b/tizen_src/chromium_impl/ui/gl/gl_shared_context_efl.cc @@ -198,13 +198,6 @@ gfx::GLShareGroup* GLSharedContextEfl::GetShareGroup() { return share_group_.get(); } -// static -gpu::gles2::MailboxManager* GLSharedContextEfl::GetMailboxManager() { - static scoped_refptr mailbox_manager_ = - new gpu::gles2::MailboxManagerImpl(); - return mailbox_manager_.get(); -} - #if defined(TIZEN_DISABLE_GPU_THREAD) void GLSharedContextEfl::SetDelegate(GLSharedContextDelegate* delegate) { g_private_part->delegate_ = delegate; diff --git a/tizen_src/chromium_impl/ui/gl/gl_shared_context_efl.h b/tizen_src/chromium_impl/ui/gl/gl_shared_context_efl.h index d6b108e..29e002f 100644 --- a/tizen_src/chromium_impl/ui/gl/gl_shared_context_efl.h +++ b/tizen_src/chromium_impl/ui/gl/gl_shared_context_efl.h @@ -15,11 +15,6 @@ namespace gfx { class GLContext; class GLShareGroup; } -namespace gpu { -namespace gles2 { - class MailboxManager; -} -} #if defined(TIZEN_DISABLE_GPU_THREAD) class GLSharedContextDelegate { @@ -33,7 +28,6 @@ struct GL_EXPORT GLSharedContextEfl { static gfx::GLContext* GetInstance(); static Evas_GL_Context* GetEvasGLContext(); static gfx::GLShareGroup* GetShareGroup(); - static gpu::gles2::MailboxManager* GetMailboxManager(); #if defined(TIZEN_DISABLE_GPU_THREAD) static void SetDelegate(GLSharedContextDelegate*); #endif