"Initial commit to Gerrit"
[profile/ivi/cogl.git] / cogl / cogl-profile.h
1 /*
2  * Cogl
3  *
4  * An object oriented GL/GLES Abstraction/Utility Layer
5  *
6  * Copyright (C) 2007,2008,2009 Intel Corporation.
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
20  *
21  *
22  */
23
24 #ifndef __COGL_PROFILE_H__
25 #define __COGL_PROFILE_H__
26
27
28 #ifdef COGL_ENABLE_PROFILE
29
30 #include <uprof.h>
31
32 extern UProfContext *_cogl_uprof_context;
33
34 #define COGL_STATIC_TIMER    UPROF_STATIC_TIMER
35 #define COGL_STATIC_COUNTER  UPROF_STATIC_COUNTER
36 #define COGL_COUNTER_INC     UPROF_COUNTER_INC
37 #define COGL_COUNTER_DEC     UPROF_COUNTER_DEC
38 #define COGL_TIMER_START     UPROF_TIMER_START
39 #define COGL_TIMER_STOP      UPROF_TIMER_STOP
40
41 void
42 _cogl_uprof_init (void);
43
44 void
45 _cogl_profile_trace_message (const char *format, ...);
46
47 #else
48
49 #define COGL_STATIC_TIMER(A,B,C,D,E) extern void _cogl_dummy_decl (void)
50 #define COGL_STATIC_COUNTER(A,B,C,D) extern void _cogl_dummy_decl (void)
51 #define COGL_COUNTER_INC(A,B) G_STMT_START{ (void)0; }G_STMT_END
52 #define COGL_COUNTER_DEC(A,B) G_STMT_START{ (void)0; }G_STMT_END
53 #define COGL_TIMER_START(A,B) G_STMT_START{ (void)0; }G_STMT_END
54 #define COGL_TIMER_STOP(A,B) G_STMT_START{ (void)0; }G_STMT_END
55
56 #define _cogl_profile_trace_message g_message
57
58 #endif
59
60 #endif /* __COGL_PROFILE_H__ */
61