1 /**********************************************************
2 * Copyright 2009-2011 VMware, Inc. All rights reserved.
4 * Permission is hereby granted, free of charge, to any person
5 * obtaining a copy of this software and associated documentation
6 * files (the "Software"), to deal in the Software without
7 * restriction, including without limitation the rights to use, copy,
8 * modify, merge, publish, distribute, sublicense, and/or sell copies
9 * of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be
13 * included in all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 *********************************************************
26 * Zack Rusin <zackr-at-vmware-dot-com>
27 * Thomas Hellstrom <thellstrom-at-vmware-dot-com>
30 #ifndef _XA_COMPOSITE_H_
31 #define _XA_COMPOSITE_H_
33 #include "xa_tracker.h"
34 #include "xa_context.h"
37 * Supported composite ops.
39 enum xa_composite_op
{
58 enum xa_composite_filter
{
64 * Supported clamp methods.
66 enum xa_composite_wrap
{
67 xa_wrap_clamp_to_border
,
69 xa_wrap_mirror_repeat
,
76 enum xa_composite_src_pict_type
{
77 xa_src_pict_solid_fill
80 struct xa_pict_solid_fill
{
81 enum xa_composite_src_pict_type type
;
86 union xa_source_pict
{
88 struct xa_pict_solid_fill solid_fill
;
92 enum xa_formats pict_format
;
93 struct xa_surface
*srf
;
94 struct xa_surface
*alpha_map
;
98 enum xa_composite_wrap wrap
;
99 enum xa_composite_filter filter
;
100 union xa_source_pict
*src_pict
;
103 struct xa_composite
{
104 struct xa_picture
*src
, *mask
, *dst
;
108 struct xa_composite_allocation
{
109 unsigned int xa_composite_size
;
110 unsigned int xa_picture_size
;
111 unsigned int xa_source_pict_size
;
115 * Get allocation sizes for minor bump compatibility.
118 extern const struct xa_composite_allocation
*
119 xa_composite_allocation(void);
121 xa_composite_is_accelerated(const struct xa_composite
*comp
);
123 xa_composite_prepare(struct xa_context
*ctx
, const struct xa_composite
*comp
);
125 xa_composite_rect(struct xa_context
*ctx
,
126 int srcX
, int srcY
, int maskX
, int maskY
,
127 int dstX
, int dstY
, int width
, int height
);
129 xa_composite_done(struct xa_context
*ctx
);