1 // Copyright 2014 The Chromium Authors. 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.
5 // Multiply-included message file, hence no include guard here, but see below
6 // for a much smaller-than-usual include guard section.
10 #include "ipc/ipc_message_macros.h"
11 #include "third_party/skia/include/core/SkBitmap.h"
12 #include "ui/gfx/geometry/point.h"
13 #include "ui/gfx/geometry/rect.h"
14 #include "ui/gfx/ipc/gfx_param_traits.h"
15 #include "ui/gfx/native_widget_types.h"
16 #include "ui/ozone/common/gpu/ozone_gpu_message_params.h"
17 #include "ui/ozone/ozone_export.h"
19 #undef IPC_MESSAGE_EXPORT
20 #define IPC_MESSAGE_EXPORT OZONE_EXPORT
22 #define IPC_MESSAGE_START OzoneGpuMsgStart
24 IPC_ENUM_TRAITS_MAX_VALUE(ui::DisplayConnectionType
,
25 ui::DISPLAY_CONNECTION_TYPE_LAST
)
27 IPC_STRUCT_TRAITS_BEGIN(ui::DisplayMode_Params
)
28 IPC_STRUCT_TRAITS_MEMBER(size
)
29 IPC_STRUCT_TRAITS_MEMBER(is_interlaced
)
30 IPC_STRUCT_TRAITS_MEMBER(refresh_rate
)
31 IPC_STRUCT_TRAITS_END()
33 IPC_STRUCT_TRAITS_BEGIN(ui::DisplaySnapshot_Params
)
34 IPC_STRUCT_TRAITS_MEMBER(display_id
)
35 IPC_STRUCT_TRAITS_MEMBER(origin
)
36 IPC_STRUCT_TRAITS_MEMBER(physical_size
)
37 IPC_STRUCT_TRAITS_MEMBER(type
)
38 IPC_STRUCT_TRAITS_MEMBER(is_aspect_preserving_scaling
)
39 IPC_STRUCT_TRAITS_MEMBER(has_overscan
)
40 IPC_STRUCT_TRAITS_MEMBER(display_name
)
41 IPC_STRUCT_TRAITS_MEMBER(modes
)
42 IPC_STRUCT_TRAITS_MEMBER(has_current_mode
)
43 IPC_STRUCT_TRAITS_MEMBER(current_mode
)
44 IPC_STRUCT_TRAITS_MEMBER(has_native_mode
)
45 IPC_STRUCT_TRAITS_MEMBER(native_mode
)
46 IPC_STRUCT_TRAITS_MEMBER(string_representation
)
47 IPC_STRUCT_TRAITS_END()
49 //------------------------------------------------------------------------------
51 // These are messages from the browser to the GPU process.
53 // Update the HW cursor bitmap & move to specified location.
54 IPC_MESSAGE_CONTROL4(OzoneGpuMsg_CursorSet
,
55 gfx::AcceleratedWidget
,
56 std::vector
<SkBitmap
>,
57 gfx::Point
/* location */,
58 int /* frame_delay_ms */)
60 // Move the HW cursor to the specified location.
61 IPC_MESSAGE_CONTROL2(OzoneGpuMsg_CursorMove
,
62 gfx::AcceleratedWidget
, gfx::Point
)
64 // Explicit creation of a WindowDelegate. We explicitly create the window
65 // delegate such that any state change in the window is not lost while the
66 // surface is created on the GPU side.
67 IPC_MESSAGE_CONTROL1(OzoneGpuMsg_CreateWindowDelegate
,
68 gfx::AcceleratedWidget
/* widget */)
70 IPC_MESSAGE_CONTROL1(OzoneGpuMsg_DestroyWindowDelegate
,
71 gfx::AcceleratedWidget
/* widget */)
73 // Updates the location and size of the widget on the screen.
74 IPC_MESSAGE_CONTROL2(OzoneGpuMsg_WindowBoundsChanged
,
75 gfx::AcceleratedWidget
/* widget */,
76 gfx::Rect
/* bounds */)
78 // Force the DPMS state of the display to on.
79 IPC_MESSAGE_CONTROL0(OzoneGpuMsg_ForceDPMSOn
)
81 // Trigger a display reconfiguration. OzoneHostMsg_UpdateNativeDisplays will be
82 // sent as a response.
83 IPC_MESSAGE_CONTROL0(OzoneGpuMsg_RefreshNativeDisplays
)
85 // Configure a display with the specified mode at the specified location.
86 IPC_MESSAGE_CONTROL3(OzoneGpuMsg_ConfigureNativeDisplay
,
87 int64_t, // display ID
88 ui::DisplayMode_Params
, // display mode
89 gfx::Point
) // origin for the display
91 IPC_MESSAGE_CONTROL1(OzoneGpuMsg_DisableNativeDisplay
,
92 int64_t) // display ID
94 IPC_MESSAGE_CONTROL1(OzoneGpuMsg_AddGraphicsDevice
,
95 base::FilePath
/* device_path */)
97 IPC_MESSAGE_CONTROL1(OzoneGpuMsg_RemoveGraphicsDevice
,
98 base::FilePath
/* device_path */)
100 // Take control of the display
101 IPC_MESSAGE_CONTROL0(OzoneGpuMsg_TakeDisplayControl
)
103 // Let other entity control the display
104 IPC_MESSAGE_CONTROL0(OzoneGpuMsg_RelinquishDisplayControl
)
106 //------------------------------------------------------------------------------
108 // These messages are from the GPU to the browser process.
110 // Updates the list of active displays.
111 IPC_MESSAGE_CONTROL1(OzoneHostMsg_UpdateNativeDisplays
,
112 std::vector
<ui::DisplaySnapshot_Params
>)
114 IPC_MESSAGE_CONTROL2(OzoneHostMsg_DisplayConfigured
,
115 int64_t /* display_id */,