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.
!is_castos) {
configs += [ "//build/config/linux/dri" ]
}
-
- if (use_efl) {
- sources += external_content_gpu_efl_sources
- sources -= external_exclude_content_gpu_efl_sources
- }
}
#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 {
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;
}
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) {
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,
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 {
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.
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_);
class GLShareGroup;
}
-#if BUILDFLAG(IS_EFL)
-namespace content {
-struct GpuChildThreadEfl;
-}
-#endif
-
namespace gpu {
class SharedImageManager;
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
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.
+++ /dev/null
-# 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" ]
+++ /dev/null
-// 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"
+++ /dev/null
-// 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