Subversion Repositories Kolibri OS

Rev

Rev 1892 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1892 Rev 3959
Line 32... Line 32...
32
 * Contributor(s):
32
 * Contributor(s):
33
 *	Carl D. Worth 
33
 *	Carl D. Worth 
34
 */
34
 */
Line 35... Line 35...
35
 
35
 
-
 
36
#include "cairoint.h"
Line 36... Line 37...
36
#include "cairoint.h"
37
#include "cairo-image-surface-private.h"
37
 
38
 
38
/**
39
/**
39
 * cairo_debug_reset_static_data:
40
 * cairo_debug_reset_static_data:
Line 53... Line 54...
53
 * WARNING: It is only safe to call this function when there are no
54
 * WARNING: It is only safe to call this function when there are no
54
 * active cairo objects remaining, (ie. the appropriate destroy
55
 * active cairo objects remaining, (ie. the appropriate destroy
55
 * functions have been called as necessary). If there are active cairo
56
 * functions have been called as necessary). If there are active cairo
56
 * objects, this call is likely to cause a crash, (eg. an assertion
57
 * objects, this call is likely to cause a crash, (eg. an assertion
57
 * failure due to a hash table being destroyed when non-empty).
58
 * failure due to a hash table being destroyed when non-empty).
-
 
59
 *
-
 
60
 * Since: 1.0
58
 **/
61
 **/
