1 /* cairo - a vector graphics library with display and print output
3 * Copyright © 2011 Intel Corporation
5 * This library is free software; you can redistribute it and/or
6 * modify it either under the terms of the GNU Lesser General Public
7 * License version 2.1 as published by the Free Software Foundation
8 * (the "LGPL") or, at your option, under the terms of the Mozilla
9 * Public License Version 1.1 (the "MPL"). If you do not alter this
10 * notice, a recipient may use your version of this file under either
11 * the MPL or the LGPL.
13 * You should have received a copy of the LGPL along with this library
14 * in the file COPYING-LGPL-2.1; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA
16 * You should have received a copy of the MPL along with this library
17 * in the file COPYING-MPL-1.1
19 * The contents of this file are subject to the Mozilla Public License
20 * Version 1.1 (the "License"); you may not use this file except in
21 * compliance with the License. You may obtain a copy of the License at
22 * http://www.mozilla.org/MPL/
24 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
25 * OF ANY KIND, either express or implied. See the LGPL or the MPL for
26 * the specific language governing rights and limitations.
28 * The Original Code is the cairo graphics library.
30 * The Initial Developer of the Original Code is Intel Corporation.
33 * Chris Wilson <chris@chris-wilson.co.uk>
36 #ifndef CAIRO_SURFACE_OBSERVER_PRIVATE_H
37 #define CAIRO_SURFACE_OBSERVER_PRIVATE_H
41 #include "cairo-device-private.h"
42 #include "cairo-list-private.h"
43 #include "cairo-recording-surface-private.h"
44 #include "cairo-surface-private.h"
45 #include "cairo-surface-backend-private.h"
46 #include "cairo-time-private.h"
49 double min
, max
, sum
, sum_sq
;
53 #define NUM_OPERATORS (CAIRO_OPERATOR_HSL_LUMINOSITY+1)
54 #define NUM_CAPS (CAIRO_LINE_CAP_SQUARE+1)
55 #define NUM_JOINS (CAIRO_LINE_JOIN_BEVEL+1)
56 #define NUM_ANTIALIAS (CAIRO_ANTIALIAS_BEST+1)
57 #define NUM_FILL_RULE (CAIRO_FILL_RULE_EVEN_ODD+1)
61 unsigned int bounded
, unbounded
;
65 unsigned int type
[8]; /* native/record/other surface/gradients */
69 unsigned int type
[5]; /* empty/pixel/rectilinear/straight/curved */
73 unsigned int type
[6]; /* none, region, boxes, single path, polygon, general */
76 typedef struct _cairo_observation cairo_observation_t
;
77 typedef struct _cairo_observation_record cairo_observation_record_t
;
78 typedef struct _cairo_device_observer cairo_device_observer_t
;
80 struct _cairo_observation_record
{
81 cairo_content_t target_content
;
98 struct _cairo_observation
{
101 int num_sources_acquired
;
103 /* XXX put interesting stats here! */
106 cairo_time_t elapsed
;
108 struct extents extents
;
109 unsigned int operators
[NUM_OPERATORS
];
110 struct pattern source
;
114 cairo_observation_record_t slowest
;
118 cairo_time_t elapsed
;
120 struct extents extents
;
121 unsigned int operators
[NUM_OPERATORS
];
122 struct pattern source
;
127 cairo_observation_record_t slowest
;
131 cairo_time_t elapsed
;
133 struct extents extents
;
134 unsigned int operators
[NUM_OPERATORS
];
135 struct pattern source
;
137 unsigned int antialias
[NUM_ANTIALIAS
];
138 unsigned int fill_rule
[NUM_FILL_RULE
];
142 cairo_observation_record_t slowest
;
146 cairo_time_t elapsed
;
148 struct extents extents
;
149 unsigned int operators
[NUM_OPERATORS
];
150 unsigned int caps
[NUM_CAPS
];
151 unsigned int joins
[NUM_CAPS
];
152 unsigned int antialias
[NUM_ANTIALIAS
];
153 struct pattern source
;
155 struct stat line_width
;
159 cairo_observation_record_t slowest
;
163 cairo_time_t elapsed
;
165 struct extents extents
;
166 unsigned int operators
[NUM_OPERATORS
];
167 struct pattern source
;
171 cairo_observation_record_t slowest
;
174 cairo_array_t timings
;
175 cairo_recording_surface_t
*record
;
178 struct _cairo_device_observer
{
180 cairo_device_t
*target
;
182 cairo_observation_t log
;
185 struct callback_list
{
188 cairo_surface_observer_callback_t func
;
192 struct _cairo_surface_observer
{
193 cairo_surface_t base
;
194 cairo_surface_t
*target
;
196 cairo_observation_t log
;
198 cairo_list_t paint_callbacks
;
199 cairo_list_t mask_callbacks
;
200 cairo_list_t fill_callbacks
;
201 cairo_list_t stroke_callbacks
;
202 cairo_list_t glyphs_callbacks
;
204 cairo_list_t flush_callbacks
;
205 cairo_list_t finish_callbacks
;
208 #endif /* CAIRO_SURFACE_OBSERVER_PRIVATE_H */