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(crop_rect
)
71 IPC_STRUCT_TRAITS_MEMBER(plane_z_order
)
72 IPC_STRUCT_TRAITS_END()
76 //------------------------------------------------------------------------------
78 // These are messages from the browser to the GPU process.
80 // Update the HW cursor bitmap & move to specified location.
81 IPC_MESSAGE_CONTROL4(OzoneGpuMsg_CursorSet
,
82 gfx::AcceleratedWidget
,
83 std::vector
<SkBitmap
>,
84 gfx::Point
/* location */,
85 int /* frame_delay_ms */)
87 // Move the HW cursor to the specified location.
88 IPC_MESSAGE_CONTROL2(OzoneGpuMsg_CursorMove
,
89 gfx::AcceleratedWidget
, gfx::Point
)
91 // Explicit creation of a window. We explicitly create the window such
92 // that any state change in the window is not lost while the surface is
93 // created on the GPU side.
94 IPC_MESSAGE_CONTROL1(OzoneGpuMsg_CreateWindow
,
95 gfx::AcceleratedWidget
/* widget */)
97 IPC_MESSAGE_CONTROL1(OzoneGpuMsg_DestroyWindow
,
98 gfx::AcceleratedWidget
/* widget */)
100 // Updates the location and size of the widget on the screen.
101 IPC_MESSAGE_CONTROL2(OzoneGpuMsg_WindowBoundsChanged
,
102 gfx::AcceleratedWidget
/* widget */,
103 gfx::Rect
/* bounds */)
105 // Trigger a display reconfiguration. OzoneHostMsg_UpdateNativeDisplays will be
106 // sent as a response.
107 IPC_MESSAGE_CONTROL0(OzoneGpuMsg_RefreshNativeDisplays
)
109 // Configure a display with the specified mode at the specified location.
110 IPC_MESSAGE_CONTROL3(OzoneGpuMsg_ConfigureNativeDisplay
,
111 int64_t, // display ID
112 ui::DisplayMode_Params
, // display mode
113 gfx::Point
) // origin for the display
115 IPC_MESSAGE_CONTROL1(OzoneGpuMsg_DisableNativeDisplay
,
116 int64_t) // display ID
118 IPC_MESSAGE_CONTROL2(OzoneGpuMsg_AddGraphicsDevice
,
119 base::FilePath
/* device_path */,
120 base::FileDescriptor
/* device_fd */)
122 IPC_MESSAGE_CONTROL1(OzoneGpuMsg_RemoveGraphicsDevice
,
123 base::FilePath
/* device_path */)
125 // Take control of the display
126 IPC_MESSAGE_CONTROL0(OzoneGpuMsg_TakeDisplayControl
)
128 // Let other entity control the display
129 IPC_MESSAGE_CONTROL0(OzoneGpuMsg_RelinquishDisplayControl
)
131 IPC_MESSAGE_CONTROL1(OzoneGpuMsg_GetHDCPState
, int64_t /* display_id */)
133 IPC_MESSAGE_CONTROL2(OzoneGpuMsg_SetHDCPState
,
134 int64_t /* display_id */,
135 ui::HDCPState
/* state */)
137 // Provides the gamma ramp for display adjustment.
138 IPC_MESSAGE_CONTROL2(OzoneGpuMsg_SetGammaRamp
,
139 int64_t, // display ID,
140 std::vector
<ui::GammaRampRGBEntry
>) // lut
142 IPC_MESSAGE_CONTROL2(OzoneGpuMsg_CheckOverlayCapabilities
,
143 gfx::AcceleratedWidget
/* widget */,
144 std::vector
<ui::OverlayCheck_Params
> /* overlays */)
146 //------------------------------------------------------------------------------
148 // These messages are from the GPU to the browser process.
150 // Updates the list of active displays.
151 IPC_MESSAGE_CONTROL1(OzoneHostMsg_UpdateNativeDisplays
,
152 std::vector
<ui::DisplaySnapshot_Params
>)
154 IPC_MESSAGE_CONTROL2(OzoneHostMsg_DisplayConfigured
,
155 int64_t /* display_id */,
158 // Response for OzoneGpuMsg_GetHDCPState.
159 IPC_MESSAGE_CONTROL3(OzoneHostMsg_HDCPStateReceived
,
160 int64_t /* display_id */,
162 ui::HDCPState
/* state */)
164 // Response for OzoneGpuMsg_SetHDCPState.
165 IPC_MESSAGE_CONTROL2(OzoneHostMsg_HDCPStateUpdated
,
166 int64_t /* display_id */,
169 // Response to OzoneGpuMsg_TakeDisplayControl.
170 IPC_MESSAGE_CONTROL1(OzoneHostMsg_DisplayControlTaken
, bool /* success */)
172 // Response to OzoneGpuMsg_RelinquishDisplayControl.
173 IPC_MESSAGE_CONTROL1(OzoneHostMsg_DisplayControlRelinquished
,
176 // Response for OzoneGpuMsg_CheckOverlayCapabilities
177 IPC_MESSAGE_CONTROL2(OzoneHostMsg_OverlayCapabilitiesReceived
,
178 gfx::AcceleratedWidget
/* widget */,