elm_layout_file_set(efl_main_layout_, main_edj.AsUTF8Unsafe().c_str(),
"main_layout");
- GLSharedContextEfl::Initialize(root_window);
-
#if BUILDFLAG(IS_TIZEN) && !BUILDFLAG(IS_TIZEN_TV)
BrowserGpuChannelHostFactory::Start();
#endif
auto* ee = ecore_evas_ecore_evas_get(evas_object_evas_get(efl_main_layout_));
+ const char* sw_engine = "wayland_shm";
+ if (!strncmp(sw_engine, ecore_evas_engine_name_get(ee), strlen(sw_engine))) {
+ LOG(INFO) << "ecore_evas engine Name : " << ecore_evas_engine_name_get(ee);
+ use_hw_backend_ = false;
+ }
+ if (use_hw_backend_) {
+ GLSharedContextEfl::Initialize(root_window);
+ }
+
ui::EflScreen::UpdateDisplayInfo(ee);
}
Evas_Object* GetEflMainLayout() const { return efl_main_layout_; }
void set_ewk_view(void* ewk_view) { ewk_view_ = ewk_view; }
void* ewk_view() const { return ewk_view_; }
+ bool use_hw_backend() const { return use_hw_backend_; }
void SetWebviewDelegate(WebViewDelegate* delegate) {
webview_delegate_.reset(delegate);
bool spatial_navigation_enabled_ = false;
std::unique_ptr<content::WebViewDelegate> webview_delegate_;
+ bool use_hw_backend_ = true;
#endif
#if defined(TIZEN_VIDEO_HOLE)
}
void RWHVAuraOffscreenHelperEfl::Initialize() {
- efl_main_layout_ =
- static_cast<WebContentsImpl*>(GetWebContents())->GetEflMainLayout();
+ WebContentsImpl* wc = static_cast<WebContentsImpl*>(GetWebContents());
+ efl_main_layout_ = wc->GetEflMainLayout();
+ use_hw_backend_ = wc->use_hw_backend();
evas_ = evas_object_evas_get(efl_main_layout_);
- InitEvasGL();
- InitializeProgram();
+ if (use_hw_backend_) {
+ InitEvasGL();
+ InitializeProgram();
+ } else {
+ LOG(INFO) << "use sw backend.";
+ CreateNativeSurface();
+ }
+
evas_object_event_callback_add(efl_main_layout_, EVAS_CALLBACK_RESIZE,
OnParentViewResize, this);
evas_object_show(content_image_);
}
bool RWHVAuraOffscreenHelperEfl::ClearCurrent() {
+ if (!use_hw_backend_) {
+ return true;
+ }
+
return evas_gl_make_current(evas_gl_, 0, 0);
}
bool RWHVAuraOffscreenHelperEfl::MakeCurrent() {
+ if (!use_hw_backend_) {
+ return true;
+ }
+
return evas_gl_make_current(evas_gl_, evas_gl_surface_, evas_gl_context_);
}
evas_object_geometry_set(content_image_, x, y, width, height);
evas_object_geometry_set(content_image_elm_host_, x, y, width, height);
+ if (!use_hw_backend_) {
+ return gfx::Size(width, height);
+ }
if (evas_gl_surface_) {
evas_object_image_native_surface_set(content_image_, NULL);
evas_gl_surface_destroy(evas_gl_, evas_gl_surface_);
evas_gl_surface_ =
evas_gl_surface_create(evas_gl_, evas_gl_config_, width, height);
- if (!evas_gl_surface_)
+ if (!evas_gl_surface_) {
LOG(FATAL) << "Failed to create evas gl surface";
+ }
Evas_Native_Surface nativeSurface;
if (evas_gl_native_surface_get(evas_gl_, evas_gl_surface_, &nativeSurface)) {