Remove InProcessGpuThreadEfl and GpuChildThreadEfl 98/285998/3
authorChandan Padhi <c.padhi@samsung.com>
Fri, 23 Dec 2022 11:06:51 +0000 (16:36 +0530)
committerChandan Padhi <c.padhi@samsung.com>
Tue, 27 Dec 2022 08:23:18 +0000 (13:53 +0530)
With SharedMailboxManager removed in [1], shared context can be now set
directly in GpuChildThread itself. Therefore, chromium-efl no longer has
to override GpuChildThread and InProcessGpuThread.

[1] https://review.tizen.org/gerrit/285975/

Change-Id: I2e062c9da159b38877f1311988cdc100109ff02d
Signed-off-by: Chandan Padhi <c.padhi@samsung.com>
content/gpu/BUILD.gn
content/gpu/gpu_child_thread.cc
content/gpu/gpu_child_thread.h
content/gpu/in_process_gpu_thread.h
gpu/ipc/service/gpu_channel_manager.cc
gpu/ipc/service/gpu_channel_manager.h
tizen_src/chromium_impl/content/gpu/gpu_efl.gni [deleted file]
tizen_src/chromium_impl/content/gpu/gpu_thread_override_efl.cc [deleted file]
tizen_src/chromium_impl/content/gpu/in_process_gpu_thread_efl.cc [deleted file]

index 7a2bbc114ac6350deba2508a51a2f62188eb446d..8f70e891319e0f32b0636e22b40359db75b57d3e 100644 (file)
@@ -9,7 +9,6 @@ import("//gpu/vulkan/features.gni")
 import("//media/media_options.gni")
 if (use_efl) {
   import("//tizen_src/chromium_impl/content/content_efl.gni")
-  import("//tizen_src/chromium_impl/content/gpu/gpu_efl.gni")
 }
 
 # See //content/BUILD.gn for how this works.
@@ -152,9 +151,4 @@ target(link_target_type, "gpu_sources") {
       !is_castos) {
     configs += [ "//build/config/linux/dri" ]
   }
-
-  if (use_efl) {
-    sources += external_content_gpu_efl_sources
-    sources -= external_exclude_content_gpu_efl_sources
-  }
 }
index 6ffd2700f57d8c98e7306f92d70757fb2b38625f..90e3b47df6727f447d91b7260d8ed2f0277766cf 100644 (file)
 #include "third_party/skia/include/ports/SkFontConfigInterface.h"
 #endif
 
+#if BUILDFLAG(IS_EFL)
+#include "ui/gl/gl_shared_context_efl.h"
+#endif
+
 namespace content {
 namespace {
 
@@ -164,12 +168,6 @@ void GpuChildThread::Init(const base::TimeTicks& process_start_time) {
                                      base::Unretained(this)));
 }
 
-#if BUILDFLAG(IS_EFL)
-void GpuChildThread::SetGpuServiceConnection(viz::GpuServiceImpl* service) {
-  GpuChildThread::OnGpuServiceConnection(service);
-}
-#endif
-
 bool GpuChildThread::in_process_gpu() const {
   return viz_main_.gpu_service()->gpu_info().in_process_gpu;
 }
@@ -188,6 +186,11 @@ void GpuChildThread::OnGpuServiceConnection(viz::GpuServiceImpl* gpu_service) {
       overlay_factory_cb);
 #endif
 
