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 import "mojo/services/public/interfaces/geometry/geometry.mojom"
6 import "mojo/services/public/interfaces/surfaces/surface_id.mojom"
14 // TODO(jamesr): Populate subtype fields.
15 struct CheckerboardQuadState {};
17 struct DebugBorderQuadState {};
19 struct IoSurfaceContentQuadState {};
21 struct RenderPassQuadState {};
23 struct SolidColorQuadState {
25 bool force_anti_aliasing_off;
28 struct SurfaceQuadState {
32 struct TextureQuadState {
34 bool premultiplied_alpha;
35 mojo.PointF uv_top_left;
36 mojo.PointF uv_bottom_right;
37 Color background_color;
38 float[4] vertex_opacity;
42 struct TiledContentQuadState {};
44 struct StreamVideoQuadState {};
46 struct YUVVideoQuadState {};
65 // This rect, after applying the quad_transform(), gives the geometry that
66 // this quad should draw to. This rect lives in content space.
69 // This specifies the region of the quad that is opaque. This rect lives in
71 mojo.Rect opaque_rect;
73 // Allows changing the rect that gets drawn to make it smaller. This value
74 // should be clipped to |rect|. This rect lives in content space.
75 mojo.Rect visible_rect;
77 // Allows changing the rect that gets drawn to make it smaller. This value
78 // should be clipped to |rect|. This rect lives in content space.
81 // Index into the containing pass' shared quad state array which has state
82 // (transforms etc) shared by multiple quads.
83 int32 shared_quad_state_index;
85 // Only one of the following will be set, depending on the material.
86 CheckerboardQuadState? checkerboard_quad_state;
87 DebugBorderQuadState? debug_border_quad_state;
88 IoSurfaceContentQuadState? io_surface_quad_state;
89 RenderPassQuadState? render_pass_quad_state;
90 SolidColorQuadState? solid_color_quad_state;
91 SurfaceQuadState? surface_quad_state;
92 TextureQuadState? texture_quad_state;
93 TiledContentQuadState? tiled_content_quad_state;
94 StreamVideoQuadState? stream_video_quad_state;
95 YUVVideoQuadState? yuv_video_quad_state;
99 kClear_Mode = 0, //!< [0, 0]
100 kSrc_Mode, //!< [Sa, Sc]
101 kDst_Mode, //!< [Da, Dc]
102 kSrcOver_Mode, //!< [Sa + Da - Sa*Da, Rc = Sc + (1 - Sa)*Dc]
103 kDstOver_Mode, //!< [Sa + Da - Sa*Da, Rc = Dc + (1 - Da)*Sc]
104 kSrcIn_Mode, //!< [Sa * Da, Sc * Da]
105 kDstIn_Mode, //!< [Sa * Da, Sa * Dc]
106 kSrcOut_Mode, //!< [Sa * (1 - Da), Sc * (1 - Da)]
107 kDstOut_Mode, //!< [Da * (1 - Sa), Dc * (1 - Sa)]
108 kSrcATop_Mode, //!< [Da, Sc * Da + (1 - Sa) * Dc]
109 kDstATop_Mode, //!< [Sa, Sa * Dc + Sc * (1 - Da)]
110 kXor_Mode, //!< [Sa + Da - 2 * Sa * Da, Sc * (1 - Da) + (1 - Sa) * Dc]
111 kPlus_Mode, //!< [Sa + Da, Sc + Dc]
112 kModulate_Mode, // multiplies all components (= alpha and color)
114 // Following blend modes are defined in the CSS Compositing standard:
115 // https://dvcs.w3.org/hg/FXTF/rawfile/tip/compositing/index.html#blending
117 kLastCoeffMode = kScreen_Mode,
129 kLastSeparableMode = kMultiply_Mode,
135 kLastMode = kLuminosity_Mode
138 struct SharedQuadState {
139 // Transforms from quad's original content space to its target content space.
140 mojo.Transform content_to_target_transform;
142 // This size lives in the content space for the quad's originating layer.
143 mojo.Size content_bounds;
145 // This rect lives in the content space for the quad's originating layer.
146 mojo.Rect visible_content_rect;
148 // This rect lives in the target content space.
153 SkXfermode blend_mode;
154 int32 sorting_context_id;
159 mojo.Rect output_rect;
160 mojo.Rect damage_rect;
161 mojo.Transform transform_to_root_target;
162 bool has_transparent_background;
164 SharedQuadState[] shared_quad_states;