59
void
62
void
60
cairo_debug_reset_static_data (void)
63
cairo_debug_reset_static_data (void)
61
{
64
{
62
    CAIRO_MUTEX_INITIALIZE ();
65
    CAIRO_MUTEX_INITIALIZE ();
Line 67... Line 70...
67
 
70
 
68
#if CAIRO_HAS_FT_FONT
71
#if CAIRO_HAS_FT_FONT
69
    _cairo_ft_font_reset_static_data ();
72
    _cairo_ft_font_reset_static_data ();
Line -... Line 73...
-
 
73
#endif
-
 
74
 
-
 
75
#if CAIRO_HAS_WIN32_FONT
-
 
76
    _cairo_win32_font_reset_static_data ();
70
#endif
77
#endif
Line 71... Line 78...
71
 
78
 
Line 72... Line 79...
72
    _cairo_intern_string_reset_static_data ();
79
    _cairo_intern_string_reset_static_data ();
Line 81... Line 88...
81
 
88
 
82
#if CAIRO_HAS_DRM_SURFACE
89
#if CAIRO_HAS_DRM_SURFACE
83
    _cairo_drm_device_reset_static_data ();
90
    _cairo_drm_device_reset_static_data ();
Line -... Line 91...
-
 
91
#endif
-
 
92
 
-
 
93
    _cairo_default_context_reset_static_data ();
84
#endif
94
 
-
 
95
#if CAIRO_HAS_COGL_SURFACE
Line 85... Line 96...
85
 
96
    _cairo_cogl_context_reset_static_data ();
86
    _cairo_reset_static_data ();
97
#endif
Line 87... Line 98...
87
 
98
 
Line 112... Line 123...
112
	break;
123
	break;
113
    case CAIRO_FORMAT_RGB16_565:
124
    case CAIRO_FORMAT_RGB16_565:
114
	width = image->width*2;
125
	width = image->width*2;
115
	break;
126
	break;
116
    case CAIRO_FORMAT_RGB24:
127
    case CAIRO_FORMAT_RGB24:
-
 
128
    case CAIRO_FORMAT_RGB30:
117
    case CAIRO_FORMAT_ARGB32:
129
    case CAIRO_FORMAT_ARGB32:
118
	width = image->width*4;
130
	width = image->width*4;
119
	break;
131
	break;
120
    case CAIRO_FORMAT_INVALID:
132
    case CAIRO_FORMAT_INVALID:
121
    default:
133
    default:
Line 226... Line 238...
226
 
238
 
227
void
239
void
228
_cairo_debug_print_path (FILE *stream, cairo_path_fixed_t *path)
240
_cairo_debug_print_path (FILE *stream, cairo_path_fixed_t *path)
229
{
241
{
-
 
242
    cairo_status_t status;
Line -... Line 243...
-
 
243
    cairo_box_t box;
230
    cairo_status_t status;
244
 
231
 
245
    fprintf (stream,
232
    printf ("path: extents=(%f, %f), (%f, %f)\n",
246
	     "path: extents=(%f, %f), (%f, %f)\n",
233
	    _cairo_fixed_to_double (path->extents.p1.x),
247
	    _cairo_fixed_to_double (path->extents.p1.x),
234
	    _cairo_fixed_to_double (path->extents.p1.y),
248
	    _cairo_fixed_to_double (path->extents.p1.y),
Line 235... Line 249...
235
	    _cairo_fixed_to_double (path->extents.p2.x),
249
	    _cairo_fixed_to_double (path->extents.p2.x),
236
	    _cairo_fixed_to_double (path->extents.p2.y));
-
 
237
 
250
	    _cairo_fixed_to_double (path->extents.p2.y));
238
    status = _cairo_path_fixed_interpret (path,
251
 
239
					  CAIRO_DIRECTION_FORWARD,
252
    status = _cairo_path_fixed_interpret (path,
240
					  _print_move_to,
253
					  _print_move_to,
241
					  _print_line_to,
254
					  _print_line_to,
242
					  _print_curve_to,
255
					  _print_curve_to,
Line -... Line 256...
-
 
256
					  _print_close,
-
 
257
					  stream);
-
 
258
    assert (status == CAIRO_STATUS_SUCCESS);
-
 
259
 
-
 
260
    if (_cairo_path_fixed_is_box (path, &box)) {
243
					  _print_close,
261
	fprintf (stream, "[box (%d, %d), (%d, %d)]",
244
					  stream);
262
		 box.p1.x, box.p1.y, box.p2.x, box.p2.y);
-
 
263
    }
-
 
264
 
-
 
265
    printf ("\n");
-
 
266
}
-
 
267
 
-
 
268
void
-
 
269
_cairo_debug_print_polygon (FILE *stream, cairo_polygon_t *polygon)
-
 
270
{
-
 
271
    int n;
-
 
272
 
-
 
273
    fprintf (stream,
-
 
274
	     "polygon: extents=(%f, %f), (%f, %f)\n",
-
 
275
	    _cairo_fixed_to_double (polygon->extents.p1.x),
-
 
276
	    _cairo_fixed_to_double (polygon->extents.p1.y),
-
 
277
	    _cairo_fixed_to_double (polygon->extents.p2.x),
-
 
278
	    _cairo_fixed_to_double (polygon->extents.p2.y));
-
 
279
    if (polygon->num_limits) {
-
 
280
	fprintf (stream,
-
 
281
		 "       : limit=(%f, %f), (%f, %f) x %d\n",
-
 
282
		 _cairo_fixed_to_double (polygon->limit.p1.x),
-
 
283
		 _cairo_fixed_to_double (polygon->limit.p1.y),
-
 
284
		 _cairo_fixed_to_double (polygon->limit.p2.x),
-
 
285
		 _cairo_fixed_to_double (polygon->limit.p2.y),
-
 
286
		 polygon->num_limits);
-
 
287
    }
-
 
288
 
-
 
289
    for (n = 0; n < polygon->num_edges; n++) {
-
 
290
	cairo_edge_t *edge = &polygon->edges[n];
-
 
291
 
-
 
292
	fprintf (stream,
-
 
293
		 "  [%d] = [(%f, %f), (%f, %f)], top=%f, bottom=%f, dir=%d\n",
-
 
294
		 n,
-
 
295
		 _cairo_fixed_to_double (edge->line.p1.x),
-
 
296
		 _cairo_fixed_to_double (edge->line.p1.y),
-
 
297
		 _cairo_fixed_to_double (edge->line.p2.x),
-
 
298
		 _cairo_fixed_to_double (edge->line.p2.y),
-
 
299
		 _cairo_fixed_to_double (edge->top),
-
 
300
		 _cairo_fixed_to_double (edge->bottom),