summaryrefslogtreecommitdiffstats
path: root/src/core/ozone_platform_eglfs.cpp
diff options
context:
space:
mode:
authorAndras Becsi <andras.becsi@theqtcompany.com>2015-02-11 18:37:38 +0100
committerAndras Becsi <andras.becsi@theqtcompany.com>2015-02-20 12:57:24 +0000
commitd2b9c003f87e34ca599d3264a9af371e435ad0f8 (patch)
tree2b9ced68cd24a2a06f8018152fa9f1de862e650e /src/core/ozone_platform_eglfs.cpp
parent552624b40f1af790bf747f52754895314d563f1d (diff)
Fix the build on eLinux
Update ozone layer to the new snapshot, update the embedded_linux.pri configuration, fix the GLSurfaceQt build on non-x11 linux and update embedded command line switches for the 40.0.2214-based chromium snapshot. This patch also updates the snapshot sha1 to include required chromium changes. Change-Id: I7f9446fa1b67a0af7baee564acff41ae33ff1a94 Reviewed-by: Michael BrĂ¼ning <michael.bruning@theqtcompany.com>
Diffstat (limited to 'src/core/ozone_platform_eglfs.cpp')
-rw-r--r--src/core/ozone_platform_eglfs.cpp95
1 files changed, 90 insertions, 5 deletions
diff --git a/src/core/ozone_platform_eglfs.cpp b/src/core/ozone_platform_eglfs.cpp
index bf5db4e3f..f646ac2a6 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() {