2 * Copyright © 2012 SCore Corporation
4 * This library is free software; you can redistribute it and/or
5 * modify it either under the terms of the GNU Lesser General Public
6 * License version 2.1 as published by the Free Software Foundation
7 * (the "LGPL") or, at your option, under the terms of the Mozilla
8 * Public License Version 1.1 (the "MPL"). If you do not alter this
9 * notice, a recipient may use your version of this file under either
10 * the MPL or the LGPL.
12 * You should have received a copy of the LGPL along with this library
13 * in the file COPYING-LGPL-2.1; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA
15 * You should have received a copy of the MPL along with this library
16 * in the file COPYING-MPL-1.1
18 * The contents of this file are subject to the Mozilla Public License
19 * Version 1.1 (the "License"); you may not use this file except in
20 * compliance with the License. You may obtain a copy of the License at
21 * http://www.mozilla.org/MPL/
23 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
24 * OF ANY KIND, either express or implied. See the LGPL or the MPL for
25 * the specific language governing rights and limitations.
27 * Author: Taekyun Kim (podain77@gmail.com)
30 #include "cairo-boilerplate-private.h"
35 static cairo_surface_t *
36 _cairo_boilerplate_tg_create_surface (const char *name,
37 cairo_content_t content,
42 cairo_boilerplate_mode_t mode,
45 cairo_format_t format;
47 if (content == CAIRO_CONTENT_COLOR_ALPHA)
49 format = CAIRO_FORMAT_ARGB32;
51 else if (content == CAIRO_CONTENT_COLOR)
53 format = CAIRO_FORMAT_RGB24;
63 return cairo_tg_surface_create (format, ceil (width), ceil (height));
66 static const cairo_boilerplate_target_t targets[] =
69 "tg", "tg", NULL, NULL,
70 CAIRO_SURFACE_TYPE_TG, CAIRO_CONTENT_COLOR_ALPHA, 0,
72 _cairo_boilerplate_tg_create_surface,
73 cairo_surface_create_similar,
75 _cairo_boilerplate_get_image_surface,
76 cairo_surface_write_to_png,
81 CAIRO_BOILERPLATE (tg, targets)