Merge "fix issue in negative line spacing with key arrow down" into devel/master
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / toolkit-native-image-source.cpp
1 /*
2  * Copyright (c) 2015 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/public-api/adaptor-framework/native-image-source.h>
20
21 // INTERNAL INCLUDES
22 #include "test-native-image-source.h"
23
24 // EXTERNAL INCLUDES
25 #include <dali/public-api/object/any.h>
26
27 namespace Dali
28 {
29
30 const char* NativeImageSourceTest::GetCustomFragmentPrefix()
31 {
32   return "#extension GL_OES_EGL_image_external:require\n";
33 }
34
35 NativeImageSourcePtr NativeImageSource::New( unsigned int width, unsigned int height, ColorDepth depth )
36 {
37   Any empty;
38   NativeImageSourcePtr image = new NativeImageSource( width, height, depth, empty );
39   return image;
40 }
41
42 Any NativeImageSource::GetNativeImageSource()
43 {
44   Any source;
45   return source;
46 }
47
48 NativeImageSourcePtr NativeImageSource::New( Any nativeImageSource )
49 {
50   NativeImageSourcePtr image = new NativeImageSource(0, 0, COLOR_DEPTH_DEFAULT, nativeImageSource);
51   return image;
52 }
53
54 bool NativeImageSource::GetPixels( std::vector<unsigned char> &pixbuf, unsigned int &width, unsigned int &height, Pixel::Format& pixelFormat ) const
55 {
56   return false;
57 }
58
59 bool NativeImageSource::EncodeToFile(const std::string& filename) const
60 {
61   return false;
62 }
63
64 void NativeImageSource::SetSource( Any source )
65 {
66 }
67
68 bool NativeImageSource::IsColorDepthSupported( ColorDepth colorDepth )
69 {
70   return false;
71 }
72
73 bool NativeImageSource::CreateResource()
74 {
75   return false;
76 }
77
78 void NativeImageSource::DestroyResource()
79 {
80 }
81
82 unsigned int NativeImageSource::TargetTexture()
83 {
84   return 0;
85 }
86
87 void NativeImageSource::PrepareTexture()
88 {
89 }
90
91 unsigned int NativeImageSource::GetWidth() const
92 {
93   return 0;
94 }
95
96 unsigned int NativeImageSource::GetHeight() const
97 {
98   return 0;
99 }
100
101 bool NativeImageSource::RequiresBlending() const
102 {
103   return false;
104 }
105
106 int NativeImageSource::GetTextureTarget() const
107 {
108   return 0;
109 }
110
111 bool NativeImageSource::ApplyNativeFragmentShader(std::string& shader)
112 {
113   shader = Dali::NativeImageSourceTest::GetCustomFragmentPrefix() + shader;
114   return true;
115 }
116
117 const char* NativeImageSource::GetCustomSamplerTypename() const
118 {
119   return "";
120 }
121
122 Any NativeImageSource::GetNativeImageHandle() const
123 {
124   return nullptr;
125 }
126
127 bool NativeImageSource::SourceChanged() const
128 {
129   return false;
130 }
131
132 NativeImageInterface::Extension* NativeImageSource::GetExtension()
133 {
134   return NULL;
135 }
136
137 NativeImageSource::NativeImageSource( unsigned int width, unsigned int height, ColorDepth depth, Any nativeImageSource )
138 {
139 }
140
141 NativeImageSource::~NativeImageSource()
142 {
143 }
144
145 } // namespace Dali