Merge "Add lock for image loading" into devel/master
[platform/core/uifw/dali-adaptor.git] / dali / internal / graphics / gles / egl-debug.cpp
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
18 // CLASS HEADER
19 #include <dali/internal/graphics/gles/egl-debug.h>
20
21 // EXTERNAL INCLUDES
22 #include <dali/integration-api/debug.h>
23
24 namespace Dali
25 {
26 namespace Internal
27 {
28 namespace Adaptor
29 {
30 namespace Egl
31 {
32 void PrintError(EGLint error)
33 {
34   switch(error)
35   {
36     case EGL_BAD_DISPLAY:
37     {
38       DALI_LOG_ERROR("EGL_BAD_DISPLAY : Display is not an EGL display connection\n");
39       break;
40     }
41     case EGL_NOT_INITIALIZED:
42     {
43       DALI_LOG_ERROR("EGL_NOT_INITIALIZED : Display has not been initialized\n");
44       break;
45     }
46     case EGL_BAD_SURFACE:
47     {
48       DALI_LOG_ERROR("EGL_BAD_SURFACE : Draw or read is not an EGL surface\n");
49       break;
50     }
51     case EGL_BAD_CONTEXT:
52     {
53       DALI_LOG_ERROR("EGL_BAD_CONTEXT : Context is not an EGL rendering context\n");
54       break;
55     }
56     case EGL_BAD_MATCH:
57     {
58       DALI_LOG_ERROR("EGL_BAD_MATCH : Draw or read are not compatible with context, or if context is set to EGL_NO_CONTEXT and draw or read are not set to EGL_NO_SURFACE, or if draw or read are set to EGL_NO_SURFACE and context is not set to EGL_NO_CONTEXT\n");
59       break;
60     }
61     case EGL_BAD_ACCESS:
62     {
63       DALI_LOG_ERROR("EGL_BAD_ACCESS : Context is current to some other thread\n");
64       break;
65     }
66     case EGL_BAD_NATIVE_PIXMAP:
67     {
68       DALI_LOG_ERROR("EGL_BAD_NATIVE_PIXMAP : A native pixmap underlying either draw or read is no longer valid\n");
69       break;
70     }
71     case EGL_BAD_NATIVE_WINDOW:
72     {
73       DALI_LOG_ERROR("EGL_BAD_NATIVE_WINDOW : A native window underlying either draw or read is no longer valid\n");
74       break;
75     }
76     case EGL_BAD_CURRENT_SURFACE:
77     {
78       DALI_LOG_ERROR("EGL_BAD_CURRENT_SURFACE : The previous context has unflushed commands and the previous surface is no longer valid\n");
79       break;
80     }
81     case EGL_BAD_ALLOC:
82     {
83       DALI_LOG_ERROR("EGL_BAD_ALLOC : Allocation of ancillary buffers for draw or read were delayed until eglMakeCurrent is called, and there are not enough resources to allocate them\n");
84       break;
85     }
86     case EGL_CONTEXT_LOST:
87     {
88       DALI_LOG_ERROR("EGL_CONTEXT_LOST : If a power management event has occurred. The application must destroy all contexts and reinitialise OpenGL ES state and objects to continue rendering\n");
89       break;
90     }
91     default:
92     {
93       DALI_LOG_ERROR("Unknown error with code: %d\n", error);
94       break;
95     }
96   }
97 }
98
99 } // namespace Egl
100
101 } // namespace Adaptor
102
103 } // namespace Internal
104
105 } // namespace Dali