Create shared mailbox manager in content module
authorArnaud Renevier <a.renevier@samsung.com>
Wed, 17 Jun 2015 01:00:17 +0000 (18:00 -0700)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
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 <a.renevier@samsung.com>
tizen_src/chromium_impl/content/browser/renderer_host/render_widget_host_view_efl.cc
tizen_src/chromium_impl/content/content_gpu_efl.gypi
tizen_src/chromium_impl/content/gpu/in_process_gpu_thread_efl.cc
tizen_src/chromium_impl/content/gpu/shared_mailbox_manager.cc [new file with mode: 0644]
tizen_src/chromium_impl/content/gpu/shared_mailbox_manager.h [new file with mode: 0644]
tizen_src/chromium_impl/ui/gl/gl_shared_context_efl.cc
tizen_src/chromium_impl/ui/gl/gl_shared_context_efl.h

index 8b95b57..acce237 100755 (executable)
@@ -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_);
index c8edad6..5b7fa26 100644 (file)
@@ -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$' ],
index c1365f0..2e56b89 100644 (file)
@@ -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 (file)
index 0000000..c7df3a4
--- /dev/null
@@ -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<gpu::gles2::MailboxManager> 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 (file)
index 0000000..a2bf290
--- /dev/null
@@ -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();
+  };
+}
index e581782..969835f 100644 (file)
@@ -198,13 +198,6 @@ gfx::GLShareGroup* GLSharedContextEfl::GetShareGroup() {
   return share_group_.get();
 }
 
-// static
-gpu::gles2::MailboxManager* GLSharedContextEfl::GetMailboxManager() {
-  static scoped_refptr<gpu::gles2::MailboxManager> 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;
index d6b108e..29e002f 100644 (file)
@@ -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