Back to index

lightning-sunbird  0.9+nobinonly
move_to_show_surface.c
Go to the documentation of this file.
00001 /*
00002  * Copyright © 2004 Red Hat, Inc.
00003  *
00004  * Permission to use, copy, modify, distribute, and sell this software
00005  * and its documentation for any purpose is hereby granted without
00006  * fee, provided that the above copyright notice appear in all copies
00007  * and that both that copyright notice and this permission notice
00008  * appear in supporting documentation, and that the name of
00009  * Red Hat, Inc. not be used in advertising or publicity pertaining to
00010  * distribution of the software without specific, written prior
00011  * permission. Red Hat, Inc. makes no representations about the
00012  * suitability of this software for any purpose.  It is provided "as
00013  * is" without express or implied warranty.
00014  *
00015  * RED HAT, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
00016  * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
00017  * FITNESS, IN NO EVENT SHALL RED HAT, INC. BE LIABLE FOR ANY SPECIAL,
00018  * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
00019  * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
00020  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
00021  * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
00022  *
00023  * Author: Carl D. Worth <cworth@cworth.org>
00024  */
00025 
00026 /* Bug history
00027  *
00028  * 2004-10-25  Carl Worth  <cworth@cworth.org>
00029  *
00030  *   It looks like cairo_show_surface has no effect if it follows a
00031  *   call to cairo_move_to to any coordinate other than 0,0. A little
00032  *   bit of poking around suggests this isn't a regression, (at least
00033  *   not since the last pixman snapshot).
00034  *
00035  */
00036 
00037 
00038 #include "cairo_test.h"
00039 
00040 cairo_test_t test = {
00041     "move_to_show_surface",
00042     "Tests calls to cairo_show_surface after cairo_move_to",
00043     2, 2
00044 };
00045 
00046 static void
00047 draw (cairo_t *cr, int width, int height)
00048 {
00049     cairo_surface_t *surface;
00050     uint32_t colors[4] = {
00051        0xffffffff, 0xffff0000,
00052        0xff00ff00, 0xff0000ff
00053     };
00054     int i;
00055 
00056     for (i=0; i < 4; i++) {
00057        surface = cairo_surface_create_for_image ((char *) &colors[i],
00058                                             CAIRO_FORMAT_ARGB32, 1, 1, 4);
00059        cairo_move_to (cr, i % 2, i / 2);
00060        cairo_show_surface (cr, surface, 1, 1);
00061        cairo_surface_destroy (surface);
00062     }
00063 }
00064 
00065 int
00066 main (void)
00067 {
00068     return cairo_test (&test, draw);
00069 }