+#if BUILDFLAG(IS_EFL)
+  gpu_service->gpu_channel_manager()->SetShareGroup(
+      GLSharedContextEfl::GetShareGroup());
+#endif
+
   if (!IsInBrowserProcess()) {
     gpu_service->SetVisibilityChangedCallback(
         base::BindRepeating([](bool visible) {
index b2e945321d97effa883f7eda27641524fa165fa3..76995c716d383689c116c6e9be42988b4b23ce33 100644 (file)
@@ -55,10 +55,6 @@ class GpuChildThread : public ChildThreadImpl,
 
   void Init(const base::TimeTicks& process_start_time);
 
-#if BUILDFLAG(IS_EFL)
-  void SetGpuServiceConnection(viz::GpuServiceImpl* service);
-#endif
-
  private:
   GpuChildThread(base::RepeatingClosure quit_closure,
                  ChildThreadImpl::Options options,
index d6b7bb72ec216a2c730f1c7dff814e1826716c3b..d897fa4bf0816cc0ce3a24ee6190de9bbbb375c7 100644 (file)
@@ -15,10 +15,6 @@ namespace content {
 
 class ChildProcess;
 
-#if BUILDFLAG(IS_EFL)
-struct InProcessGpuThreadEfl;
-#endif
-
 // This class creates a GPU thread (instead of a GPU process), when running
 // with --in-process-gpu or --single-process.
 class InProcessGpuThread : public base::Thread {
@@ -36,10 +32,6 @@ class InProcessGpuThread : public base::Thread {
   void CleanUp() override;
 
  private:
-#if BUILDFLAG(IS_EFL)
-  friend struct InProcessGpuThreadEfl;
-#endif
-
   InProcessChildThreadParams params_;
 
   // Deleted in CleanUp() on the gpu thread, so don't use smart pointers.
index a4bd4a056b4d9627d2c809e8a079eb102d7689c3..7a905bc337d5af8555ffa5358f10ce7075e27c7d 100644 (file)
@@ -694,6 +694,13 @@ GpuChannelManager::GetPeakMemoryUsage(uint32_t sequence_num,
   return allocation_per_source;
 }
 
+#if BUILDFLAG(IS_EFL)
+void GpuChannelManager::SetShareGroup(
+    scoped_refptr<gl::GLShareGroup> share_group) {
+  share_group_ = share_group;
+}
+#endif
+
 #if BUILDFLAG(IS_ANDROID)
 void GpuChannelManager::DidAccessGpu() {
   DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
index 5bd8f103975e94b669ba3359338c8509a83e5624..a52a5b647a6e45357de6e6973daedafe0f4878bb 100644 (file)
@@ -54,12 +54,6 @@ namespace gl {
 class GLShareGroup;
 }
 
-#if BUILDFLAG(IS_EFL)
-namespace content {
-struct GpuChildThreadEfl;
-}
-#endif
-
 namespace gpu {
 
 class SharedImageManager;
@@ -139,6 +133,11 @@ class GPU_IPC_SERVICE_EXPORT GpuChannelManager
   void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
                               int client_id,
                               const SyncToken& sync_token);
+
+#if BUILDFLAG(IS_EFL)
+  void SetShareGroup(scoped_refptr<gl::GLShareGroup> share_group);
+#endif
+
 #if BUILDFLAG(IS_ANDROID)
   void WakeUpGpu();
 #endif
@@ -253,10 +252,6 @@ class GPU_IPC_SERVICE_EXPORT GpuChannelManager
  private:
   friend class GpuChannelManagerTest;
 
-#if BUILDFLAG(IS_EFL)
-  friend struct content::GpuChildThreadEfl;
-#endif
-
   // Observes changes in GPU memory, and tracks the peak usage for clients. The
   // client is responsible for providing a unique |sequence_num| for each time
   // period in which it wishes to track memory usage.
diff --git a/tizen_src/chromium_impl/content/gpu/gpu_efl.gni b/tizen_src/chromium_impl/content/gpu/gpu_efl.gni
deleted file mode 100644 (file)
index bc23d8a..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright (c) 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.
-
-external_content_gpu_efl_sources = [
-  "//tizen_src/chromium_impl/content/gpu/gpu_thread_override_efl.cc",
-  "//tizen_src/chromium_impl/content/gpu/in_process_gpu_thread_efl.cc",
-]
-
-external_exclude_content_gpu_efl_sources = [ "in_process_gpu_thread.cc" ]
diff --git a/tizen_src/chromium_impl/content/gpu/gpu_thread_override_efl.cc b/tizen_src/chromium_impl/content/gpu/gpu_thread_override_efl.cc
deleted file mode 100644 (file)
index 8fbe0cc..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// 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.
-
-#define CreateInProcessGpuThread not_CreateInProcessGpuThread
-#include "content/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
deleted file mode 100644 (file)
index 826e6d7..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2014 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 "base/command_line.h"
-#include "base/time/time.h"
-#include "content/child/child_process.h"
-#include "content/gpu/gpu_child_thread.h"
-#include "content/gpu/in_process_gpu_thread.h"
-#include "content/public/common/content_client.h"
-#include "content/public/common/content_switches.h"
-#include "gpu/command_buffer/service/mailbox_manager.h"
-#include "gpu/config/gpu_preferences.h"
-#include "gpu/ipc/service/gpu_channel_manager.h"
-#include "gpu/ipc/service/gpu_init.h"
-#include "ui/gl/gl_shared_context_efl.h"
-
-// Implementation of InProcessGpuThread and GpuChildThread overrides
-// in order to provide on startup shared context created from Efl shared evas gl
-// context.
-
-namespace content {
-
-struct GpuChildThreadEfl : public content::GpuChildThread {
-  explicit GpuChildThreadEfl(const InProcessChildThreadParams& params,
-                             std::unique_ptr<gpu::GpuInit> gpu_init)
-      : GpuChildThread(params, std::move(gpu_init)) {}
-
-  void OnGpuServiceConnection(viz::GpuServiceImpl* gpu_service) override {
-    GpuChildThread::SetGpuServiceConnection(gpu_service);
-    gpu_service->gpu_channel_manager()->share_group_ =
-        GLSharedContextEfl::GetShareGroup();
-  }
-};
-
-struct InProcessGpuThreadEfl : public content::InProcessGpuThread {
-  explicit InProcessGpuThreadEfl(
-      const content::InProcessChildThreadParams& params,
-      const gpu::GpuPreferences& gpu_preferences)
-      : InProcessGpuThread(params, gpu_preferences) {}
-
-  void Init() override {
-    gpu_process_ = std::make_unique<ChildProcess>(base::ThreadType::kDefault);
-
-    auto gpu_init = std::make_unique<gpu::GpuInit>();
-    gpu_init->InitializeInProcess(base::CommandLine::ForCurrentProcess(),
-                                  gpu_preferences_);
-
-    GetContentClient()->SetGpuInfo(gpu_init->gpu_info());
-
-    // The process object takes ownership of the thread object, so do not
-    // save and delete the pointer.
-    GpuChildThread* child_thread =
-        new GpuChildThreadEfl(params_, std::move(gpu_init));
-
-    // Since we are in the browser process, use the thread start time as the
-    // process start time.
-    child_thread->Init(base::TimeTicks::Now());
-
-    gpu_process_->set_main_thread(child_thread);
-  }
-};
-
-base::Thread* CreateInProcessGpuThread(
-    const content::InProcessChildThreadParams& params,
-    const gpu::GpuPreferences& gpu_preferences) {
-  return new InProcessGpuThreadEfl(params, gpu_preferences);
-}
-
-} // namespace content