From b4af8951ab73bc16288cc61e208edb2d2ec217ba Mon Sep 17 00:00:00 2001 From: seungho Date: Mon, 23 Aug 2021 14:15:42 +0900 Subject: [PATCH] Remove unused custom shader prefix method Change-Id: Icbcd2f33938db5256a3993f6d5854c20c2307675 Signed-off-by: seungho --- .../test-native-image-source.h | 31 ++++++++++++++++++++++ .../dali-toolkit-test-utils/test-native-image.h | 5 ---- .../toolkit-native-image-source.cpp | 14 ++++++---- .../src/dali-toolkit/utc-Dali-ImageVisual.cpp | 3 ++- 4 files changed, 42 insertions(+), 11 deletions(-) create mode 100644 automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-native-image-source.h 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 index 0000000..c459e07 --- /dev/null +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-native-image-source.h @@ -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 diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-native-image.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-native-image.h index fb9451c..bd1bfcc 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-native-image.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-native-image.h @@ -78,11 +78,6 @@ public: 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", ""); diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-native-image-source.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-native-image-source.cpp index 29ea5d5..d2be2d7 100755 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-native-image-source.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-native-image-source.cpp @@ -18,12 +18,20 @@ // CLASS HEADER #include +// INTERNAL INCLUDES +#include "test-native-image-source.h" + // EXTERNAL INCLUDES #include 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; @@ -100,13 +108,9 @@ int NativeImageSource::GetTextureTarget() const return 0; } -const char* NativeImageSource::GetCustomFragmentPrefix() const -{ - return ""; -} - bool NativeImageSource::ApplyNativeFragmentShader(std::string& shader) { + shader = Dali::NativeImageSourceTest::GetCustomFragmentPrefix() + shader; return true; } diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ImageVisual.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ImageVisual.cpp index 1dbb737..cd834df 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ImageVisual.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ImageVisual.cpp @@ -31,6 +31,7 @@ #include #include "dummy-control.h" +#include "test-native-image-source.h" 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(); - 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 ); -- 2.7.4