| Index: ui/ozone/platform/dri/gpu_platform_support_gbm.cc
|
| diff --git a/ui/ozone/platform/dri/gpu_platform_support_gbm.cc b/ui/ozone/platform/dri/gpu_platform_support_gbm.cc
|
| index 051538e3b8d0900e07e8e055b1a3fad3a8237fee..1a491ba462611bcddb55385fab4d94e9ef678096 100644
|
| --- a/ui/ozone/platform/dri/gpu_platform_support_gbm.cc
|
| +++ b/ui/ozone/platform/dri/gpu_platform_support_gbm.cc
|
| @@ -7,11 +7,20 @@
|
| #include "ipc/ipc_message_macros.h"
|
| #include "ui/ozone/common/gpu/ozone_gpu_messages.h"
|
| #include "ui/ozone/platform/dri/dri_surface_factory.h"
|
| +#include "ui/ozone/platform/dri/gpu/gpu_messages.h"
|
| +#include "ui/ozone/platform/dri/native_window_delegate_impl.h"
|
| +#include "ui/ozone/platform/dri/native_window_manager.h"
|
|
|
| namespace ui {
|
|
|
| -GpuPlatformSupportGbm::GpuPlatformSupportGbm(DriSurfaceFactory* dri)
|
| - : sender_(NULL), dri_(dri) {
|
| +GpuPlatformSupportGbm::GpuPlatformSupportGbm(
|
| + DriSurfaceFactory* dri,
|
| + NativeWindowManager* window_manager,
|
| + ScreenManager* screen_manager)
|
| + : sender_(NULL),
|
| + dri_(dri),
|
| + window_manager_(window_manager),
|
| + screen_manager_(screen_manager) {
|
| }
|
|
|
| GpuPlatformSupportGbm::~GpuPlatformSupportGbm() {}
|
| @@ -31,6 +40,13 @@ bool GpuPlatformSupportGbm::OnMessageReceived(const IPC::Message& message) {
|
| bool handled = true;
|
|
|
| IPC_BEGIN_MESSAGE_MAP(GpuPlatformSupportGbm, message)
|
| + IPC_MESSAGE_HANDLER(DriGpuMsg_CreateNativeWindowDelegate,
|
| + OnCreateNativeWindowDelegate)
|
| + IPC_MESSAGE_HANDLER(DriGpuMsg_DestoryNativeWindowDelegate,
|
| + OnDestoryNativeWindowDelegate)
|
| + IPC_MESSAGE_HANDLER(DriGpuMsg_NativeWindowBoundsChanged,
|
| + OnNativeWindowBoundsChanged)
|
| +
|
| IPC_MESSAGE_HANDLER(OzoneGpuMsg_CursorSet, OnCursorSet)
|
| IPC_MESSAGE_HANDLER(OzoneGpuMsg_CursorMove, OnCursorMove)
|
| IPC_MESSAGE_UNHANDLED(handled = false);
|
| @@ -44,6 +60,29 @@ bool GpuPlatformSupportGbm::OnMessageReceived(const IPC::Message& message) {
|
| return false;
|
| }
|
|
|
| +void GpuPlatformSupportGbm::OnCreateNativeWindowDelegate(
|
| + gfx::AcceleratedWidget widget) {
|
| + // Due to how the GPU process starts up this IPC call may happen after the IPC
|
| + // to create a surface. Since a surface wants to know the window associated
|
| + // with it, we create it ahead of time. So when this call happens we do not
|
| + // create a delegate if it already exists.
|
| + // Note: NativeWindowDelegateImpl registers itself with |window_manager_| on
|
| + // allocation, so we don't need to keep track of it further.
|
| + if (!window_manager_->HasNativeWindowDelegate(widget))
|
| + new NativeWindowDelegateImpl(widget, window_manager_, screen_manager_);
|
| +}
|
| +
|
| +void GpuPlatformSupportGbm::OnDestoryNativeWindowDelegate(
|
| + gfx::AcceleratedWidget widget) {
|
| + scoped_ptr<NativeWindowDelegate> delegate(
|
| + window_manager_->GetNativeWindowDelegate(widget));
|
| +}
|
| +
|
| +void GpuPlatformSupportGbm::OnNativeWindowBoundsChanged(
|
| + gfx::AcceleratedWidget widget, const gfx::Rect& bounds) {
|
| + window_manager_->GetNativeWindowDelegate(widget)->OnBoundsChanged(bounds);
|
| +}
|
| +
|
| void GpuPlatformSupportGbm::OnCursorSet(gfx::AcceleratedWidget widget,
|
| const SkBitmap& bitmap,
|
| const gfx::Point& location) {
|
|
|