2 * Copyright © 2000 SuSE, Inc.
3 * Copyright © 2007, 2009 Red Hat, Inc.
4 * Copyright © 2009 Soren Sandmann
6 * Permission to use, copy, modify, distribute, and sell this software and its
7 * documentation for any purpose is hereby granted without fee, provided that
8 * the above copyright notice appear in all copies and that both that
9 * copyright notice and this permission notice appear in supporting
10 * documentation, and that the name of SuSE not be used in advertising or
11 * publicity pertaining to distribution of the software without specific,
12 * written prior permission. SuSE makes no representations about the
13 * suitability of this software for any purpose. It is provided "as is"
14 * without express or implied warranty.
16 * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
18 * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
20 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
21 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
25 #include "pixman-private.h"
27 static source_pict_class_t
28 solid_fill_classify (pixman_image_t *image,
34 return (image->source.class = SOURCE_IMAGE_CLASS_HORIZONTAL);
38 color_to_uint32 (const pixman_color_t *color)
41 (color->alpha >> 8 << 24) |
42 (color->red >> 8 << 16) |
43 (color->green & 0xff00) |
47 PIXMAN_EXPORT pixman_image_t *
48 pixman_image_create_solid_fill (pixman_color_t *color)
50 pixman_image_t *img = _pixman_image_allocate();
55 img->source.class = SOURCE_IMAGE_CLASS_UNKNOWN;
56 img->common.classify = solid_fill_classify;
59 img->solid.color = color_to_uint32 (color);