Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(384)

Side by Side Diff: components/mus/public/interfaces/quads.mojom

Issue 2056483002: Move quads.mojom from Mus to cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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.
4
5 module mus.mojom;
6
7 import "cc/ipc/filter_operations.mojom";
8 import "cc/ipc/render_pass_id.mojom";
9 import "cc/ipc/shared_quad_state.mojom";
10 import "cc/ipc/surface_id.mojom";
11 import "ui/gfx/geometry/mojo/geometry.mojom";
12 import "ui/gfx/mojo/transform.mojom";
13
14 struct Color {
15 uint32 rgba;
16 };
17
18 struct CheckerboardQuadState {
19 // Checkerboard color.
20 Color color;
21
22 // The scale factor of checkers. Chromium uses device scale factor for
23 // it.
24 float scale;
25 };
26
27 struct DebugBorderQuadState {
28 // Debug border color.
29 Color color;
30
31 // Debug border width.
32 int32 width;
33 };
34
35 // TODO(jamesr): Populate subtype fields.
36 struct IoSurfaceContentQuadState {};
37
38 struct RenderPassQuadState {
39 cc.mojom.RenderPassId render_pass_id;
40
41 // If nonzero, resource id of mask to use when drawing this pass.
42 uint32 mask_resource_id;
43 gfx.mojom.PointF mask_uv_scale;
44 gfx.mojom.Size mask_texture_size;
45
46 // Post-processing filters, applied to the pixels in the render pass' texture.
47 cc.mojom.FilterOperations filters;
48
49 // The scale from layer space of the root layer of the render pass to
50 // the render pass physical pixels. This scale is applied to the filter
51 // parameters for pixel-moving filters. This scale should include
52 // content-to-target-space scale, and device pixel ratio.
53 gfx.mojom.PointF filters_scale;
54
55 // Post-processing filters, applied to the pixels showing through the
56 // background of the render pass, from behind it.
57 cc.mojom.FilterOperations background_filters;
58 };
59
60 struct SolidColorQuadState {
61 Color color;
62 bool force_anti_aliasing_off;
63 };
64
65 struct SurfaceQuadState {
66 cc.mojom.SurfaceId surface;
67 };
68
69 struct TextureQuadState {
70 uint32 resource_id;
71 bool premultiplied_alpha;
72 gfx.mojom.PointF uv_top_left;
73 gfx.mojom.PointF uv_bottom_right;
74 Color background_color;
75 array<float, 4> vertex_opacity;
76 bool y_flipped;
77 bool nearest_neighbor;
78 bool secure_output_only;
79 };
80
81 struct TileQuadState {
82 gfx.mojom.RectF tex_coord_rect;
83 gfx.mojom.Size texture_size;
84 bool swizzle_contents;
85 uint32 resource_id;
86 bool nearest_neighbor;
87 };
88
89 struct StreamVideoQuadState {};
90
91 enum YUVColorSpace {
92 REC_601, // SDTV standard with restricted "studio swing" color range.
93 REC_709, // HDTV standard with restricted "studio swing" color range.
94 JPEG, // Full color range [0, 255] JPEG color space.
95 };
96
97 struct YUVVideoQuadState {
98 gfx.mojom.RectF ya_tex_coord_rect;
99 gfx.mojom.RectF uv_tex_coord_rect;
100 gfx.mojom.Size ya_tex_size;
101 gfx.mojom.Size uv_tex_size;
102 uint32 y_plane_resource_id;
103 uint32 u_plane_resource_id;
104 uint32 v_plane_resource_id;
105 uint32 a_plane_resource_id;
106 YUVColorSpace color_space;
107 float resource_offset;
108 float resource_multiplier;
109 };
110
111 enum Material {
112 DEBUG_BORDER = 1,
113 PICTURE_CONTENT,
114 RENDER_PASS,
115 SOLID_COLOR,
116 STREAM_VIDEO_CONTENT,
117 SURFACE_CONTENT,
118 TEXTURE_CONTENT,
119 TILED_CONTENT,
120 YUV_VIDEO_CONTENT,
121 };
122
123 struct Quad {
124 Material material;
125
126 // This rect, after applying the quad_transform(), gives the geometry that
127 // this quad should draw to. This rect lives in content space.
128 gfx.mojom.Rect rect;
129
130 // This specifies the region of the quad that is opaque. This rect lives in
131 // content space.
132 gfx.mojom.Rect opaque_rect;
133
134 // Allows changing the rect that gets drawn to make it smaller. This value
135 // should be clipped to |rect|. This rect lives in content space.
136 gfx.mojom.Rect visible_rect;
137
138 // Allows changing the rect that gets drawn to make it smaller. This value
139 // should be clipped to |rect|. This rect lives in content space.
140 bool needs_blending;
141
142 // Index into the containing pass' shared quad state array which has state
143 // (transforms etc) shared by multiple quads.
144 uint32 shared_quad_state_index;
145
146 // Only one of the following will be set, depending on the material.
147 CheckerboardQuadState? checkerboard_quad_state;
148 DebugBorderQuadState? debug_border_quad_state;
149 IoSurfaceContentQuadState? io_surface_quad_state;
150 RenderPassQuadState? render_pass_quad_state;
151 SolidColorQuadState? solid_color_quad_state;
152 SurfaceQuadState? surface_quad_state;
153 TextureQuadState? texture_quad_state;
154 TileQuadState? tile_quad_state;
155 StreamVideoQuadState? stream_video_quad_state;
156 YUVVideoQuadState? yuv_video_quad_state;
157 };
158
159 struct Pass {
160 cc.mojom.RenderPassId id;
161 gfx.mojom.Rect output_rect;
162 gfx.mojom.Rect damage_rect;
163 gfx.mojom.Transform transform_to_root_target;
164 bool has_transparent_background;
165 array<Quad> quads;
166 array<cc.mojom.SharedQuadState> shared_quad_states;
167 };
OLDNEW
« no previous file with comments | « components/mus/public/interfaces/compositor_frame.mojom ('k') | components/mus/ws/platform_display.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698