Merge "Make another ConditionalWait for post-rendearing" into devel/master
[platform/core/uifw/dali-adaptor.git] / dali / internal / legacy / tizen / platform-capabilities.h
1 #ifndef DALI_TIZEN_PLATFORM_CAPABILITIES_H
2 #define DALI_TIZEN_PLATFORM_CAPABILITIES_H
3
4 /*
5  * Copyright (c) 2021 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 #include <dali/public-api/math/math-utils.h>
22
23 namespace Dali
24 {
25 namespace TizenPlatform
26 {
27 /**
28  * Returns true if non power of two textures are supported.
29  */
30 inline bool SupportsNonPowerOfTwoTextures()
31 {
32 #ifdef NON_POWER_OF_TWO_TEXTURES
33   return true; // All current devices and desktop builds have NPOT
34 #else
35 #error "NPOT are standard in GLES 2.0 if mipmaps are not used, they are standard with mipmaps and no restrictions in GLES 3.0, requiring them simplifies image handling code."
36   return false;
37 #endif
38 }
39
40 /**
41  * Returns the size that a textures dimension should have for a specific image size.
42  */
43 inline unsigned int GetTextureDimension(unsigned int size)
44 {
45 #ifdef NON_POWER_OF_TWO_TEXTURES
46   return size;
47 #else
48 #error "NPOT are standard in GLES 2.0 if mipmaps are not used, they are standard with mipmaps and no restrictions in GLES 3.0, requiring them simplifies image handling code."
49   return NextPowerOfTwo(size);
50 #endif
51 }
52
53 } // namespace TizenPlatform
54
55 } // namespace Dali
56
57 #endif // DALI_TIZEN_PLATFORM_CAPABILITIES_H