1 // Copyright (c) 2015 Samsung Electronics. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
7 #include <Elementary.h>
8 #include "ecore_x_wayland_wrapper.h"
11 #include "base/logging.h"
12 #include "base/message_loop/message_loop.h"
13 #include "base/message_loop/message_pump_ecore.h"
14 #include "cc/base/switches.h"
15 #include "content/common/paths_efl.h"
16 #include "content/public/common/content_switches.h"
17 #include "ui/compositor/compositor_switches.h"
18 #include "ui/gfx/screen_efl.h"
19 #include "ui/gfx/switches.h"
20 #include "ui/gl/gl_switches.h"
21 #include "ui/ozone/public/ozone_platform.h"
26 scoped_ptr<base::MessagePump> MessagePumpFactory() {
27 return scoped_ptr<base::MessagePump>(new base::MessagePumpEcore);
31 int Initialize(int argc, const char* argv[]) {
32 base::CommandLine::Init(argc, argv);
34 const base::CommandLine& cmd_line = *base::CommandLine::ForCurrentProcess();
35 std::string process_type =
36 cmd_line.GetSwitchValueASCII(switches::kProcessType);
38 if (process_type != "zygote") {
39 elm_init(argc, (char**)argv);
40 elm_config_accel_preference_set("hw");
43 #if defined(USE_WAYLAND)
52 if (!base::MessageLoop::InitMessagePumpForUIFactory(&MessagePumpFactory)) {
53 LOG(ERROR) << "Failed to install EFL message pump!";
57 ui::InstallScreenInstance();
59 #if defined(USE_OZONE)
60 ui::OzonePlatform::InitializeForUI();
68 void AppendPortParams(base::CommandLine& cmdline) {
69 cmdline.AppendSwitchASCII(switches::kUseGL,
70 gfx::kGLImplementationEGLName);
71 cmdline.AppendSwitch(switches::kInProcessGPU);
73 #if !defined(EWK_BRINGUP)
74 // [M44_2403] Temporary disabling the codes for switching to new chromium
75 // FIXME: http://web.sec.samsung.net/bugzilla/show_bug.cgi?id=14040
77 cmdline.AppendSwitch(cc::switches::kEnableTileCompression);
78 cmdline.AppendSwitchASCII(cc::switches::kTileCompressionThreshold, "-1");
79 cmdline.AppendSwitchASCII(cc::switches::kTileCompressionMethod, "3");
81 // Select ETC1 compression method
82 if (!cmdline.HasSwitch(cc::switches::kDisableTileCompression) &&
83 cmdline.HasSwitch(cc::switches::kEnableTileCompression))
84 cmdline.AppendSwitch(switches::kDisableGpuRasterization);
88 #if defined(OS_TIZEN_TV)
89 cmdline.AppendSwitchASCII(switches::kAcceleratedCanvas2dMSAASampleCount, "4");