Merge "Revise installing a license file in automated-test" into devel/master
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Thu, 31 Aug 2017 10:00:57 +0000 (10:00 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Thu, 31 Aug 2017 10:00:57 +0000 (10:00 +0000)
dali-toolkit/internal/text/rendering/text-typesetter.cpp
dali-toolkit/public-api/dali-toolkit-version.cpp
packaging/dali-toolkit.spec

index 11cde00..1821db4 100644 (file)
@@ -151,10 +151,26 @@ void TypesetGlyph( GlyphData& data,
       {
         // Update the alpha channel.
         const uint8_t alpha = *( data.glyphBitmap.buffer + glyphBufferOffset + index );
-        *( packedColorBuffer + 3u ) = static_cast<uint8_t>( color->a * static_cast<float>( alpha ) );
 
-        // Set the color into the final pixel buffer.
-        *( bitmapBuffer + verticalOffset + xOffsetIndex ) = packedColor;
+        // Copy non-transparent pixels only
+        if ( alpha > 0u )
+        {
+          // Check alpha of overlapped pixels
+          uint32_t& currentColor = *( bitmapBuffer + verticalOffset + xOffsetIndex );
+          uint8_t* packedCurrentColorBuffer = reinterpret_cast<uint8_t*>( &currentColor );
+
+          uint8_t currentAlpha = *( packedCurrentColorBuffer + 3u );
+          uint8_t newAlpha = static_cast<uint8_t>( color->a * static_cast<float>( alpha ) );
+
+          // For any pixel overlapped with the pixel in previous glyphs, make sure we don't
+          // overwrite a previous bigger alpha with a smaller alpha (in order to avoid
+          // semi-transparent gaps between joint glyphs with overlapped pixels, which could
+          // happen, for example, in the RTL text when we copy glyphs from right to left).
+          *( packedColorBuffer + 3u ) = std::max( currentAlpha, newAlpha );
+
+          // Set the color into the final pixel buffer.
+          currentColor = packedColor;
+        }
       }
     }
   }
index 377aea1..aa4f80f 100644 (file)
@@ -31,7 +31,7 @@ namespace Toolkit
 
 const unsigned int TOOLKIT_MAJOR_VERSION = 1;
 const unsigned int TOOLKIT_MINOR_VERSION = 2;
-const unsigned int TOOLKIT_MICRO_VERSION = 53;
+const unsigned int TOOLKIT_MICRO_VERSION = 54;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index d9bca28..10159cf 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    The OpenGLES Canvas Core Library Toolkit
-Version:    1.2.53
+Version:    1.2.54
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT