blob: f929e6a1dad4c0cafbc4351559cbc604b405d399 [file] [log] [blame]
Mathias Agopian35b48d12010-09-13 22:57:58 -07001/*
2 * Copyright (C) 2010 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef _UI_GRAPHIC_LOG_H
18#define _UI_GRAPHIC_LOG_H
19
20#include <utils/Singleton.h>
21#include <cutils/compiler.h>
22
23namespace android {
24
25class GraphicLog : public Singleton<GraphicLog>
26{
27 int32_t mEnabled;
28 static void logImpl(int32_t tag, int32_t buffer);
29 static void logImpl(int32_t tag, int32_t identity, int32_t buffer);
30
31public:
32 enum {
33 SF_APP_DEQUEUE_BEFORE = 60000,
34 SF_APP_DEQUEUE_AFTER = 60001,
35 SF_APP_LOCK_BEFORE = 60002,
36 SF_APP_LOCK_AFTER = 60003,
37 SF_APP_QUEUE = 60004,
38
39 SF_REPAINT = 60005,
40 SF_COMPOSITION_COMPLETE = 60006,
41 SF_UNLOCK_CLIENTS = 60007,
42 SF_SWAP_BUFFERS = 60008,
43 SF_REPAINT_DONE = 60009,
44
45 SF_FB_POST_BEFORE = 60010,
46 SF_FB_POST_AFTER = 60011,
47 SF_FB_DEQUEUE_BEFORE = 60012,
48 SF_FB_DEQUEUE_AFTER = 60013,
49 SF_FB_LOCK_BEFORE = 60014,
50 SF_FB_LOCK_AFTER = 60015,
51 };
52
53 inline void log(int32_t tag, int32_t buffer) {
54 if (CC_UNLIKELY(mEnabled))
55 logImpl(tag, buffer);
56 }
57 inline void log(int32_t tag, int32_t identity, int32_t buffer) {
58 if (CC_UNLIKELY(mEnabled))
59 logImpl(tag, identity, buffer);
60 }
61
62 GraphicLog();
63
64 void setEnabled(bool enable);
65};
66
67}
68
69#endif // _UI_GRAPHIC_LOG_H
70