diff --git a/src/3rdparty b/src/3rdparty index a43649f5fb0cd4b284b2b02a010a397e1ff48f8f..888ff83e022e24a7f150116c9e5049847a091d30 160000 --- a/src/3rdparty +++ b/src/3rdparty @@ -1 +1 @@ -Subproject commit a43649f5fb0cd4b284b2b02a010a397e1ff48f8f +Subproject commit 888ff83e022e24a7f150116c9e5049847a091d30 diff --git a/src/core/config/embedded_linux.pri b/src/core/config/embedded_linux.pri index 773bf0be1f133118b5473b44055b7417baf53f02..a0d640c18445ff638ad83f382b42353466e36f78 100644 --- a/src/core/config/embedded_linux.pri +++ b/src/core/config/embedded_linux.pri @@ -2,6 +2,7 @@ GYP_ARGS += "-D qt_os=\"embedded_linux\" -I config/embedded_linux.gypi" GYP_CONFIG += \ build_ffmpegsumo=1 \ + clang=0 \ configuration_policy=0 \ desktop_linux=0 \ disable_nacl=1 \ @@ -23,6 +24,7 @@ GYP_CONFIG += \ enable_themes=0 \ enable_webrtc=0 \ gtest_target_type=none \ + host_clang=0 \ notifications=0 \ ozone_platform_dri=0 \ ozone_platform_test=0 \ @@ -40,6 +42,7 @@ GYP_CONFIG += \ use_gio=0 \ use_gnome_keyring=0 \ use_kerberos=0 \ + use_libpci=0 \ use_openssl=1 \ use_ozone=1 \ use_pango=0 \ diff --git a/src/core/gl_surface_qt.cpp b/src/core/gl_surface_qt.cpp index ad07ce047a2a525a4330d846dba4b5a33a948aa8..85b78cc0e7996438bc857671e40ca8550bb835fe 100644 --- a/src/core/gl_surface_qt.cpp +++ b/src/core/gl_surface_qt.cpp @@ -69,6 +69,12 @@ extern "C" { #include "ui/gl/gl_context_wgl.h" #endif +// From ANGLE's egl/eglext.h. +#ifndef EGL_ANGLE_surface_d3d_texture_2d_share_handle +#define EGL_ANGLE_surface_d3d_texture_2d_share_handle 1 +#define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE 0x3200 +#endif + using ui::GetLastEGLErrorString; namespace gfx { @@ -357,12 +363,13 @@ bool GLSurface::InitializeOneOffInternal() if (GetGLImplementation() == kGLImplementationEGLGLES2) return GLSurfaceQtEGL::InitializeOneOff(); - if (GetGLImplementation() == kGLImplementationDesktopGL) + if (GetGLImplementation() == kGLImplementationDesktopGL) { #if defined(USE_X11) return GLSurfaceQtGLX::InitializeOneOff(); #elif defined(OS_WIN) return GLSurfaceQtWGL::InitializeOneOff(); #endif + } return false; } diff --git a/src/core/ozone_platform_eglfs.cpp b/src/core/ozone_platform_eglfs.cpp index bf5db4e3f33adb8d0a654ca3d41dd049eeaf1ffc..f646ac2a6fc00f48f62f1e5d0ad93e06357760e4 100644 --- a/src/core/ozone_platform_eglfs.cpp +++ b/src/core/ozone_platform_eglfs.cpp @@ -38,12 +38,19 @@ #if defined(USE_OZONE) +#include "base/bind.h" #include "media/ozone/media_ozone_platform.h" #include "ui/events/ozone/device/device_manager.h" -#include "ui/ozone/ozone_platform.h" +#include "ui/events/ozone/evdev/event_factory_evdev.h" +#include "ui/events/ozone/events_ozone.h" +#include "ui/events/platform/platform_event_dispatcher.h" +#include "ui/ozone/common/native_display_delegate_ozone.h" +#include "ui/ozone/public/ozone_platform.h" #include "ui/ozone/public/cursor_factory_ozone.h" #include "ui/ozone/public/gpu_platform_support.h" #include "ui/ozone/public/gpu_platform_support_host.h" +#include "ui/platform_window/platform_window.h" +#include "ui/platform_window/platform_window_delegate.h" namespace media { @@ -56,6 +63,73 @@ MediaOzonePlatform* CreateMediaOzonePlatformEglfs() { namespace ui { +namespace { +class EglfsWindow : public PlatformWindow, public PlatformEventDispatcher { +public: + EglfsWindow(PlatformWindowDelegate* delegate, + EventFactoryEvdev* event_factory, + const gfx::Rect& bounds) + : delegate_(delegate) + , event_factory_(event_factory) + , bounds_(bounds) + { + ui::PlatformEventSource::GetInstance()->AddPlatformEventDispatcher(this); + } + + ~EglfsWindow() override + { + ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this); + } + + // PlatformWindow: + gfx::Rect GetBounds() override; + void SetBounds(const gfx::Rect& bounds) override; + void Show() override { } + void Hide() override { } + void Close() override { } + void SetCapture() override { } + void ReleaseCapture() override { } + void ToggleFullscreen() override { } + void Maximize() override { } + void Minimize() override { } + void Restore() override { } + void SetCursor(PlatformCursor) override { } + void MoveCursorTo(const gfx::Point&) override { } + + // PlatformEventDispatcher: + bool CanDispatchEvent(const PlatformEvent& event) override; + uint32_t DispatchEvent(const PlatformEvent& event) override; + +private: + PlatformWindowDelegate* delegate_; + EventFactoryEvdev* event_factory_; + gfx::Rect bounds_; + + DISALLOW_COPY_AND_ASSIGN(EglfsWindow); +}; + +gfx::Rect EglfsWindow::GetBounds() { + return bounds_; +} + +void EglfsWindow::SetBounds(const gfx::Rect& bounds) { + bounds_ = bounds; + delegate_->OnBoundsChanged(bounds); +} + +bool EglfsWindow::CanDispatchEvent(const ui::PlatformEvent& ne) { + return true; +} + +uint32_t EglfsWindow::DispatchEvent(const ui::PlatformEvent& native_event) { + DispatchEventFromNativeUiEvent( + native_event, base::Bind(&PlatformWindowDelegate::DispatchEvent, + base::Unretained(delegate_))); + + return ui::POST_DISPATCH_STOP_PROPAGATION; +} +} // namespace + OzonePlatformEglfs::OzonePlatformEglfs() {} OzonePlatformEglfs::~OzonePlatformEglfs() {} @@ -64,10 +138,6 @@ ui::SurfaceFactoryOzone* OzonePlatformEglfs::GetSurfaceFactoryOzone() { return surface_factory_ozone_.get(); } -ui::EventFactoryOzone* OzonePlatformEglfs::GetEventFactoryOzone() { - return event_factory_ozone_.get(); -} - ui::CursorFactoryOzone* OzonePlatformEglfs::GetCursorFactoryOzone() { return cursor_factory_ozone_.get(); } @@ -80,6 +150,21 @@ GpuPlatformSupportHost* OzonePlatformEglfs::GetGpuPlatformSupportHost() { return gpu_platform_support_host_.get(); } +scoped_ptr<PlatformWindow> OzonePlatformEglfs::CreatePlatformWindow( + PlatformWindowDelegate* delegate, + const gfx::Rect& bounds) +{ + return make_scoped_ptr<PlatformWindow>( + new EglfsWindow(delegate, + event_factory_ozone_.get(), + bounds)); +} + +scoped_ptr<ui::NativeDisplayDelegate> OzonePlatformEglfs::CreateNativeDisplayDelegate() +{ + return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateOzone()); +} + OzonePlatform* CreateOzonePlatformEglfs() { return new OzonePlatformEglfs; } void OzonePlatformEglfs::InitializeUI() { diff --git a/src/core/ozone_platform_eglfs.h b/src/core/ozone_platform_eglfs.h index 07b9bf4419d95eaa33d8723d31052c9b6b44fc1f..2371bb1e89883d040f8f38a6602d61a3d5b09831 100644 --- a/src/core/ozone_platform_eglfs.h +++ b/src/core/ozone_platform_eglfs.h @@ -39,32 +39,38 @@ #if defined(USE_OZONE) -#include "ui/events/ozone/evdev/event_factory_evdev.h" -#include "ui/ozone/ozone_platform.h" +#include "ui/ozone/public/ozone_platform.h" #include "surface_factory_qt.h" namespace ui { +class DeviceManager; +class EventFactoryEvdev; +class CursorFactoryOzone; + class OzonePlatformEglfs : public OzonePlatform { public: OzonePlatformEglfs(); virtual ~OzonePlatformEglfs(); - virtual ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() OVERRIDE; - virtual ui::EventFactoryOzone* GetEventFactoryOzone() OVERRIDE; - virtual ui::CursorFactoryOzone* GetCursorFactoryOzone() OVERRIDE; - virtual GpuPlatformSupport* GetGpuPlatformSupport() OVERRIDE; - virtual GpuPlatformSupportHost* GetGpuPlatformSupportHost() OVERRIDE; - virtual void InitializeUI() OVERRIDE; - virtual void InitializeGPU() OVERRIDE; + virtual ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() override; + virtual ui::CursorFactoryOzone* GetCursorFactoryOzone() override; + virtual GpuPlatformSupport* GetGpuPlatformSupport() override; + virtual GpuPlatformSupportHost* GetGpuPlatformSupportHost() override; + virtual scoped_ptr<PlatformWindow> CreatePlatformWindow( + PlatformWindowDelegate* delegate, + const gfx::Rect& bounds) override; + virtual scoped_ptr<ui::NativeDisplayDelegate> CreateNativeDisplayDelegate() override; private: + virtual void InitializeUI() override; + virtual void InitializeGPU() override; scoped_ptr<DeviceManager> device_manager_; scoped_ptr<SurfaceFactoryQt> surface_factory_ozone_; - scoped_ptr<ui::CursorFactoryOzone> cursor_factory_ozone_; - scoped_ptr<ui::EventFactoryEvdev> event_factory_ozone_; + scoped_ptr<CursorFactoryOzone> cursor_factory_ozone_; + scoped_ptr<EventFactoryEvdev> event_factory_ozone_; scoped_ptr<GpuPlatformSupport> gpu_platform_support_; scoped_ptr<GpuPlatformSupportHost> gpu_platform_support_host_; diff --git a/src/core/qtwebengine_extras.gypi b/src/core/qtwebengine_extras.gypi index b0e9bc69753c44a69ff41c3b1d7340542c256425..c128f289af732650d619fb5d93a0d509b4cf4767 100644 --- a/src/core/qtwebengine_extras.gypi +++ b/src/core/qtwebengine_extras.gypi @@ -86,9 +86,6 @@ 'EGL_API_FB=1', 'LINUX=1', ], - 'defines!': [ - 'OPENSSLDIR="/etc/ssl"', - ], 'target_conditions': [ ['_type=="shared_library"', { 'ldflags': [ diff --git a/src/core/surface_factory_qt.cpp b/src/core/surface_factory_qt.cpp index cfa63a651e44859a3c83678e23066f5438fde460..14e46b946ab24160e2e5790f7958a44086ccd076 100644 --- a/src/core/surface_factory_qt.cpp +++ b/src/core/surface_factory_qt.cpp @@ -97,7 +97,7 @@ bool SurfaceFactoryQt::LoadEGLGLES2Bindings(AddGLLibraryCallback add_gl_library, gfx::AddGLNativeLibrary(eglLibrary); gfx::AddGLNativeLibrary(gles2Library); return true; -#endif +#endif // defined(OS_ANDROID) } intptr_t SurfaceFactoryQt::GetNativeDisplay() @@ -110,5 +110,5 @@ intptr_t SurfaceFactoryQt::GetNativeDisplay() return reinterpret_cast<intptr_t>(EGL_DEFAULT_DISPLAY); } -#endif +#endif // defined(USE_OZONE) || defined(OS_ANDROID) diff --git a/src/core/surface_factory_qt.h b/src/core/surface_factory_qt.h index ec70d79b121af04d9c71d4b5296bf747b0b75259..bd4eba3c9f6407bb0eb3802fae7faade6fbc17d5 100644 --- a/src/core/surface_factory_qt.h +++ b/src/core/surface_factory_qt.h @@ -48,14 +48,9 @@ class SurfaceFactoryQt { virtual bool LoadEGLGLES2Bindings(AddGLLibraryCallback add_gl_library, SetGLGetProcAddressProcCallback set_gl_get_proc_address) Q_DECL_OVERRIDE; virtual intptr_t GetNativeDisplay() Q_DECL_OVERRIDE; - virtual ui::SurfaceFactoryOzone::HardwareState InitializeHardware() Q_DECL_OVERRIDE { return ui::SurfaceFactoryOzone::INITIALIZED; } - virtual void ShutdownHardware() Q_DECL_OVERRIDE {} - virtual gfx::AcceleratedWidget GetAcceleratedWidget() Q_DECL_OVERRIDE { return 0; } - virtual gfx::AcceleratedWidget RealizeAcceleratedWidget(gfx::AcceleratedWidget w) Q_DECL_OVERRIDE { return 0; } - virtual bool AttemptToResizeAcceleratedWidget(gfx::AcceleratedWidget w, const gfx::Rect& bounds) Q_DECL_OVERRIDE { return false; } }; -#endif +#endif // defined(USE_OZONE) || defined(OS_ANDROID) #endif // SURFACE_FACTORY_QT diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index eb8f8b01d843ea6f0d3224b3cdc8967c323895c8..2e6abd697d6764ab8f52a1e6a6d52ebc60a89f51 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -195,16 +195,13 @@ WebEngineContext::WebEngineContext() parsedCommandLine->AppendSwitch(switches::kInProcessGPU); #if defined(QTWEBENGINE_MOBILE_SWITCHES) - // Inspired from the Android port's default switches + // Inspired by the Android port's default switches parsedCommandLine->AppendSwitch(switches::kEnableOverlayScrollbar); - parsedCommandLine->AppendSwitch(switches::kEnableGestureTapHighlight); parsedCommandLine->AppendSwitch(switches::kEnablePinch); parsedCommandLine->AppendSwitch(switches::kEnableViewport); parsedCommandLine->AppendSwitch(switches::kEnableViewportMeta); - parsedCommandLine->AppendSwitch(switches::kEnableSmoothScrolling); + parsedCommandLine->AppendSwitch(switches::kMainFrameResizesAreOrientationChanges); parsedCommandLine->AppendSwitch(switches::kDisableAcceleratedVideoDecode); - parsedCommandLine->AppendSwitch(switches::kEnableAcceleratedOverflowScroll); - parsedCommandLine->AppendSwitch(switches::kEnableCompositingForFixedPosition); parsedCommandLine->AppendSwitch(switches::kDisableGpuShaderDiskCache); parsedCommandLine->AppendSwitch(switches::kDisable2dCanvasAntialiasing); parsedCommandLine->AppendSwitch(switches::kEnableImplSidePainting); @@ -217,6 +214,7 @@ WebEngineContext::WebEngineContext() // On eAndroid we use this to get the native display // from Qt in GLSurfaceEGL::InitializeOneOff. m_surfaceFactory.reset(new SurfaceFactoryQt()); + parsedCommandLine->AppendSwitch(switches::kDisableOverscrollEdgeEffect); #endif GLContextHelper::initialize();