| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 module mus.mojom; | 5 module mus.mojom; |
| 6 | 6 |
| 7 import "cc/ipc/render_pass_id.mojom"; | 7 import "cc/ipc/render_pass_id.mojom"; |
| 8 import "cc/ipc/surface_id.mojom"; | 8 import "cc/ipc/surface_id.mojom"; |
| 9 import "ui/gfx/geometry/mojo/geometry.mojom"; | 9 import "ui/gfx/geometry/mojo/geometry.mojom"; |
| 10 import "ui/gfx/mojo/transform.mojom"; | 10 import "ui/gfx/mojo/transform.mojom"; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 // TODO(jamesr): Populate subtype fields. | 33 // TODO(jamesr): Populate subtype fields. |
| 34 struct IoSurfaceContentQuadState {}; | 34 struct IoSurfaceContentQuadState {}; |
| 35 | 35 |
| 36 struct RenderPassQuadState { | 36 struct RenderPassQuadState { |
| 37 cc.mojom.RenderPassId render_pass_id; | 37 cc.mojom.RenderPassId render_pass_id; |
| 38 | 38 |
| 39 // If nonzero, resource id of mask to use when drawing this pass. | 39 // If nonzero, resource id of mask to use when drawing this pass. |
| 40 uint32 mask_resource_id; | 40 uint32 mask_resource_id; |
| 41 mojo.PointF mask_uv_scale; | 41 gfx.mojom.PointF mask_uv_scale; |
| 42 mojo.Size mask_texture_size; | 42 gfx.mojom.Size mask_texture_size; |
| 43 | 43 |
| 44 // Post-processing filters, applied to the pixels in the render pass' texture. | 44 // Post-processing filters, applied to the pixels in the render pass' texture. |
| 45 // TODO(jamesr): Support | 45 // TODO(jamesr): Support |
| 46 // FilterOperations filters; | 46 // FilterOperations filters; |
| 47 | 47 |
| 48 // The scale from layer space of the root layer of the render pass to | 48 // The scale from layer space of the root layer of the render pass to |
| 49 // the render pass physical pixels. This scale is applied to the filter | 49 // the render pass physical pixels. This scale is applied to the filter |
| 50 // parameters for pixel-moving filters. This scale should include | 50 // parameters for pixel-moving filters. This scale should include |
| 51 // content-to-target-space scale, and device pixel ratio. | 51 // content-to-target-space scale, and device pixel ratio. |
| 52 mojo.PointF filters_scale; | 52 gfx.mojom.PointF filters_scale; |
| 53 | 53 |
| 54 // Post-processing filters, applied to the pixels showing through the | 54 // Post-processing filters, applied to the pixels showing through the |
| 55 // background of the render pass, from behind it. | 55 // background of the render pass, from behind it. |
| 56 // TODO(jamesr): Support | 56 // TODO(jamesr): Support |
| 57 // FilterOperations background_filters; | 57 // FilterOperations background_filters; |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 struct SolidColorQuadState { | 60 struct SolidColorQuadState { |
| 61 Color color; | 61 Color color; |
| 62 bool force_anti_aliasing_off; | 62 bool force_anti_aliasing_off; |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 struct SurfaceQuadState { | 65 struct SurfaceQuadState { |
| 66 cc.mojom.SurfaceId surface; | 66 cc.mojom.SurfaceId surface; |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 struct TextureQuadState { | 69 struct TextureQuadState { |
| 70 uint32 resource_id; | 70 uint32 resource_id; |
| 71 bool premultiplied_alpha; | 71 bool premultiplied_alpha; |
| 72 mojo.PointF uv_top_left; | 72 gfx.mojom.PointF uv_top_left; |
| 73 mojo.PointF uv_bottom_right; | 73 gfx.mojom.PointF uv_bottom_right; |
| 74 Color background_color; | 74 Color background_color; |
| 75 array<float, 4> vertex_opacity; | 75 array<float, 4> vertex_opacity; |
| 76 bool y_flipped; | 76 bool y_flipped; |
| 77 bool nearest_neighbor; | 77 bool nearest_neighbor; |
| 78 bool secure_output_only; | 78 bool secure_output_only; |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 struct TileQuadState { | 81 struct TileQuadState { |
| 82 mojo.RectF tex_coord_rect; | 82 gfx.mojom.RectF tex_coord_rect; |
| 83 mojo.Size texture_size; | 83 gfx.mojom.Size texture_size; |
| 84 bool swizzle_contents; | 84 bool swizzle_contents; |
| 85 uint32 resource_id; | 85 uint32 resource_id; |
| 86 bool nearest_neighbor; | 86 bool nearest_neighbor; |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 struct StreamVideoQuadState {}; | 89 struct StreamVideoQuadState {}; |
| 90 | 90 |
| 91 enum YUVColorSpace { | 91 enum YUVColorSpace { |
| 92 REC_601, // SDTV standard with restricted "studio swing" color range. | 92 REC_601, // SDTV standard with restricted "studio swing" color range. |
| 93 REC_709, // HDTV 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. | 94 JPEG, // Full color range [0, 255] JPEG color space. |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 struct YUVVideoQuadState { | 97 struct YUVVideoQuadState { |
| 98 mojo.RectF ya_tex_coord_rect; | 98 gfx.mojom.RectF ya_tex_coord_rect; |
| 99 mojo.RectF uv_tex_coord_rect; | 99 gfx.mojom.RectF uv_tex_coord_rect; |
| 100 mojo.Size ya_tex_size; | 100 gfx.mojom.Size ya_tex_size; |
| 101 mojo.Size uv_tex_size; | 101 gfx.mojom.Size uv_tex_size; |
| 102 uint32 y_plane_resource_id; | 102 uint32 y_plane_resource_id; |
| 103 uint32 u_plane_resource_id; | 103 uint32 u_plane_resource_id; |
| 104 uint32 v_plane_resource_id; | 104 uint32 v_plane_resource_id; |
| 105 uint32 a_plane_resource_id; | 105 uint32 a_plane_resource_id; |
| 106 YUVColorSpace color_space; | 106 YUVColorSpace color_space; |
| 107 float resource_offset; | 107 float resource_offset; |
| 108 float resource_multiplier; | 108 float resource_multiplier; |
| 109 }; | 109 }; |
| 110 | 110 |
| 111 enum Material { | 111 enum Material { |
| 112 DEBUG_BORDER = 1, | 112 DEBUG_BORDER = 1, |
| 113 PICTURE_CONTENT, | 113 PICTURE_CONTENT, |
| 114 RENDER_PASS, | 114 RENDER_PASS, |
| 115 SOLID_COLOR, | 115 SOLID_COLOR, |
| 116 STREAM_VIDEO_CONTENT, | 116 STREAM_VIDEO_CONTENT, |
| 117 SURFACE_CONTENT, | 117 SURFACE_CONTENT, |
| 118 TEXTURE_CONTENT, | 118 TEXTURE_CONTENT, |
| 119 TILED_CONTENT, | 119 TILED_CONTENT, |
| 120 YUV_VIDEO_CONTENT, | 120 YUV_VIDEO_CONTENT, |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 struct Quad { | 123 struct Quad { |
| 124 Material material; | 124 Material material; |
| 125 | 125 |
| 126 // This rect, after applying the quad_transform(), gives the geometry that | 126 // This rect, after applying the quad_transform(), gives the geometry that |
| 127 // this quad should draw to. This rect lives in content space. | 127 // this quad should draw to. This rect lives in content space. |
| 128 mojo.Rect rect; | 128 gfx.mojom.Rect rect; |
| 129 | 129 |
| 130 // This specifies the region of the quad that is opaque. This rect lives in | 130 // This specifies the region of the quad that is opaque. This rect lives in |
| 131 // content space. | 131 // content space. |
| 132 mojo.Rect opaque_rect; | 132 gfx.mojom.Rect opaque_rect; |
| 133 | 133 |
| 134 // Allows changing the rect that gets drawn to make it smaller. This value | 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. | 135 // should be clipped to |rect|. This rect lives in content space. |
| 136 mojo.Rect visible_rect; | 136 gfx.mojom.Rect visible_rect; |
| 137 | 137 |
| 138 // Allows changing the rect that gets drawn to make it smaller. This value | 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. | 139 // should be clipped to |rect|. This rect lives in content space. |
| 140 bool needs_blending; | 140 bool needs_blending; |
| 141 | 141 |
| 142 // Index into the containing pass' shared quad state array which has state | 142 // Index into the containing pass' shared quad state array which has state |
| 143 // (transforms etc) shared by multiple quads. | 143 // (transforms etc) shared by multiple quads. |
| 144 uint32 shared_quad_state_index; | 144 uint32 shared_quad_state_index; |
| 145 | 145 |
| 146 // Only one of the following will be set, depending on the material. | 146 // Only one of the following will be set, depending on the material. |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 kColor_Mode, | 194 kColor_Mode, |
| 195 kLuminosity_Mode, | 195 kLuminosity_Mode, |
| 196 kLastMode = kLuminosity_Mode | 196 kLastMode = kLuminosity_Mode |
| 197 }; | 197 }; |
| 198 | 198 |
| 199 struct SharedQuadState { | 199 struct SharedQuadState { |
| 200 // mojo.Transforms quad rects into the target content space. | 200 // mojo.Transforms quad rects into the target content space. |
| 201 gfx.mojom.Transform quad_to_target_transform; | 201 gfx.mojom.Transform quad_to_target_transform; |
| 202 | 202 |
| 203 // The size of the quads' originating layer in the space of the quad rects. | 203 // The size of the quads' originating layer in the space of the quad rects. |
| 204 mojo.Size quad_layer_bounds; | 204 gfx.mojom.Size quad_layer_bounds; |
| 205 | 205 |
| 206 // The size of the visible area in the quads' originating layer, in the space | 206 // The size of the visible area in the quads' originating layer, in the space |
| 207 // of the quad rects. | 207 // of the quad rects. |
| 208 mojo.Rect visible_quad_layer_rect; | 208 gfx.mojom.Rect visible_quad_layer_rect; |
| 209 | 209 |
| 210 // This rect lives in the target content space. | 210 // This rect lives in the target content space. |
| 211 mojo.Rect clip_rect; | 211 gfx.mojom.Rect clip_rect; |
| 212 | 212 |
| 213 bool is_clipped; | 213 bool is_clipped; |
| 214 float opacity; | 214 float opacity; |
| 215 SkXfermode blend_mode; | 215 SkXfermode blend_mode; |
| 216 int32 sorting_context_id; | 216 int32 sorting_context_id; |
| 217 }; | 217 }; |
| 218 | 218 |
| 219 struct Pass { | 219 struct Pass { |
| 220 cc.mojom.RenderPassId id; | 220 cc.mojom.RenderPassId id; |
| 221 mojo.Rect output_rect; | 221 gfx.mojom.Rect output_rect; |
| 222 mojo.Rect damage_rect; | 222 gfx.mojom.Rect damage_rect; |
| 223 gfx.mojom.Transform transform_to_root_target; | 223 gfx.mojom.Transform transform_to_root_target; |
| 224 bool has_transparent_background; | 224 bool has_transparent_background; |
| 225 array<Quad> quads; | 225 array<Quad> quads; |
| 226 array<SharedQuadState> shared_quad_states; | 226 array<SharedQuadState> shared_quad_states; |
| 227 }; | 227 }; |
| OLD | NEW |