Supervised user whitelists: Cleanup
[chromium-blink-merge.git] / ui / ozone / common / gpu / ozone_gpu_messages.h
blobbc9a465d435350af197c02f8ee8c1b0dde8a8bd5
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.
8 #include <vector>
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/gfx/geometry/point.h"
15 #include "ui/gfx/geometry/rect.h"
16 #include "ui/gfx/ipc/gfx_param_traits.h"
17 #include "ui/gfx/native_widget_types.h"
18 #include "ui/ozone/common/gpu/ozone_gpu_message_params.h"
19 #include "ui/ozone/ozone_export.h"
21 #undef IPC_MESSAGE_EXPORT
22 #define IPC_MESSAGE_EXPORT OZONE_EXPORT
24 #define IPC_MESSAGE_START OzoneGpuMsgStart
26 IPC_ENUM_TRAITS_MAX_VALUE(ui::DisplayConnectionType,
27 ui::DISPLAY_CONNECTION_TYPE_LAST)
29 IPC_ENUM_TRAITS_MAX_VALUE(ui::HDCPState, ui::HDCP_STATE_LAST)
31 IPC_STRUCT_TRAITS_BEGIN(ui::DisplayMode_Params)
32 IPC_STRUCT_TRAITS_MEMBER(size)
33 IPC_STRUCT_TRAITS_MEMBER(is_interlaced)
34 IPC_STRUCT_TRAITS_MEMBER(refresh_rate)
35 IPC_STRUCT_TRAITS_END()
37 IPC_STRUCT_TRAITS_BEGIN(ui::DisplaySnapshot_Params)
38 IPC_STRUCT_TRAITS_MEMBER(display_id)
39 IPC_STRUCT_TRAITS_MEMBER(origin)
40 IPC_STRUCT_TRAITS_MEMBER(physical_size)
41 IPC_STRUCT_TRAITS_MEMBER(type)
42 IPC_STRUCT_TRAITS_MEMBER(is_aspect_preserving_scaling)
43 IPC_STRUCT_TRAITS_MEMBER(has_overscan)
44 IPC_STRUCT_TRAITS_MEMBER(display_name)
45 IPC_STRUCT_TRAITS_MEMBER(modes)
46 IPC_STRUCT_TRAITS_MEMBER(has_current_mode)
47 IPC_STRUCT_TRAITS_MEMBER(current_mode)
48 IPC_STRUCT_TRAITS_MEMBER(has_native_mode)
49 IPC_STRUCT_TRAITS_MEMBER(native_mode)
50 IPC_STRUCT_TRAITS_MEMBER(string_representation)
51 IPC_STRUCT_TRAITS_END()
53 //------------------------------------------------------------------------------
54 // GPU Messages
55 // These are messages from the browser to the GPU process.
57 // Update the HW cursor bitmap & move to specified location.
58 IPC_MESSAGE_CONTROL4(OzoneGpuMsg_CursorSet,
59 gfx::AcceleratedWidget,
60 std::vector<SkBitmap>,
61 gfx::Point /* location */,
62 int /* frame_delay_ms */)
64 // Move the HW cursor to the specified location.
65 IPC_MESSAGE_CONTROL2(OzoneGpuMsg_CursorMove,
66 gfx::AcceleratedWidget, gfx::Point)
68 // Explicit creation of a WindowDelegate. We explicitly create the window
69 // delegate such that any state change in the window is not lost while the
70 // surface is created on the GPU side.
71 IPC_MESSAGE_CONTROL1(OzoneGpuMsg_CreateWindowDelegate,
72 gfx::AcceleratedWidget /* widget */)
74 IPC_MESSAGE_CONTROL1(OzoneGpuMsg_DestroyWindowDelegate,
75 gfx::AcceleratedWidget /* widget */)
77 // Updates the location and size of the widget on the screen.
78 IPC_MESSAGE_CONTROL2(OzoneGpuMsg_WindowBoundsChanged,
79 gfx::AcceleratedWidget /* widget */,
80 gfx::Rect /* bounds */)
82 // Trigger a display reconfiguration. OzoneHostMsg_UpdateNativeDisplays will be
83 // sent as a response.
84 IPC_MESSAGE_CONTROL0(OzoneGpuMsg_RefreshNativeDisplays)
86 // Configure a display with the specified mode at the specified location.
87 IPC_MESSAGE_CONTROL3(OzoneGpuMsg_ConfigureNativeDisplay,
88 int64_t, // display ID
89 ui::DisplayMode_Params, // display mode
90 gfx::Point) // origin for the display
92 IPC_MESSAGE_CONTROL1(OzoneGpuMsg_DisableNativeDisplay,
93 int64_t) // display ID
95 IPC_MESSAGE_CONTROL2(OzoneGpuMsg_AddGraphicsDevice,
96 base::FilePath /* device_path */,
97 base::FileDescriptor /* device_fd */)
99 IPC_MESSAGE_CONTROL1(OzoneGpuMsg_RemoveGraphicsDevice,
100 base::FilePath /* device_path */)
102 // Take control of the display
103 IPC_MESSAGE_CONTROL0(OzoneGpuMsg_TakeDisplayControl)
105 // Let other entity control the display
106 IPC_MESSAGE_CONTROL0(OzoneGpuMsg_RelinquishDisplayControl)
108 IPC_MESSAGE_CONTROL1(OzoneGpuMsg_GetHDCPState, int64_t /* display_id */)
110 IPC_MESSAGE_CONTROL2(OzoneGpuMsg_SetHDCPState,
111 int64_t /* display_id */,
112 ui::HDCPState /* state */)
114 //------------------------------------------------------------------------------
115 // Browser Messages
116 // These messages are from the GPU to the browser process.
118 // Updates the list of active displays.
119 IPC_MESSAGE_CONTROL1(OzoneHostMsg_UpdateNativeDisplays,
120 std::vector<ui::DisplaySnapshot_Params>)
122 IPC_MESSAGE_CONTROL2(OzoneHostMsg_DisplayConfigured,
123 int64_t /* display_id */,
124 bool /* status */)
126 // Response for OzoneGpuMsg_GetHDCPState.
127 IPC_MESSAGE_CONTROL3(OzoneHostMsg_HDCPStateReceived,
128 int64_t /* display_id */,
129 bool /* success */,
130 ui::HDCPState /* state */)
132 // Response for OzoneGpuMsg_SetHDCPState.
133 IPC_MESSAGE_CONTROL2(OzoneHostMsg_HDCPStateUpdated,
134 int64_t /* display_id */,
135 bool /* success */)