From: Adeel Kazmi Date: Wed, 27 Jan 2021 00:20:07 +0000 (+0000) Subject: ImageViewURL & Styling Examples Launch Fix on GLES 3.2 Devices X-Git-Tag: dali_2.0.11~2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-demo.git;a=commitdiff_plain;h=e2b3f0cd8c98aebdbb4b5b324b52860607588591 ImageViewURL & Styling Examples Launch Fix on GLES 3.2 Devices - Need to use the defines instead and need to change the shader accordingly Change-Id: I6cce0c4b88e287d250c3d9369ad1deada45fafd5 --- diff --git a/examples/image-view-url/image-view-url-example.cpp b/examples/image-view-url/image-view-url-example.cpp index c721d7e..7f2b4dd 100644 --- a/examples/image-view-url/image-view-url-example.cpp +++ b/examples/image-view-url/image-view-url-example.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * 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. @@ -104,7 +104,7 @@ private: mActorForInput.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); mActorForInput.SetProperty(Actor::Property::SIZE, TARGET_SIZE); Property::Map customShader; - customShader[Toolkit::Visual::Shader::Property::FRAGMENT_SHADER] = SHADER_IMAGE_VIEW_URL_FRAG.data(); + customShader[Toolkit::Visual::Shader::Property::FRAGMENT_SHADER] = Dali::Shader::GetFragmentShaderPrefix() + SHADER_IMAGE_VIEW_URL_FRAG.data(); Property::Map visualMap; visualMap.Insert(Toolkit::Visual::Property::SHADER, customShader); mActorForInput.SetProperty(Toolkit::ImageView::Property::IMAGE, visualMap); diff --git a/examples/image-view-url/shaders/image-view-url.frag b/examples/image-view-url/shaders/image-view-url.frag index 4b07ce4..27bbc18 100644 --- a/examples/image-view-url/shaders/image-view-url.frag +++ b/examples/image-view-url/shaders/image-view-url.frag @@ -1,5 +1,5 @@ precision highp float; -varying mediump vec2 vTexCoord; +INPUT mediump vec2 vTexCoord; uniform sampler2D sTexture; uniform mediump float uDelta; @@ -9,6 +9,6 @@ void main() vec2 texCoord = vTexCoord * 2. - 1.; mat2 rotation = mat2(cos(uDelta), -sin(uDelta), sin(uDelta), cos(uDelta)); texCoord = (rotation * texCoord) * .5 + .5; - color += texture2D( sTexture, texCoord ); - gl_FragColor = color; -} \ No newline at end of file + color += TEXTURE( sTexture, texCoord ); + OUT_COLOR = color; +} diff --git a/examples/styling/image-channel-control-impl.cpp b/examples/styling/image-channel-control-impl.cpp index 4a7ef6d..cba48d1 100644 --- a/examples/styling/image-channel-control-impl.cpp +++ b/examples/styling/image-channel-control-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * 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. @@ -82,7 +82,7 @@ void ImageChannelControl::SetImage(const std::string& url) Property::Map properties; Property::Map shader; - shader[Dali::Toolkit::Visual::Shader::Property::FRAGMENT_SHADER] = SHADER_IMAGE_CHANNEL_CONTROL_FRAG.data(); + shader[Dali::Toolkit::Visual::Shader::Property::FRAGMENT_SHADER] = Dali::Shader::GetFragmentShaderPrefix() + SHADER_IMAGE_CHANNEL_CONTROL_FRAG.data(); properties[Dali::Toolkit::Visual::Property::TYPE] = Dali::Toolkit::Visual::IMAGE; properties[Dali::Toolkit::Visual::Property::SHADER] = shader; properties[Dali::Toolkit::ImageVisual::Property::URL] = url; diff --git a/examples/styling/shaders/image-channel-control.frag b/examples/styling/shaders/image-channel-control.frag index 4a8b905..365221b 100644 --- a/examples/styling/shaders/image-channel-control.frag +++ b/examples/styling/shaders/image-channel-control.frag @@ -1,4 +1,4 @@ -varying mediump vec2 vTexCoord; +INPUT mediump vec2 vTexCoord; uniform sampler2D sTexture; uniform mediump vec4 uColor; uniform mediump vec3 mixColor; @@ -6,5 +6,5 @@ uniform mediump vec3 uChannels; void main() { - gl_FragColor = texture2D( sTexture, vTexCoord ) * vec4(mixColor,1.0) * uColor * vec4(uChannels, 1.0) ; + OUT_COLOR = TEXTURE( sTexture, vTexCoord ) * vec4(mixColor,1.0) * uColor * vec4(uChannels, 1.0) ; }