2 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 #include <dali/public-api/adaptor-framework/native-image-source.h>
22 #include "test-native-image-source.h"
25 #include <dali/public-api/object/any.h>
30 const char* NativeImageSourceTest::GetCustomFragmentPrefix()
32 return "#extension GL_OES_EGL_image_external:require\n";
35 NativeImageSourcePtr NativeImageSource::New( unsigned int width, unsigned int height, ColorDepth depth )
38 NativeImageSourcePtr image = new NativeImageSource( width, height, depth, empty );
42 Any NativeImageSource::GetNativeImageSource()
48 NativeImageSourcePtr NativeImageSource::New( Any nativeImageSource )
50 NativeImageSourcePtr image = new NativeImageSource(0, 0, COLOR_DEPTH_DEFAULT, nativeImageSource);
54 bool NativeImageSource::GetPixels( std::vector<unsigned char> &pixbuf, unsigned int &width, unsigned int &height, Pixel::Format& pixelFormat ) const
59 bool NativeImageSource::EncodeToFile(const std::string& filename) const
64 void NativeImageSource::SetSource( Any source )
68 bool NativeImageSource::IsColorDepthSupported( ColorDepth colorDepth )
73 bool NativeImageSource::CreateResource()
78 void NativeImageSource::DestroyResource()
82 unsigned int NativeImageSource::TargetTexture()
87 void NativeImageSource::PrepareTexture()
91 unsigned int NativeImageSource::GetWidth() const
96 unsigned int NativeImageSource::GetHeight() const
101 bool NativeImageSource::RequiresBlending() const
106 int NativeImageSource::GetTextureTarget() const
111 bool NativeImageSource::ApplyNativeFragmentShader(std::string& shader)
113 shader = Dali::NativeImageSourceTest::GetCustomFragmentPrefix() + shader;
117 const char* NativeImageSource::GetCustomSamplerTypename() const
122 Any NativeImageSource::GetNativeImageHandle() const
127 bool NativeImageSource::SourceChanged() const
132 NativeImageInterface::Extension* NativeImageSource::GetExtension()
137 NativeImageSource::NativeImageSource( unsigned int width, unsigned int height, ColorDepth depth, Any nativeImageSource )
141 NativeImageSource::~NativeImageSource()