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 "base/file_descriptor_posix.h"
11 #include "ipc/ipc_message_macros.h"
12 #include "third_party/skia/include/core/SkBitmap.h"
13 #include "ui/display/types/display_constants.h"
14 #include "ui/display/types/gamma_ramp_rgb_entry.h"
15 #include "ui/gfx/geometry/point.h"
16 #include "ui/gfx/geometry/rect.h"
17 #include "ui/gfx/ipc/gfx_param_traits.h"
18 #include "ui/gfx/ipc/gfx_param_traits_macros.h"
19 #include "ui/gfx/native_widget_types.h"
20 #include "ui/ozone/common/gpu/ozone_gpu_message_params.h"
21 #include "ui/ozone/ozone_export.h"
23 #undef IPC_MESSAGE_EXPORT
24 #define IPC_MESSAGE_EXPORT OZONE_EXPORT
26 #define IPC_MESSAGE_START OzoneGpuMsgStart
28 IPC_ENUM_TRAITS_MAX_VALUE(ui::DisplayConnectionType
,
29 ui::DISPLAY_CONNECTION_TYPE_LAST
)
31 IPC_ENUM_TRAITS_MAX_VALUE(ui::HDCPState
, ui::HDCP_STATE_LAST
)
33 IPC_ENUM_TRAITS_MAX_VALUE(gfx::OverlayTransform
, gfx::OVERLAY_TRANSFORM_LAST
)
36 IPC_STRUCT_TRAITS_BEGIN(ui::DisplayMode_Params
)
37 IPC_STRUCT_TRAITS_MEMBER(size
)
38 IPC_STRUCT_TRAITS_MEMBER(is_interlaced
)
39 IPC_STRUCT_TRAITS_MEMBER(refresh_rate
)
40 IPC_STRUCT_TRAITS_END()
42 IPC_STRUCT_TRAITS_BEGIN(ui::DisplaySnapshot_Params
)
43 IPC_STRUCT_TRAITS_MEMBER(display_id
)
44 IPC_STRUCT_TRAITS_MEMBER(origin
)
45 IPC_STRUCT_TRAITS_MEMBER(physical_size
)
46 IPC_STRUCT_TRAITS_MEMBER(type
)
47 IPC_STRUCT_TRAITS_MEMBER(is_aspect_preserving_scaling
)
48 IPC_STRUCT_TRAITS_MEMBER(has_overscan
)
49 IPC_STRUCT_TRAITS_MEMBER(display_name
)
50 IPC_STRUCT_TRAITS_MEMBER(modes
)
51 IPC_STRUCT_TRAITS_MEMBER(has_current_mode
)
52 IPC_STRUCT_TRAITS_MEMBER(current_mode
)
53 IPC_STRUCT_TRAITS_MEMBER(has_native_mode
)
54 IPC_STRUCT_TRAITS_MEMBER(native_mode
)
55 IPC_STRUCT_TRAITS_MEMBER(product_id
)
56 IPC_STRUCT_TRAITS_MEMBER(string_representation
)
57 IPC_STRUCT_TRAITS_END()
59 IPC_STRUCT_TRAITS_BEGIN(ui::GammaRampRGBEntry
)
60 IPC_STRUCT_TRAITS_MEMBER(r
)
61 IPC_STRUCT_TRAITS_MEMBER(g
)
62 IPC_STRUCT_TRAITS_MEMBER(b
)
63 IPC_STRUCT_TRAITS_END()
65 IPC_STRUCT_TRAITS_BEGIN(ui::OverlayCheck_Params
)
66 IPC_STRUCT_TRAITS_MEMBER(buffer_size
)
67 IPC_STRUCT_TRAITS_MEMBER(transform
)
68 IPC_STRUCT_TRAITS_MEMBER(format
)
69 IPC_STRUCT_TRAITS_MEMBER(display_rect
)
70 IPC_STRUCT_TRAITS_MEMBER(plane_z_order
)
71 IPC_STRUCT_TRAITS_END()
75 //------------------------------------------------------------------------------
77 // These are messages from the browser to the GPU process.
79 // Update the HW cursor bitmap & move to specified location.
80 IPC_MESSAGE_CONTROL4(OzoneGpuMsg_CursorSet
,
81 gfx::AcceleratedWidget
,
82 std::vector
<SkBitmap
>,
83 gfx::Point
/* location */,
84 int /* frame_delay_ms */)
86 // Move the HW cursor to the specified location.
87 IPC_MESSAGE_CONTROL2(OzoneGpuMsg_CursorMove
,
88 gfx::AcceleratedWidget
, gfx::Point
)
90 // Explicit creation of a window. We explicitly create the window such
91 // that any state change in the window is not lost while the surface is
92 // created on the GPU side.
93 IPC_MESSAGE_CONTROL1(OzoneGpuMsg_CreateWindow
,
94 gfx::AcceleratedWidget
/* widget */)
96 IPC_MESSAGE_CONTROL1(OzoneGpuMsg_DestroyWindow
,
97 gfx::AcceleratedWidget
/* widget */)
99 // Updates the location and size of the widget on the screen.
100 IPC_MESSAGE_CONTROL2(OzoneGpuMsg_WindowBoundsChanged
,
101 gfx::AcceleratedWidget
/* widget */,
102 gfx::Rect
/* bounds */)
104 // Trigger a display reconfiguration. OzoneHostMsg_UpdateNativeDisplays will be
105 // sent as a response.
106 IPC_MESSAGE_CONTROL0(OzoneGpuMsg_RefreshNativeDisplays
)
108 // Configure a display with the specified mode at the specified location.
109 IPC_MESSAGE_CONTROL3(OzoneGpuMsg_ConfigureNativeDisplay
,
110 int64_t, // display ID
111 ui::DisplayMode_Params
, // display mode
112 gfx::Point
) // origin for the display
114 IPC_MESSAGE_CONTROL1(OzoneGpuMsg_DisableNativeDisplay
,
115 int64_t) // display ID
117 IPC_MESSAGE_CONTROL2(OzoneGpuMsg_AddGraphicsDevice
,
118 base::FilePath
/* device_path */,
119 base::FileDescriptor
/* device_fd */)
121 IPC_MESSAGE_CONTROL1(OzoneGpuMsg_RemoveGraphicsDevice
,
122 base::FilePath
/* device_path */)
124 // Take control of the display
125 IPC_MESSAGE_CONTROL0(OzoneGpuMsg_TakeDisplayControl
)
127 // Let other entity control the display
128 IPC_MESSAGE_CONTROL0(OzoneGpuMsg_RelinquishDisplayControl
)
130 IPC_MESSAGE_CONTROL1(OzoneGpuMsg_GetHDCPState
, int64_t /* display_id */)
132 IPC_MESSAGE_CONTROL2(OzoneGpuMsg_SetHDCPState
,
133 int64_t /* display_id */,
134 ui::HDCPState
/* state */)
136 // Provides the gamma ramp for display adjustment.
137 IPC_MESSAGE_CONTROL2(OzoneGpuMsg_SetGammaRamp
,
138 int64_t, // display ID,
139 std::vector
<ui::GammaRampRGBEntry
>) // lut
141 IPC_MESSAGE_CONTROL2(OzoneGpuMsg_CheckOverlayCapabilities
,
142 gfx::AcceleratedWidget
/* widget */,
143 std::vector
<ui::OverlayCheck_Params
> /* overlays */)
145 //------------------------------------------------------------------------------
147 // These messages are from the GPU to the browser process.
149 // Updates the list of active displays.
150 IPC_MESSAGE_CONTROL1(OzoneHostMsg_UpdateNativeDisplays
,
151 std::vector
<ui::DisplaySnapshot_Params
>)
153 IPC_MESSAGE_CONTROL2(OzoneHostMsg_DisplayConfigured
,
154 int64_t /* display_id */,
157 // Response for OzoneGpuMsg_GetHDCPState.
158 IPC_MESSAGE_CONTROL3(OzoneHostMsg_HDCPStateReceived
,
159 int64_t /* display_id */,
161 ui::HDCPState
/* state */)
163 // Response for OzoneGpuMsg_SetHDCPState.
164 IPC_MESSAGE_CONTROL2(OzoneHostMsg_HDCPStateUpdated
,
165 int64_t /* display_id */,
168 // Response to OzoneGpuMsg_TakeDisplayControl.
169 IPC_MESSAGE_CONTROL1(OzoneHostMsg_DisplayControlTaken
, bool /* success */)
171 // Response to OzoneGpuMsg_RelinquishDisplayControl.
172 IPC_MESSAGE_CONTROL1(OzoneHostMsg_DisplayControlRelinquished
,
175 // Response for OzoneGpuMsg_CheckOverlayCapabilities
176 IPC_MESSAGE_CONTROL2(OzoneHostMsg_OverlayCapabilitiesReceived
,
177 gfx::AcceleratedWidget
/* widget */,