Revert "[Tizen] Add codes for Dali Windows Backend"
[platform/core/uifw/dali-core.git] / dali / internal / render / gl-resources / gl-call-debug.h
1 #ifndef __DALI_INTERNAL_GL_CALL_DEBUG_H__
2 #define __DALI_INTERNAL_GL_CALL_DEBUG_H__
3
4 /*
5  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali/integration-api/debug.h>
23
24 namespace Dali
25 {
26 namespace Integration
27 {
28 class GlAbstraction;
29 }
30
31 namespace Internal
32 {
33 /**
34  * Helper to check GL errors
35  * @param glAbstraction to use for error check
36  * @param operation to be logged
37  */
38 void CheckGlError( Integration::GlAbstraction& glAbstraction, const char* operation );
39
40 // wrap gl calls with CHECK_GL e.g. "CHECK_GL( mGlAbstraction, mGlAbstraction.UseProgram(mProgramId) );"
41 // will LOG any glErrors eg "glError (0x0501) GL_INVALID_VALUE - glBindTexture(textureId)"
42 // only enable if specifically enabled as it can slow down GL a lot!
43 #ifdef DALI_GL_ERROR_CHECK
44 #define CHECK_GL(c,a)  (a); CheckGlError(c,#a)
45 #else
46 #define CHECK_GL(c,a)  (a)
47 #endif
48
49 #ifdef DEBUG_ENABLED
50 /// Switch debug level to Concise to disable, General to enable. Note, enabling snapshot logging will do this on the fly.
51 extern Debug::Filter* gGlLogFilter;
52 #endif // DEBUG_ENABLED
53
54 // Don't put guards around here (LOG_INFO has it's own guards)
55 #define LOG_GL(format, args...) \
56   DALI_LOG_INFO(gGlLogFilter, Debug::General, format, ## args)
57
58 }
59
60 }
61
62 #endif // __DALI_INTERNAL_GL_CALL_DEBUG_H__
63