--- /dev/null
+#ifndef TEST_NATIVE_IMAGE_SOURCE_H
+#define TEST_NATIVE_IMAGE_SOURCE_H
+
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+namespace Dali
+{
+namespace NativeImageSourceTest
+{
+
+const char* GetCustomFragmentPrefix();
+
+}
+} // namespace Dali
+
+#endif // TEST_NATIVE_IMAGE_SOURCE_H
mCallStack.PushCall("GetTextureTarget", "");
return GL_TEXTURE_EXTERNAL_OES;
};
- inline virtual const char* GetCustomFragmentPrefix() const
- {
- mCallStack.PushCall("GetCustomFragmentPrefix", "");
- return "#extension GL_OES_EGL_image_external:require\n";
- };
inline virtual bool ApplyNativeFragmentShader(std::string& shader)
{
mCallStack.PushCall("ApplyNativeFragmentShader", "");
// CLASS HEADER
#include <dali/public-api/adaptor-framework/native-image-source.h>
+// INTERNAL INCLUDES
+#include "test-native-image-source.h"
+
// EXTERNAL INCLUDES
#include <dali/public-api/object/any.h>
namespace Dali
{
+const char* NativeImageSourceTest::GetCustomFragmentPrefix()
+{
+ return "#extension GL_OES_EGL_image_external:require\n";
+}
+
NativeImageSourcePtr NativeImageSource::New( unsigned int width, unsigned int height, ColorDepth depth )
{
Any empty;
return 0;
}
-const char* NativeImageSource::GetCustomFragmentPrefix() const
-{
- return "";
-}
-
bool NativeImageSource::ApplyNativeFragmentShader(std::string& shader)
{
+ shader = Dali::NativeImageSourceTest::GetCustomFragmentPrefix() + shader;
return true;
}
#include <test-encoded-image-buffer.h>
#include "dummy-control.h"
+#include "test-native-image-source.h"
using namespace Dali;
using namespace Dali::Toolkit;
const Property::Map* outMap = value.GetMap();
std::string fragmentShader = (*outMap)["fragment"].Get<std::string>();
- const char* fragmentPrefix = nativeImageSource->GetCustomFragmentPrefix();
+ const char* fragmentPrefix = Dali::NativeImageSourceTest::GetCustomFragmentPrefix();
size_t pos = fragmentShader.find(fragmentPrefix);
DALI_TEST_EQUALS( pos != std::string::npos, true, TEST_LOCATION );