pixman-compose.c \
pixman-pict.c \
pixman-source.c \
+ pixman-solid-fill.c \
pixman-transformed.c \
pixman-transformed-accessors.c \
pixman-utils.c \
pict->class = SOURCE_IMAGE_CLASS_UNKNOWN;
- if (pict->common.type == SOLID)
- {
- pict->class = SOURCE_IMAGE_CLASS_HORIZONTAL;
- }
- else if (pict->common.type == LINEAR)
+ if (pict->common.type == LINEAR)
{
linear_gradient_t *linear = (linear_gradient_t *)pict;
pixman_vector_t v;
return TRUE;
}
-static uint32_t
-color_to_uint32 (const pixman_color_t *color)
-{
- return
- (color->alpha >> 8 << 24) |
- (color->red >> 8 << 16) |
- (color->green & 0xff00) |
- (color->blue >> 8);
-}
-
-static pixman_image_t *
-allocate_image (void)
+pixman_image_t *
+_pixman_image_allocate (void)
{
pixman_image_t *image = malloc (sizeof (pixman_image_t));
/* Constructors */
PIXMAN_EXPORT pixman_image_t *
-pixman_image_create_solid_fill (pixman_color_t *color)
-{
- pixman_image_t *img = allocate_image();
- if (!img)
- return NULL;
-
- init_source_image (&img->solid.common);
-
- img->type = SOLID;
- img->solid.color = color_to_uint32 (color);
-
- return img;
-}
-
-PIXMAN_EXPORT pixman_image_t *
pixman_image_create_linear_gradient (pixman_point_fixed_t *p1,
pixman_point_fixed_t *p2,
const pixman_gradient_stop_t *stops,
return_val_if_fail (n_stops >= 2, NULL);
- image = allocate_image();
+ image = _pixman_image_allocate();
if (!image)
return NULL;
return_val_if_fail (n_stops >= 2, NULL);
- image = allocate_image();
+ image = _pixman_image_allocate();
if (!image)
return NULL;
const pixman_gradient_stop_t *stops,
int n_stops)
{
- pixman_image_t *image = allocate_image();
+ pixman_image_t *image = _pixman_image_allocate();
conical_gradient_t *conical;
if (!image)
return NULL;
}
- image = allocate_image();
+ image = _pixman_image_allocate();
if (!image) {
if (free_me)
return 0;
}
+static uint32_t
+color_to_uint32 (const pixman_color_t *color)
+{
+ return
+ (color->alpha >> 8 << 24) |
+ (color->red >> 8 << 16) |
+ (color->green & 0xff00) |
+ (color->blue >> 8);
+}
+
static pixman_bool_t
color_to_pixel (pixman_color_t *color,
uint32_t *pixel,
_pixman_image_get_storer (pixman_image_t *image,
int wide);
+pixman_image_t *
+_pixman_image_allocate (void);
+
struct point
{
int16_t x, y;
--- /dev/null
+/*
+ * Copyright © 2000 SuSE, Inc.
+ * Copyright © 2007, 2009 Red Hat, Inc.
+ * Copyright © 2009 Soren Sandmann
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of SuSE not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. SuSE makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <config.h>
+#include "pixman-private.h"
+
+static source_pict_class_t
+solid_fill_classify (pixman_image_t *image,
+ int x,
+ int y,
+ int width,
+ int height)
+{
+ return (image->source.class = SOURCE_IMAGE_CLASS_HORIZONTAL);
+}
+
+static uint32_t
+color_to_uint32 (const pixman_color_t *color)
+{
+ return
+ (color->alpha >> 8 << 24) |
+ (color->red >> 8 << 16) |
+ (color->green & 0xff00) |
+ (color->blue >> 8);
+}
+
+PIXMAN_EXPORT pixman_image_t *
+pixman_image_create_solid_fill (pixman_color_t *color)
+{
+ pixman_image_t *img = _pixman_image_allocate();
+
+ if (!img)
+ return NULL;
+
+ img->source.class = SOURCE_IMAGE_CLASS_UNKNOWN;
+ img->common.classify = solid_fill_classify;
+
+ img->type = SOLID;
+ img->solid.color = color_to_uint32 (color);
+
+ return img;
+}