Updated shader source to set precision explicitly
[platform/core/uifw/dali-toolkit.git] / optional / dali-toolkit / public-api / shader-effects / page-turn-book-spine-effect.cpp
index 9ea742c..eae9ac7 100644 (file)
@@ -1,21 +1,26 @@
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.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://floralicense.org/license/
-//
-// 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.
-//
-
+/*
+ * Copyright (c) 2014 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.
+ *
+ */
+
+// CLASS HEADER
 #include <dali-toolkit/public-api/shader-effects/page-turn-book-spine-effect.h>
 
+// EXTERNAL INCLUDES
+#include <dali/public-api/common/stage.h>
+
 namespace Dali
 {
 
@@ -55,6 +60,7 @@ PageTurnBookSpineEffect::~PageTurnBookSpineEffect()
 PageTurnBookSpineEffect PageTurnBookSpineEffect::New()
 {
   std::string vertexSource(
+  "precision mediump float;\n"
   "uniform float uShadowWidth;\n"
   "  void main()\n"
   "  {\n"
@@ -65,6 +71,7 @@ PageTurnBookSpineEffect PageTurnBookSpineEffect::New()
 
   // the simplified version of the fragment shader of page turn effect
   std::string fragmentSource(
+  "precision mediump float;\n"
   "uniform float uIsBackImageVisible;\n"
   "uniform float uPageWidth;\n"
   "uniform vec2 uSpineShadowParameter;\n"
@@ -94,7 +101,7 @@ PageTurnBookSpineEffect PageTurnBookSpineEffect::New()
   "  }" );
 
   ShaderEffect shader;
-  shader = ShaderEffect::New( vertexSource,fragmentSource );
+  shader = ShaderEffect::New( vertexSource, fragmentSource );
   PageTurnBookSpineEffect handle( shader );
   handle.SetUniform( IS_BACK_IMAGE_VISIBLE_PROPERTY_NAME, -1.f );
   handle.SetUniform( SHADOW_WIDTH_PROPERTY_NAME, DEFAULT_SHADOW_WIDTH );