Remove unused custom shader prefix method 82/262882/3
authorseungho <sbsh.baek@samsung.com>
Mon, 23 Aug 2021 05:15:42 +0000 (14:15 +0900)
committerseungho <sbsh.baek@samsung.com>
Tue, 24 Aug 2021 00:44:06 +0000 (09:44 +0900)
Change-Id: Icbcd2f33938db5256a3993f6d5854c20c2307675
Signed-off-by: seungho <sbsh.baek@samsung.com>
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-native-image-source.h [new file with mode: 0644]
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-native-image.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-native-image-source.cpp
automated-tests/src/dali-toolkit/utc-Dali-ImageVisual.cpp

diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-native-image-source.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-native-image-source.h
new file mode 100644 (file)
index 0000000..c459e07
--- /dev/null
@@ -0,0 +1,31 @@
+#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
index fb9451c..bd1bfcc 100644 (file)
@@ -78,11 +78,6 @@ public:
     mCallStack.PushCall("GetTextureTarget", "");
     return GL_TEXTURE_EXTERNAL_OES;
   };
     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", "");
   inline virtual bool ApplyNativeFragmentShader(std::string& shader)
   {
     mCallStack.PushCall("ApplyNativeFragmentShader", "");
index 29ea5d5..d2be2d7 100755 (executable)
 // CLASS HEADER
 #include <dali/public-api/adaptor-framework/native-image-source.h>
 
 // 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
 {
 
 // 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;
 NativeImageSourcePtr NativeImageSource::New( unsigned int width, unsigned int height, ColorDepth depth )
 {
   Any empty;
@@ -100,13 +108,9 @@ int NativeImageSource::GetTextureTarget() const
   return 0;
 }
 
   return 0;
 }
 
-const char* NativeImageSource::GetCustomFragmentPrefix() const
-{
-  return "";
-}
-
 bool NativeImageSource::ApplyNativeFragmentShader(std::string& shader)
 {
 bool NativeImageSource::ApplyNativeFragmentShader(std::string& shader)
 {
+  shader = Dali::NativeImageSourceTest::GetCustomFragmentPrefix() + shader;
   return true;
 }
 
   return true;
 }
 
index 1dbb737..cd834df 100644 (file)
@@ -31,6 +31,7 @@
 
 #include <test-encoded-image-buffer.h>
 #include "dummy-control.h"
 
 #include <test-encoded-image-buffer.h>
 #include "dummy-control.h"
+#include "test-native-image-source.h"
 
 using namespace Dali;
 using namespace Dali::Toolkit;
 
 using namespace Dali;
 using namespace Dali::Toolkit;
@@ -459,7 +460,7 @@ int UtcDaliImageVisualWithNativeImage(void)
   const Property::Map* outMap = value.GetMap();
   std::string fragmentShader = (*outMap)["fragment"].Get<std::string>();
 
   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 );
   size_t pos = fragmentShader.find(fragmentPrefix);
 
   DALI_TEST_EQUALS( pos != std::string::npos, true, TEST_LOCATION );