Remove useless uniform register 36/289436/2
authorEunki, Hong <eunkiki.hong@samsung.com>
Tue, 7 Mar 2023 17:17:32 +0000 (02:17 +0900)
committerEunki Hong <eunkiki.hong@samsung.com>
Tue, 7 Mar 2023 17:45:50 +0000 (17:45 +0000)
Current image visual didn't use uPixelAlign. We can remove this property.

Change-Id: Ie61e299e77c8ff1ccce8edcea7575640dd863e91
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
dali-toolkit/internal/visuals/image/image-visual.cpp
dali-toolkit/internal/visuals/visual-string-constants.cpp
dali-toolkit/internal/visuals/visual-string-constants.h

index 0669ed5..d5bc010 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -97,9 +97,6 @@ DALI_ENUM_TO_STRING_TABLE_END(RELEASE_POLICY)
 
 const Vector4 FULL_TEXTURE_RECT(0.f, 0.f, 1.f, 1.f);
 
-const float PIXEL_ALIGN_ON  = 1.0f;
-const float PIXEL_ALIGN_OFF = 0.0f;
-
 constexpr uint32_t TEXTURE_COUNT_FOR_GPU_ALPHA_MASK = 2u;
 
 Geometry CreateGeometry(VisualFactoryCache& factoryCache, ImageDimensions gridSize)
@@ -736,13 +733,6 @@ void ImageVisual::DoSetOnScene(Actor& actor)
   }
 
   mPlacementActor = actor;
-  // Search the Actor tree to find if Layer UI behaviour set.
-  Layer layer = actor.GetLayer();
-  if(layer && layer.GetProperty<Layer::Behavior>(Layer::Property::BEHAVIOR) == Layer::LAYER_3D)
-  {
-    // Layer 3D set, do not align pixels
-    mImpl->mRenderer.RegisterProperty(PIXEL_ALIGNED_UNIFORM_NAME, PIXEL_ALIGN_OFF);
-  }
 
   if(mPixelArea != FULL_TEXTURE_RECT)
   {
@@ -762,7 +752,7 @@ void ImageVisual::DoSetOnScene(Actor& actor)
     Vector2 imageSize = Vector2::ZERO;
     if(actor)
     {
-      imageSize  = actor.GetProperty(Actor::Property::SIZE).Get<Vector2>();
+      imageSize           = actor.GetProperty(Actor::Property::SIZE).Get<Vector2>();
       mPlacementActorSize = imageSize;
     }
 
@@ -912,7 +902,7 @@ void ImageVisual::LoadComplete(bool loadingSuccess, TextureInformation textureIn
       Vector2 imageSize = Vector2::ZERO;
       if(actor)
       {
-        imageSize  = actor.GetProperty(Actor::Property::SIZE).Get<Vector2>();
+        imageSize           = actor.GetProperty(Actor::Property::SIZE).Get<Vector2>();
         mPlacementActorSize = imageSize;
       }
       else
@@ -1161,11 +1151,6 @@ Shader ImageVisual::GenerateShader() const
     shader.RegisterProperty(PIXEL_AREA_UNIFORM_NAME, FULL_TEXTURE_RECT);
   }
 
-  // Set pixel align off as default.
-  // ToDo: Pixel align causes issues such as rattling image animation.
-  // We should trun it off until issues are resolved
-  shader.RegisterProperty(PIXEL_ALIGNED_UNIFORM_NAME, PIXEL_ALIGN_OFF);
-
   return shader;
 }
 
index c79c9a6..ac898d7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -95,7 +95,6 @@ const char* const WRAP_MODE_UNIFORM_NAME("wrapMode");
 const char* const IMAGE_WRAP_MODE_U("wrapModeU");
 const char* const IMAGE_WRAP_MODE_V("wrapModeV");
 const char* const IMAGE_BORDER("border");
-const char* const PIXEL_ALIGNED_UNIFORM_NAME("uPixelAligned");
 const char* const ANIMATED_IMAGE_URLS_NAME("urls");
 const char* const BATCH_SIZE_NAME("batchSize");
 const char* const CACHE_SIZE_NAME("cacheSize");
index b65292f..0bb5840 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_VISUAL_STRING_CONSTANTS_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -79,7 +79,6 @@ extern const char* const WRAP_MODE_UNIFORM_NAME;
 extern const char* const IMAGE_WRAP_MODE_U;
 extern const char* const IMAGE_WRAP_MODE_V;
 extern const char* const IMAGE_BORDER;
-extern const char* const PIXEL_ALIGNED_UNIFORM_NAME;
 extern const char* const ANIMATED_IMAGE_URLS_NAME;
 extern const char* const BATCH_SIZE_NAME;
 extern const char* const CACHE_SIZE_NAME;