1d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines/*
2d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines * Copyright (C) 2013 The Android Open Source Project
3d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines *
4d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines * Licensed under the Apache License, Version 2.0 (the "License");
5d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines * you may not use this file except in compliance with the License.
6d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines * You may obtain a copy of the License at
7d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines *
8d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines *      http://www.apache.org/licenses/LICENSE-2.0
9d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines *
10d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines * Unless required by applicable law or agreed to in writing, software
11d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines * distributed under the License is distributed on an "AS IS" BASIS,
12d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines * See the License for the specific language governing permissions and
14d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines * limitations under the License.
15d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines */
16d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines
17d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines#ifndef ANDROID_RS_DEBUG_HELPER_H
18d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines#define ANDROID_RS_DEBUG_HELPER_H
19d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines
20d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines#include "rsUtils.h"
2166f0a168c4227d4e302f4ffb21ec7e9d7b9ca828Jason Sams#include "rsInternalDefines.h"
22d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines
2359f6142d7657e43b4d21e077a28387431db02edfMiao Wang#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
24d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines#include <utils/CallStack.h>
25d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines#endif
26d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines
27d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hinesnamespace android {
28d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hinesnamespace renderscript {
29d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines
30d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines
31d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hinesclass DebugHelper {
32d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hinespublic:
33d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines    DebugHelper() {
3459f6142d7657e43b4d21e077a28387431db02edfMiao Wang#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
35d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines        mStack.update(2);
3684bf95dece5bdac4a56b6f40c160e85cc7bb9732Jason Sams#endif
37d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines    }
38d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines
39d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines    void dump() {
4059f6142d7657e43b4d21e077a28387431db02edfMiao Wang#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
4182e135c4bbe18855d8ed02632bb074f8da0b96e0Miao Wang        ALOGV("%s", mStack.toString().string());
4284bf95dece5bdac4a56b6f40c160e85cc7bb9732Jason Sams        //mStack.dump();
4384bf95dece5bdac4a56b6f40c160e85cc7bb9732Jason Sams#endif
44d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines    }
45d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines
46d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hinesprivate:
4759f6142d7657e43b4d21e077a28387431db02edfMiao Wang#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
48d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines    CallStack mStack;
4984bf95dece5bdac4a56b6f40c160e85cc7bb9732Jason Sams#endif
50d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines};
51d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines
52d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines
53d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines}  // namespace renderscript
54d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines}  // namespace android
55d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines
56d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines#endif //ANDROID_RS_DEBUG_HELPER_H
57d216dafa216f3329577ab624cdc5a5d1860ec035Stephen Hines
58