[dali_1.1.33] Merge branch 'devel/master' 81/68581/1
authorDavid Steele <david.steele@samsung.com>
Fri, 6 May 2016 14:48:00 +0000 (15:48 +0100)
committerDavid Steele <david.steele@samsung.com>
Fri, 6 May 2016 14:48:00 +0000 (15:48 +0100)
Change-Id: Ic6fd89cf01a3c41395d7f8bc4b7f9500a5fd8433

38 files changed:
automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/toolkit-text-model.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-LogicalModel.cpp
automated-tests/src/dali-toolkit/utc-Dali-Control.cpp
automated-tests/src/dali-toolkit/utc-Dali-ControlRenderer.cpp
automated-tests/src/dali-toolkit/utc-Dali-DebugRenderer.cpp
automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp
automated-tests/src/dali-toolkit/utc-Dali-RendererFactory.cpp
dali-toolkit/devel-api/controls/flex-container/flex-container.h
dali-toolkit/internal/controls/flex-container/flex-container-impl.cpp
dali-toolkit/internal/controls/model3d-view/model3d-view-impl.cpp
dali-toolkit/internal/controls/model3d-view/obj-loader.cpp
dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.cpp
dali-toolkit/internal/controls/renderers/border/border-renderer.cpp
dali-toolkit/internal/controls/renderers/color/color-renderer.cpp
dali-toolkit/internal/controls/renderers/color/color-renderer.h
dali-toolkit/internal/controls/renderers/control-renderer-data-impl.cpp
dali-toolkit/internal/controls/renderers/gradient/gradient-renderer.cpp
dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp
dali-toolkit/internal/text/clipping/text-clipper.cpp
dali-toolkit/internal/text/layouts/layout-engine.cpp
dali-toolkit/internal/text/logical-model-impl.cpp
dali-toolkit/internal/text/logical-model-impl.h
dali-toolkit/internal/text/markup-processor.cpp
dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp
dali-toolkit/internal/text/text-controller-impl.cpp
dali-toolkit/internal/text/text-controller-impl.h
dali-toolkit/internal/text/text-controller.cpp
dali-toolkit/internal/text/text-font-style.cpp
dali-toolkit/public-api/controls/buttons/button.h
dali-toolkit/public-api/controls/control-impl.cpp
dali-toolkit/public-api/dali-toolkit-version.cpp
docs/content/shared-javascript-and-cpp-documentation/animation.md
docs/content/shared-javascript-and-cpp-documentation/control-renderers.md
packaging/dali-toolkit.spec
plugins/dali-script-v8/src/constants/constants-wrapper.cpp
plugins/dali-script-v8/src/rendering/geometry-api.cpp
plugins/dali-script-v8/src/rendering/renderer-api.cpp
plugins/dali-script-v8/src/rendering/shader-api.cpp

index 9f39bd2..83fa45c 100644 (file)
@@ -81,7 +81,6 @@ void ClearModelData( CharacterIndex characterIndex,
   logicalModel->mBidirectionalParagraphInfo.Clear();
   logicalModel->mCharacterDirections.Clear();
   logicalModel->mBidirectionalLineInfo.Clear();
-  logicalModel->mVisualToLogicalMap.Clear();
   visualModel->mGlyphs.Clear();
   visualModel->mGlyphsToCharacters.Clear();
   visualModel->mCharactersToGlyph.Clear();
@@ -321,10 +320,6 @@ void CreateTextModel( const std::string& text,
     layoutParameters.lineBidirectionalInfoRunsBuffer = bidirectionalLineInfo.Begin();
     layoutParameters.numberOfBidirectionalInfoRuns = bidirectionalLineInfo.Count();
 
-    // Set the bidirectional info into the model.
-    logicalModel->SetVisualToLogicalMap( 0u,
-                                         numberOfCharacters );
-
     if( options.reorder )
     {
       // Re-layout the text. Reorder those lines with right to left characters.
index fa28d61..068a84c 100644 (file)
@@ -31,10 +31,13 @@ using namespace Text;
 
 // Tests the following functions.
 //
-// void SetVisualToLogicalMap( const BidirectionalLineInfoRun* const bidirectionalInfo,
-//                             Length numberOfRuns,
-//                             CharacterIndex startIndex  )
-
+// void CreateParagraphInfo( CharacterIndex startIndex,
+//                           Length numberOfCharacters );
+// void FindParagraphs( CharacterIndex index,
+//                      Length numberOfCharacters,
+//                      Vector<ParagraphRunIndex>& paragraphs );
+// CharacterIndex GetLogicalCharacterIndex( CharacterIndex visualCharacterIndex ) const;
+// CharacterIndex GetLogicalCursorIndex( CharacterIndex visualCursorIndex ) const;
 
 //////////////////////////////////////////////////////////
 
@@ -61,15 +64,24 @@ struct FindParagraphData
   unsigned int*  paragraphs;         ///< The expected paragraph info.
 };
 
-struct SetVisualToLogicalMapData
+struct GetLogicalCharacterIndexData
 {
-  std::string   description;                ///< Description of the test.
-  std::string   text;                       ///< Input text.
-  unsigned int  startIndex;                 ///< The start index from where the visual to logical conversion table is set.
-  unsigned int  numberOfCharacters;         ///< The number of characters to set.
-  Size          textArea;                   ///< The size of the area where the text is laid-out.
-  unsigned int  expectedNumberOfCharacters; ///< The expected number of characters.
-  unsigned int* visualToLogical;            ///< The expected visual to logical conversion table.
+  std::string   description;        ///< Description of the test.
+  std::string   text;               ///< Input text.
+  Size          textArea;           ///< The text area.
+  unsigned int  numberOfIndices;    ///< The number of characters to set.
+  unsigned int* visualToLogical;    ///< The expected visual to logical conversion table.
+  unsigned int* cachedBidiLine;     ///< The cached bidi line index for each character.
+};
+
+struct GetLogicalCursorIndexData
+{
+  std::string    description;        ///< Description of the test.
+  std::string    text;               ///< Input text.
+  unsigned int   numberOfIndices;    ///< The number of characters to set.
+  unsigned int*  visualCursorIndex;  ///< The given cursor visual index.
+  unsigned int*  logicalCursorIndex; ///< The expected cursor logical index
+  unsigned int*  cachedBidiLine;     ///< The cached bidi line index for each character.
 };
 
 bool CreateParagraphTest( const CreateParagraphData& data )
@@ -175,7 +187,7 @@ bool FindParagraphTest( const FindParagraphData& data )
   return true;
 }
 
-bool SetVisualToLogicalMapTest( const SetVisualToLogicalMapData& data )
+bool GetLogicalCharacterIndexTest( const GetLogicalCharacterIndexData& data )
 {
   std::cout << "  testing : " << data.description << std::endl;
   // Create the model.
@@ -194,32 +206,58 @@ bool SetVisualToLogicalMapTest( const SetVisualToLogicalMapData& data )
                    logicalModel,
                    visualModel );
 
-  // Get the visual to logical map.
-  Vector<CharacterIndex>& visualToLogicalMap = logicalModel->mVisualToLogicalMap;
-
-  // Compare the results.
-  if( data.expectedNumberOfCharacters != visualToLogicalMap.Count() )
+  for( unsigned int index = 0u; index < data.numberOfIndices; ++index )
   {
-    std::cout << "  differetn number of characters : " << visualToLogicalMap.Count() << ", expected : " << data.expectedNumberOfCharacters << std::endl;
-    return false;
+    // Check the current cached bidi line index. (Check it before call the GetLogicalCharacterIndex() method )
+    if( data.cachedBidiLine[index] != logicalModel->mBidirectionalLineIndex )
+    {
+      std::cout << "  index : " << index << ", different cached bidi index : " << logicalModel->mBidirectionalLineIndex << ", expected : " << data.cachedBidiLine[index] << std::endl;
+      return false;
+    }
+
+    const Character logicalIndex = logicalModel->GetLogicalCharacterIndex( index );
+    if( data.visualToLogical[index] != logicalIndex )
+    {
+      std::cout << "  visual index : " << index << ", different logical index : " << logicalIndex << ", expected : " << data.visualToLogical[index] << std::endl;
+      return false;
+    }
   }
+  return true;
+}
+
+bool GetLogicalCursorIndexTest( const GetLogicalCursorIndexData& data )
+{
+  std::cout << "  testing : " << data.description << std::endl;
+  // Create the model.
+  LogicalModelPtr logicalModel = LogicalModel::New();
+  VisualModelPtr visualModel = VisualModel::New();
+  Size textArea( 300.f, 300.f );
+  Size layoutSize;
 
-  for( unsigned int index = 0u; index < data.expectedNumberOfCharacters; ++index )
+  // Create the model with the whole text.
+  const Vector<FontDescriptionRun> fontDescriptions;
+  const LayoutOptions options;
+  CreateTextModel( data.text,
+                   textArea,
+                   fontDescriptions,
+                   options,
+                   layoutSize,
+                   logicalModel,
+                   visualModel );
+
+  for( unsigned int index = 0u; index < data.numberOfIndices; ++index )
   {
-    if( data.visualToLogical[index] != visualToLogicalMap[index] )
+    if( logicalModel->mBidirectionalLineIndex != data.cachedBidiLine[index] )
     {
-      std::cout << "  different visualToLogical table : " << std::endl;
-      for( unsigned int i = 0; i < data.expectedNumberOfCharacters; ++i )
-      {
-        std::cout << visualToLogicalMap[i] << " ";
-      }
-      std::cout << std::endl;
-      std::cout << "                         expected : " << std::endl;
-      for( unsigned int i = 0; i < data.expectedNumberOfCharacters; ++i )
-      {
-        std::cout << data.visualToLogical[i] << " ";
-      }
-      std::cout << std::endl;
+      std::cout << "  test : " << index << ", different cached line index : " << logicalModel->mBidirectionalLineIndex << ", expected : " << data.cachedBidiLine[index] << std::endl;
+      return false;
+    }
+
+    const CharacterIndex logicalCursorIndex = logicalModel->GetLogicalCursorIndex( data.visualCursorIndex[index] );
+
+    if( logicalCursorIndex != data.logicalCursorIndex[index] )
+    {
+      std::cout << "  test : " << index << ", different logical cursor index : " << logicalCursorIndex << ", expected : " << data.logicalCursorIndex[index] << std::endl;
       return false;
     }
   }
@@ -233,7 +271,8 @@ bool SetVisualToLogicalMapTest( const SetVisualToLogicalMapData& data )
 //
 // UtcDaliCreateParagraph
 // UtcDaliFindParagraph
-// UtcDaliSetVisualToLogicalMap
+// UtcDaliGetLogicalCharacterIndex
+// UtcDaliGetLogicalCursorIndex
 //
 //////////////////////////////////////////////////////////
 
@@ -380,110 +419,304 @@ int UtcDaliFindParagraph(void)
   END_TEST;
 }
 
-int UtcDaliSetVisualToLogicalMap(void)
+int UtcDaliGetLogicalCharacterIndex(void)
 {
   tet_infoline(" UtcDaliSetVisualToLogicalMap");
 
-  unsigned int* visualToLogical01 = NULL;
-  unsigned int* visualToLogical02 = NULL;
-  unsigned int  visualToLogical03[] = { 12u, 11u, 10u, 9u, 8u, 7u, 6u, 5u, 4u, 3u, 2u, 1u, 0u };
-  unsigned int  visualToLogical04[] = { 0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u, 9u, 10u, 11u, 12u, 25u, 24u, 23u, 22u, 21u, 20u, 19u, 18u, 17u, 16u, 15u, 14u, 13u, };
-  unsigned int  visualToLogical05[] = { 0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u, 9u, 10u, 11u, 12u, 13u, 26u, 25u, 24u, 23u, 22u, 21u, 20u, 19u, 18u, 17u, 16u, 15u, 14u };
-  unsigned int  visualToLogical06[] = { 0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u, 9u, 10u, 11u, 12u, 25u, 24u, 23u, 22u, 21u, 20u, 19u, 18u, 17u, 16u, 15u, 14u, 13u, 26u, 27u, 28u, 29u, 30u, 31u, 32u, 33u, 34u, 35u, 36u, 37u, 38u, 39u, 54u, 53u, 52u, 51u, 50u, 49u, 48u, 47u, 46u, 45u, 44u, 43u, 42u, 41u, 40u, 67u, 66u, 55u, 56u, 57u, 58u, 59u, 60u, 61u, 62u, 63u, 64u, 65u, 81u, 80u, 79u, 78u, 77u, 76u, 75u, 74u, 73u, 72u, 71u, 70u, 69u, 68u, 95u, 94u, 93u, 92u, 91u, 90u, 89u, 88u, 87u, 86u, 85u, 84u, 83u, 82u, 96u, 97u, 98u, 99u, 100u, 101u, 102u, 103u, 104u, 105u, 106u };
-  unsigned int  visualToLogical07[] = { 0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u, 9u, 10u, 11u, 12u, 25u, 24u, 23u, 22u, 21u, 20u, 19u, 18u, 17u, 16u, 15u, 14u, 13u, 26u, 27u, 28u, 29u, 30u, 31u, 32u, 33u, 34u, 35u, 36u, 37u, 38u, 39u, 54u, 53u, 52u, 51u, 50u, 49u, 48u, 47u, 46u, 45u, 44u, 43u, 42u, 41u, 40u, 67u, 66u, 55u, 56u, 57u, 58u, 59u, 60u, 61u, 62u, 63u, 64u, 65u, 81u, 80u, 79u, 78u, 77u, 76u, 75u, 74u, 73u, 72u, 71u, 70u, 69u, 68u, 95u, 94u, 93u, 92u, 91u, 90u, 89u, 88u, 87u, 86u, 85u, 84u, 83u, 82u, 96u, 97u, 98u, 99u, 100u, 101u, 102u, 103u, 104u, 105u, 106u };
-  unsigned int  visualToLogical08[] = { 0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u, 9u, 10u, 11u, 12u, 25u, 24u, 23u, 22u, 21u, 20u, 19u, 18u, 17u, 16u, 15u, 14u, 13u, 26u, 27u, 28u, 29u, 30u, 31u, 32u, 33u, 34u, 35u, 36u, 37u, 38u, 39u, 54u, 53u, 52u, 51u, 50u, 49u, 48u, 47u, 46u, 45u, 44u, 43u, 42u, 41u, 40u, 67u, 66u, 55u, 56u, 57u, 58u, 59u, 60u, 61u, 62u, 63u, 64u, 65u, 81u, 80u, 79u, 78u, 77u, 76u, 75u, 74u, 73u, 72u, 71u, 70u, 69u, 68u, 95u, 94u, 93u, 92u, 91u, 90u, 89u, 88u, 87u, 86u, 85u, 84u, 83u, 82u, 96u, 97u, 98u, 99u, 100u, 101u, 102u, 103u, 104u, 105u, 106u };
-  unsigned int  visualToLogical09[] = { 0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u, 9u, 10u, 11u, 12u, 25u, 24u, 23u, 22u, 21u, 20u, 19u, 18u, 17u, 16u, 15u, 14u, 13u, 26u, 27u, 28u, 29u, 30u, 31u, 32u, 33u, 34u, 35u, 36u, 37u, 38u, 39u, 54u, 53u, 52u, 51u, 50u, 49u, 48u, 47u, 46u, 45u, 44u, 43u, 42u, 41u, 40u, 67u, 66u, 55u, 56u, 57u, 58u, 59u, 60u, 61u, 62u, 63u, 64u, 65u, 81u, 80u, 79u, 78u, 77u, 76u, 75u, 74u, 73u, 72u, 71u, 70u, 69u, 68u, 95u, 94u, 93u, 92u, 91u, 90u, 89u, 88u, 87u, 86u, 85u, 84u, 83u, 82u, 96u, 97u, 98u, 99u, 100u, 101u, 102u, 103u, 104u, 105u, 106u };
-
-  struct SetVisualToLogicalMapData data[] =
+  unsigned int visualToLogical01[] = {};
+  unsigned int  cachedBidiLine01[] = {};
+  unsigned int visualToLogical02[] = { 0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u, 9u, 10u };
+  unsigned int  cachedBidiLine02[] = { 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u,  0u };
+  unsigned int visualToLogical03[] = { 12u, 11u, 10u, 9u, 8u, 7u, 6u, 5u, 4u, 3u, 2u, 1u, 0u };
+  unsigned int  cachedBidiLine03[] = {  0u,  0u,  0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u };
+
+  unsigned int visualToLogical04[] = { 0u,  1u,  2u,  3u,  4u,  5u,  6u,  7u,  8u,  9u, 10u, 11u, 12u, 25u, 24u, 23u, 22u, 21u, 20u, 19u, 18u, 17u, 16u, 15u, 14u, 13u, 26u, 27u, 28u, 29u, 30u, 31u, 32u, 33u, 34u, 35u, 36u, 37u, 38u, 39u, 81u, 80u, 79u, 78u, 77u, 76u, 75u, 74u, 73u, 72u, 71u, 70u, 69u, 68u, 67u, 66u, 55u, 56u, 57u, 58u, 59u, 60u, 61u, 62u, 63u, 64u, 65u, 54u, 53u, 52u, 51u, 50u, 49u, 48u, 47u, 46u, 45u, 44u, 43u, 42u, 41u, 40u, 95u, 94u, 93u, 92u, 91u, 90u, 89u, 88u, 87u, 86u, 85u, 84u, 83u, 82u, 96u, 97u, 98u, 99u, 100u, 101u, 102u, 103u, 104u, 105u, 106u };
+  unsigned int  cachedBidiLine04[] = { 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u,
+                                       0u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u,
+                                       1u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u };
+
+// size 300, 300
+// LO   H  e  l  l  o  _  w  o  r  l  d  ,  _  م  ر  ح  ب   ا  _  ب  ا  ل  ع   ا  ل  م  ,   _  h  e  l  l  o  _  w  o  r  l  d \n
+//      0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
+// VO   H  e  l  l  o  _  w  o  r  l  d  ,  _  م  ل  ا  ع   ل  ا  ب  _  ا   ب  ح  ر  م  ,   _  h  e  l  l  o  _  w  o  r  l  d \n
+//      0  1  2  3  4  5  6  7  8  9 10 11 12 25 24 23 22 21 20 19 18 17 16 15 14 13 26 27 28 29 30 31 32 33 34 35 36 37 38 39
+
+// LO   م  ر  ح  ب   ا  _  ب  ا  ل  ع   ا  ل  م  ,  _  h  e  l  l  o  _  w  o  r  l  d   ,  _  م  ر  ح  ب   ا  _  ب  ا  ل  ع   ا  ل  م  \n
+//     40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
+// VO  \n  م  ل  ا   ع  ل  ا  ب  _  ا   ب  ح  ر  م  _  ,  h  e  l  l  o  _  w  o  r  l  d   _  ,  م  ل  ا   ع  ل  ا  ب  _  ا   ب  ح  ر  م
+//     81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 55 56 57 58 59 60 61 62 63 64 65 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40
+
+// LO   م  ر  ح  ب   ا  _  ب  ا  ل  ع   ا  ل  م  \n
+//     82 83 84 85 86 87 88 89 90 91 92 93 94 95
+// VO  \n  م  ل  ا  ع  ل   ا  ب  _  ا   ب  ح  ر  م
+//     95 94 93 92 91 90 89 88 87 86 85 84 83 82
+
+
+// LO   h   e   l   l   o   _   w   o   r   l   d
+//     96  97  98  99 100 101 102 103 104 105 106
+// VO   h   e   l   l   o   _   w   o   r   l   d
+//     96  97  98  99 100 101 102 103 104 105 106
+
+  unsigned int visualToLogical05[] = { 0u,  1u,  2u,  3u,  4u,  5u,  6u,  7u,  8u,  9u, 10u, 11u, 12u, 25u, 24u, 23u, 22u, 21u, 20u, 19u, 18u, 17u, 16u, 15u, 14u, 13u, 26u, 27u, 28u, 29u, 30u, 31u, 32u, 33u, 34u, 35u, 36u, 37u, 38u, 39u, 67u, 66u, 55u, 56u, 57u, 58u, 59u, 60u, 61u, 62u, 63u, 64u, 65u, 54u, 53u, 52u, 51u, 50u, 49u, 48u, 47u, 46u, 45u, 44u, 43u, 42u, 41u, 40u, 81u, 80u, 79u, 78u, 77u, 76u, 75u, 74u, 73u, 72u, 71u, 70u, 69u, 68u, 95u, 94u, 93u, 92u, 91u, 90u, 89u, 88u, 87u, 86u, 85u, 84u, 83u, 82u, 96u, 97u, 98u, 99u, 100u, 101u, 102u, 103u, 104u, 105u, 106u };
+  unsigned int  cachedBidiLine05[] = { 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 3u, 3u, 3u, 3u, 3u, 3u, 3u, 3u, 3u, 3u, 3u, 3u, 3u, 3u, 4u, 4u, 4u, 4u, 4u, 4u, 4u, 4u, 4u, 4u, 4u, 4u, 4u, 4u, 4u, 4u, 4u, 4u, 4u, 4u, 4u, 4u, 4u, 4u };
+
+// size 300, 300
+// LO   H  e  l  l  o  _  w  o  r  l  d  ,  _  م  ر  ح  ب   ا  _  ب  ا  ل  ع   ا  ل  م  ,   _
+//      0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
+// VO   H  e  l  l  o  _  w  o  r  l  d  ,  _  م  ل  ا  ع   ل  ا  ب  _  ا   ب  ح  ر  م  ,   _
+//      0  1  2  3  4  5  6  7  8  9 10 11 12 25 24 23 22 21 20 19 18 17 16 15 14 13 26 27
+
+// LO    h  e  l  l  o  _  w  o  r  l  d \n
+//      28 29 30 31 32 33 34 35 36 37 38 39
+// VO    h  e  l  l  o  _  w  o  r  l  d \n
+//      28 29 30 31 32 33 34 35 36 37 38 39
+
+// LO   م  ر  ح  ب   ا  _  ب  ا  ل  ع   ا  ل  م  ,  _  h  e  l  l  o  _  w  o  r  l  d   ,  _
+//     40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
+// VO  _  ,  h  e  l  l  o  _  w  o  r  l  d   _  ,  م  ل  ا   ع  ل  ا  ب  _  ا   ب  ح  ر  م
+//     67 66 55 56 57 58 59 60 61 62 63 64 65 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40
+
+// LO   م  ر  ح  ب   ا  _  ب  ا  ل  ع   ا  ل  م  \n
+//     68 69 70 71 72 73 74 75 76 77 78 79 80 81
+// VO  \n  م  ل  ا   ع  ل  ا  ب  _  ا   ب  ح  ر  م
+//     81 80 79 78 77 76 75 74 73 72 71 70 69 68
+
+// LO   م  ر  ح  ب   ا  _  ب  ا  ل  ع   ا  ل  م  \n
+//     82 83 84 85 86 87 88 89 90 91 92 93 94 95
+// VO  \n  م  ل  ا  ع  ل   ا  ب  _  ا   ب  ح  ر  م
+//     95 94 93 92 91 90 89 88 87 86 85 84 83 82
+
+
+// LO   h   e   l   l   o   _   w   o   r   l   d
+//     96  97  98  99 100 101 102 103 104 105 106
+// VO   h   e   l   l   o   _   w   o   r   l   d
+//     96  97  98  99 100 101 102 103 104 105 106
+
+  unsigned int visualToLogical06[] = { 0u,  1u,  2u,  3u,  4u,  5u,  6u,  7u,  8u,  9u, 10u, 11u, 12u, 25u, 24u, 23u, 22u, 21u, 20u, 19u, 18u, 17u, 16u, 15u, 14u, 13u, 26u, 27u, 28u, 29u, 30u, 31u, 32u, 33u, 34u, 35u, 36u, 37u, 38u, 39u, 54u, 53u, 52u, 51u, 50u, 49u, 48u, 47u, 46u, 45u, 44u, 43u, 42u, 41u, 40u, 67u, 66u, 55u, 56u, 57u, 58u, 59u, 60u, 61u, 62u, 63u, 64u, 65u, 81u, 80u, 79u, 78u, 77u, 76u, 75u, 74u, 73u, 72u, 71u, 70u, 69u, 68u, 95u, 94u, 93u, 92u, 91u, 90u, 89u, 88u, 87u, 86u, 85u, 84u, 83u, 82u, 96u, 97u, 98u, 99u, 100u, 101u, 102u, 103u, 104u, 105u, 106u };
+  unsigned int  cachedBidiLine06[] = { 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u,
+                                       0u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u,
+                                       1u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u, 2u,
+                                       2u, 3u, 3u, 3u, 3u, 3u, 3u, 3u, 3u, 3u, 3u, 3u, 3u, 3u, 3u,
+                                       3u, 4u, 4u, 4u, 4u, 4u, 4u, 4u, 4u, 4u, 4u, 4u, 4u,
+                                       4u, 5u, 5u, 5u, 5u, 5u, 5u, 5u, 5u, 5u, 5u, 5u, 5u, 5u,
+                                       5u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u,
+                                       6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u };
+
+// size 100, 600
+// LO   H  e  l  l  o  _  w  o  r  l  d  ,  _
+//      0  1  2  3  4  5  6  7  8  9 10 11 12
+// VO   H  e  l  l  o  _  w  o  r  l  d  ,  _
+//      0  1  2  3  4  5  6  7  8  9 10 11 12
+
+// LO    م  ر  ح  ب   ا  _  ب  ا  ل  ع   ا  ل  م  ,   _
+//      13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
+// VO    م  ل  ا  ع   ل  ا  ب  _  ا   ب  ح  ر  م  ,   _
+//      25 24 23 22 21 20 19 18 17 16 15 14 13 26 27
+
+// LO    h  e  l  l  o  _  w  o  r  l  d \n
+//      28 29 30 31 32 33 34 35 36 37 38 39
+// VO    h  e  l  l  o  _  w  o  r  l  d \n
+//      28 29 30 31 32 33 34 35 36 37 38 39
+
+// LO   م  ر  ح  ب   ا  _  ب  ا  ل  ع   ا  ل  م  ,  _
+//     40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
+// VO   _  ,  م  ل  ا   ع  ل  ا  ب  _  ا   ب  ح  ر  م
+//     54 53 52 51 50 49 48 47 46 45 44 43 42 41 40
+
+// LO   h  e  l  l  o  _  w  o  r  l  d   ,  _
+//     55 56 57 58 59 60 61 62 63 64 65 66 67
+// VO   _  ,  h  e  l  l  o  _  w  o  r  l  d
+//     67 66 55 56 57 58 59 60 61 62 63 64 65
+
+// LO   م  ر  ح  ب   ا  _  ب  ا  ل  ع   ا  ل  م  \n
+//     68 69 70 71 72 73 74 75 76 77 78 79 80 81
+// VO  \n  م  ل  ا   ع  ل  ا  ب  _  ا   ب  ح  ر  م
+//     81 80 79 78 77 76 75 74 73 72 71 70 69 68
+
+// LO   م  ر  ح  ب   ا  _  ب  ا  ل  ع   ا  ل  م  \n
+//     82 83 84 85 86 87 88 89 90 91 92 93 94 95
+// VO  \n  م  ل  ا  ع  ل   ا  ب  _  ا   ب  ح  ر  م
+//     95 94 93 92 91 90 89 88 87 86 85 84 83 82
+
+
+// LO   h   e   l   l   o   _   w   o   r   l   d
+//     96  97  98  99 100 101 102 103 104 105 106
+// VO   h   e   l   l   o   _   w   o   r   l   d
+//     96  97  98  99 100 101 102 103 104 105 106
+
+  struct GetLogicalCharacterIndexData data[] =
   {
     {
       "Zero characters text",
       "",
+      Size( 300.f, 300.f ),
       0u,
-      0u,
-      Size( 100.f, 300.f ),
-      0u,
-      visualToLogical01
+      visualToLogical01,
+      cachedBidiLine01
     },
     {
       "Left to right text only",
       "Hello world",
-      0u,
+      Size( 300.f, 300.f ),
       11u,
-      Size( 100.f, 300.f ),
-      0u,
-      visualToLogical02
+      visualToLogical02,
+      cachedBidiLine02
     },
     {
       "Right to left text only",
       "مرحبا بالعالم",
-      0u,
-      13u,
-      Size( 100.f, 300.f ),
+      Size( 300.f, 300.f ),
       13u,
-      visualToLogical03
+      visualToLogical03,
+      cachedBidiLine03
     },
     {
       "Mix of left to right and right to left text.",
-      "Hello world, مرحبا بالعالم",
-      0u,
-      26u,
-      Size( 100.f, 300.f ),
-      26u,
-      visualToLogical04
+      "Hello world, مرحبا بالعالم, hello world\nمرحبا بالعالم, hello world, مرحبا بالعالم\nمرحبا بالعالم\nhello world",
+      Size( 300.f, 300.f ),
+      107u,
+      visualToLogical04,
+      cachedBidiLine04
     },
     {
       "Mix of left to right and right to left text.",
-      "Hello world, \nمرحبا بالعالم",
-      0u,
-      27u,
-      Size( 100.f, 300.f ),
-      27u,
-      visualToLogical05
+      "Hello world, مرحبا بالعالم, hello world\nمرحبا بالعالم, hello world, مرحبا بالعالم\nمرحبا بالعالم\nhello world",
+      Size( 200.f, 400.f ),
+      107u,
+      visualToLogical05,
+      cachedBidiLine05
     },
     {
       "Mix of left to right and right to left text.",
       "Hello world, مرحبا بالعالم, hello world\nمرحبا بالعالم, hello world, مرحبا بالعالم\nمرحبا بالعالم\nhello world",
-      0u,
-      107u,
-      Size( 100.f, 300.f ),
+      Size( 100.f, 600.f ),
       107u,
-      visualToLogical06
+      visualToLogical06,
+      cachedBidiLine06
+    },
+  };
+  const unsigned int numberOfTests = 6u;
+
+  for( unsigned int index = 0u; index < numberOfTests; ++index )
+  {
+    ToolkitTestApplication application;
+    if( !GetLogicalCharacterIndexTest( data[index] ) )
+    {
+      tet_result(TET_FAIL);
+    }
+  }
+
+  tet_result(TET_PASS);
+  END_TEST;
+}
+
+int UtcDaliGetLogicalCursorIndex(void)
+{
+  tet_infoline(" UtcDaliGetLogicalCursorIndex");
+
+  unsigned int visualIndex01[] = { 10u };
+  unsigned int logicalIndex01[] = { 10u };
+  unsigned int bidirectionalLineIndex01[] = { 0u };
+
+  unsigned int visualIndex02[] = { 0u, 16u, 11u, 12u };
+  unsigned int logicalIndex02[] = { 0u, 16u, 11u, 12u };
+  unsigned int bidirectionalLineIndex02[] = { 0u, 0u, 0u, 0u };
+
+
+
+// LO     H  e  l  l  o  _  w  o  r  l  d  ,  _  \n
+//       0  1  2  3  4  5  6  7  8  9 10 11 12 13 14
+// VO     H  e  l  l  o  _  w  o  r  l  d  ,  _  \n
+
+// LO      ש  ל  ו  ם  _  ע  ו  ל  ם  ,  _ \n
+//       14 15 16 17 18 19 20 21 22 23 24 25 26
+// VO      \n _  ,  ם  ל  ו  ע  _  ם  ו  ל  ש
+
+// LO      h  e  l  l  o  _  w  o  r  l  d  ,  _ \n
+//       26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
+// VO      h  e  l  l  o  _  w  o  r  l  d  ,  _ \n
+
+// LO      h  e  l  l  o  _  w  o  r  l  d  ,  _  ש  ל  ו  ם  _  ע  ו  ל  ם \n
+//       40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
+// VO      h  e  l  l  o  _  w  o  r  l  d  ,  _  ם  ל  ו  ע  _  ם  ו  ל  ש \n
+
+// LO      ש  ל  ו  ם  _  ע  ו  ל  ם
+//       63 64 65 66 67 68 69 70 71 72
+// VO      ם  ל  ו  ע  _  ם  ו  ל  ש
+
+  unsigned int visualIndex03[] = { 0u, 18u, 25u, 60u, 54u, 65u, 0u, 18u, 65u, 33u };
+  unsigned int logicalIndex03[] = { 0u, 22u, 15u, 55u, 61u, 70u, 0u, 22u, 70u, 33u };
+  unsigned int bidirectionalLineIndex03[] = { 0u, 0u, 0u, 0u, 1u, 1u, 2u, 2u, 0u, 2u };
+
+
+// LO      ש  ל  ו  ם  _  ע  ו  ל  ם  ,  _ \n
+//        0  1  2  3  4  5  6  7  8  9 10 11 12
+// VO      \n ,  ם  ל  ו  ע  _  ם  ו  ל  ש
+
+// LO      h  e  l  l  o  _  w  o  r  l  d  ,  _  \n
+//       12 13 14 15 16 17 18 19 20 21 22 23 24 25  26
+// VO      h  e  l  l  o  _  w  o  r  l  d  ,  _  \n
+
+// LO      h  e  l  l  o  _  w  o  r  l  d  ,  _  ש  ל  ו  ם  _  ע  ו  ל  ם  \n
+//       26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48  49
+// VO      h  e  l  l  o  _  w  o  r  l  d  ,  _  ש  ל  ו  ם  _  ע  ו  ל  ם  \n
+
+// LO      ש  ל  ו  ם  _  ע  ו  ל  ם  ,  _  \n
+//       49 50 51 52 53 54 55 56 57 58 59 60  61
+// VO      ם  ל  ו  ע  _  ם  ו  ל  ש  ,  \n
+
+// LO      h  e  l  l  o  _  w  o  r  l  d
+//       61 62 63 64 65 66 67 68 69 70 71 72
+// VO      h  e  l  l  o  _  w  o  r  l  d
+
+
+  unsigned int visualIndex04[] = { 0u };
+  unsigned int logicalIndex04[] = { 72u };
+  unsigned int bidirectionalLineIndex04[] = { 0u };
+
+
+
+  struct GetLogicalCursorIndexData data[] =
+  {
+    {
+      "Zero characters text",
+      "",
+      1u,
+      visualIndex01,
+      logicalIndex01,
+      bidirectionalLineIndex01,
     },
     {
-      "Mix of left to right and right to left text. Updates from character index 5",
-      "Hello world, مرحبا بالعالم, hello world\nمرحبا بالعالم, hello world, مرحبا بالعالم\nمرحبا بالعالم\nhello world",
-      5u,
-      107u,
-      Size( 100.f, 300.f ),
-      107u,
-      visualToLogical07
+      "All left to right text 01.",
+      "Hello world\ndemo",
+      4u,
+      visualIndex02,
+      logicalIndex02,
+      bidirectionalLineIndex02,
     },
     {
-      "Mix of left to right and right to left text. Updates from character index 39",
-      "Hello world, مرحبا بالعالم, hello world\nمرحبا بالعالم, hello world, مرحبا بالعالم\nمرحبا بالعالم\nhello world",
-      39u,
-      107u,
-      Size( 100.f, 300.f ),
-      107u,
-      visualToLogical08
+      "bidirectional text 01.",
+      "Hello world, \nשלום עולם, \nhello world, \nhello world, שלום עולם\nשלום עולם",
+      10u,
+      visualIndex03,
+      logicalIndex03,
+      bidirectionalLineIndex03,
     },
     {
-      "Mix of left to right and right to left text. Updates from character index 70",
-      "Hello world, مرحبا بالعالم, hello world\nمرحبا بالعالم, hello world, مرحبا بالعالم\nمرحبا بالعالم\nhello world",
-      70u,
-      107u,
-      Size( 100.f, 300.f ),
-      107u,
-      visualToLogical09
-    }
+      "bidirectional text 02.",
+      "שלום עולם, \nhello world, \nhello world, שלום עולם\nשלום עולם, \nhello world",
+      1u,
+      visualIndex04,
+      logicalIndex04,
+      bidirectionalLineIndex04,
+    },
   };
-  const unsigned int numberOfTests = 9u;
+  const unsigned int numberOfTests = 4u;
 
   for( unsigned int index = 0u; index < numberOfTests; ++index )
   {
     ToolkitTestApplication application;
-    if( !SetVisualToLogicalMapTest( data[index] ) )
+    if( !GetLogicalCursorIndexTest( data[index] ) )
     {
       tet_result(TET_FAIL);
     }
index 9a7e6ff..1ecf233 100644 (file)
@@ -397,8 +397,8 @@ int UtcDaliControlBackgroundColor(void)
   Property::Map* resultMap = propValue.GetMap();
   DALI_TEST_CHECK( resultMap->Find( "rendererType" ) );
   DALI_TEST_CHECK( resultMap->Find( "rendererType" )->Get<std::string>() == "color" );
-  DALI_TEST_CHECK( resultMap->Find( "blendColor" ) );
-  DALI_TEST_CHECK( resultMap->Find( "blendColor" )->Get<Vector4>() == Color::RED );
+  DALI_TEST_CHECK( resultMap->Find( "mixColor" ) );
+  DALI_TEST_CHECK( resultMap->Find( "mixColor" )->Get<Vector4>() == Color::RED );
 
   DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::RED, TEST_LOCATION );
 
@@ -406,8 +406,8 @@ int UtcDaliControlBackgroundColor(void)
 
   propValue = control.GetProperty( Control::Property::BACKGROUND );
   resultMap = propValue.GetMap();
-  DALI_TEST_CHECK( resultMap->Find( "blendColor" ) );
-  DALI_TEST_CHECK( resultMap->Find( "blendColor" )->Get<Vector4>() == Color::YELLOW );
+  DALI_TEST_CHECK( resultMap->Find( "mixColor" ) );
+  DALI_TEST_CHECK( resultMap->Find( "mixColor" )->Get<Vector4>() == Color::YELLOW );
 
   DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::YELLOW, TEST_LOCATION );
 
@@ -463,14 +463,14 @@ int UtcDaliControlBackgroundProperties(void)
 
   Property::Map rendererMap;
   rendererMap["rendererType"] = "color";
-  rendererMap["blendColor"] = Color::CYAN;
+  rendererMap["mixColor"] = Color::CYAN;
   control.SetProperty( Control::Property::BACKGROUND, rendererMap );
   propValue = control.GetProperty( Control::Property::BACKGROUND );
   resultMap = propValue.GetMap();
   DALI_TEST_CHECK( resultMap->Find( "rendererType" ) );
   DALI_TEST_CHECK( resultMap->Find( "rendererType" )->Get<std::string>() == "color" );
-  DALI_TEST_CHECK( resultMap->Find( "blendColor" ) );
-  DALI_TEST_CHECK( resultMap->Find( "blendColor" )->Get<Vector4>() == Color::CYAN );
+  DALI_TEST_CHECK( resultMap->Find( "mixColor" ) );
+  DALI_TEST_CHECK( resultMap->Find( "mixColor" )->Get<Vector4>() == Color::CYAN );
 
   Property::Map emptyMap;
   control.SetProperty( Control::Property::BACKGROUND, emptyMap );
index 55fa608..f5a2d96 100644 (file)
@@ -50,7 +50,7 @@ int UtcDaliControlRendererCopyAndAssignment(void)
   RendererFactory factory = RendererFactory::Get();
   Property::Map propertyMap;
   propertyMap.Insert("rendererType",  "color");
-  propertyMap.Insert("blendColor",  Color::BLUE);
+  propertyMap.Insert("mixColor",  Color::BLUE);
   ControlRenderer controlRenderer = factory.GetControlRenderer( propertyMap );
 
   ControlRenderer controlRendererCopy( controlRenderer );
@@ -83,7 +83,7 @@ int UtcDaliControlRendererSetGetDepthIndex(void)
   RendererFactory factory = RendererFactory::Get();
   Property::Map propertyMap;
   propertyMap.Insert("rendererType",  "color");
-  propertyMap.Insert("blendColor",  Color::BLUE);
+  propertyMap.Insert("mixColor",  Color::BLUE);
   ControlRenderer controlRenderer = factory.GetControlRenderer( propertyMap );
 
   controlRenderer.SetDepthIndex( 1.f );
@@ -187,7 +187,7 @@ int UtcDaliControlRendererSetOnOffStage(void)
   RendererFactory factory = RendererFactory::Get();
   Property::Map propertyMap;
   propertyMap.Insert("rendererType",  "color");
-  propertyMap.Insert("blendColor",  Color::BLUE);
+  propertyMap.Insert("mixColor",  Color::BLUE);
   ControlRenderer controlRenderer = factory.GetControlRenderer( propertyMap );
 
   Actor actor = Actor::New();
@@ -260,7 +260,7 @@ int UtcDaliControlRendererGetPropertyMap1(void)
   RendererFactory factory = RendererFactory::Get();
   Property::Map propertyMap;
   propertyMap.Insert("rendererType",  "color");
-  propertyMap.Insert("blendColor",  Color::BLUE);
+  propertyMap.Insert("mixColor",  Color::BLUE);
   ControlRenderer colorRenderer = factory.GetControlRenderer( propertyMap );
 
   Property::Map resultMap;
@@ -270,7 +270,7 @@ int UtcDaliControlRendererGetPropertyMap1(void)
   DALI_TEST_CHECK( typeValue );
   DALI_TEST_CHECK( typeValue->Get<std::string>() == "color" );
 
-  Property::Value* colorValue = resultMap.Find( "blendColor",  Property::VECTOR4 );
+  Property::Value* colorValue = resultMap.Find( "mixColor",  Property::VECTOR4 );
   DALI_TEST_CHECK( colorValue );
   DALI_TEST_CHECK( colorValue->Get<Vector4>() == Color::BLUE );
 
@@ -279,7 +279,7 @@ int UtcDaliControlRendererGetPropertyMap1(void)
   factory.ResetRenderer( colorRenderer, actor, Color::CYAN );
   colorRenderer.CreatePropertyMap( resultMap );
 
-  colorValue = resultMap.Find( "blendColor",  Property::VECTOR4 );
+  colorValue = resultMap.Find( "mixColor",  Property::VECTOR4 );
   DALI_TEST_CHECK( colorValue );
   DALI_TEST_CHECK( colorValue->Get<Vector4>() == Color::CYAN );
 
index 28999a0..702f726 100644 (file)
@@ -73,7 +73,7 @@ int UtcDaliDebugRendererGetRenderer1(void)
   // Test that color renderer is replaced with debug renderer
   Property::Map propertyMap1;
   propertyMap1.Insert("rendererType",  "color");
-  propertyMap1.Insert("blendColor",  Color::BLUE);
+  propertyMap1.Insert("mixColor",  Color::BLUE);
   ControlRenderer colorRenderer = factory.GetControlRenderer(propertyMap1);
   DALI_TEST_CHECK( colorRenderer );
   DALI_TEST_CHECK( IsDebugRenderer( colorRenderer ) );
index cbba3e0..67f054c 100644 (file)
@@ -328,18 +328,8 @@ int UtcDaliImageViewSetGetProperty03(void)
   application.SendNotification();
   application.Render();
 
- // conventional alpha blending
 // conventional alpha blending
   Renderer renderer = imageView.GetRendererAt( 0 );
-  BlendingFactor::Type srcFactorRgb;
-  BlendingFactor::Type destFactorRgb;
-  BlendingFactor::Type srcFactorAlpha;
-  BlendingFactor::Type destFactorAlpha;
-  renderer.GetBlendFunc(srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha);
-  DALI_TEST_CHECK( srcFactorRgb == BlendingFactor::SRC_ALPHA );
-  DALI_TEST_CHECK( destFactorRgb == BlendingFactor::ONE_MINUS_SRC_ALPHA );
-  DALI_TEST_CHECK( srcFactorAlpha == BlendingFactor::ONE );
-  DALI_TEST_CHECK( destFactorAlpha == BlendingFactor::ONE_MINUS_SRC_ALPHA );
-
   Property::Value value = renderer.GetProperty( Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA );
   bool enable;
   DALI_TEST_CHECK( value.Get( enable ) );
@@ -350,7 +340,10 @@ int UtcDaliImageViewSetGetProperty03(void)
   application.SendNotification();
   application.Render();
 
-  renderer.GetBlendFunc(srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha);
+  int srcFactorRgb    = renderer.GetProperty<int>( Renderer::Property::BLEND_FACTOR_SRC_RGB );
+  int destFactorRgb   = renderer.GetProperty<int>( Renderer::Property::BLEND_FACTOR_DEST_RGB );
+  int srcFactorAlpha  = renderer.GetProperty<int>( Renderer::Property::BLEND_FACTOR_SRC_ALPHA );
+  int destFactorAlpha = renderer.GetProperty<int>( Renderer::Property::BLEND_FACTOR_DEST_ALPHA );
   DALI_TEST_CHECK( srcFactorRgb == BlendingFactor::ONE );
   DALI_TEST_CHECK( destFactorRgb == BlendingFactor::ONE_MINUS_SRC_ALPHA );
   DALI_TEST_CHECK( srcFactorAlpha == BlendingFactor::ONE );
index f37298c..89bc1a1 100644 (file)
@@ -290,7 +290,7 @@ int UtcDaliRendererFactoryGetColorRenderer1(void)
   Property::Map propertyMap;
   Vector4 testColor( 1.f, 0.5f, 0.3f, 0.2f );
   propertyMap.Insert("rendererType",  "color");
-  propertyMap.Insert("blendColor",  testColor);
+  propertyMap.Insert("mixColor",  testColor);
 
   ControlRenderer controlRenderer = factory.GetControlRenderer(propertyMap);
   DALI_TEST_CHECK( controlRenderer );
@@ -300,7 +300,7 @@ int UtcDaliRendererFactoryGetColorRenderer1(void)
 
   Vector4 actualValue(Vector4::ZERO);
   TestGlAbstraction& gl = application.GetGlAbstraction();
-  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "blendColor", actualValue ) );
+  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "mixColor", actualValue ) );
   DALI_TEST_EQUALS( actualValue, testColor, TEST_LOCATION );
 
   END_TEST;
@@ -323,7 +323,7 @@ int UtcDaliRendererFactoryGetColorRenderer2(void)
 
   Vector4 actualValue(Vector4::ZERO);
   TestGlAbstraction& gl = application.GetGlAbstraction();
-  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "blendColor", actualValue ) );
+  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "mixColor", actualValue ) );
   DALI_TEST_EQUALS( actualValue, testColor, TEST_LOCATION );
 
   controlRenderer.SetOffStage( actor );
@@ -357,7 +357,7 @@ int UtcDaliRendererFactoryGetBorderRenderer1(void)
   controlRenderer.SetOnStage( actor );
 
   DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
-  int blendMode = actor.GetRendererAt(0u).GetProperty<int>( Renderer::Property::BLENDING_MODE );
+  int blendMode = actor.GetRendererAt(0u).GetProperty<int>( Renderer::Property::BLEND_MODE );
   DALI_TEST_EQUALS( static_cast<BlendingMode::Type>(blendMode), BlendingMode::ON, TEST_LOCATION );
 
   TestGlAbstraction& gl = application.GetGlAbstraction();
@@ -406,7 +406,7 @@ int UtcDaliRendererFactoryGetBorderRenderer2(void)
   application.SendNotification();
   application.Render(0);
 
-  int blendMode = actor.GetRendererAt(0u).GetProperty<int>( Renderer::Property::BLENDING_MODE );
+  int blendMode = actor.GetRendererAt(0u).GetProperty<int>( Renderer::Property::BLEND_MODE );
   DALI_TEST_EQUALS( static_cast<BlendingMode::Type>(blendMode), BlendingMode::AUTO, TEST_LOCATION );
 
   Vector4 actualColor(Vector4::ZERO);
@@ -425,7 +425,7 @@ int UtcDaliRendererFactoryGetBorderRenderer2(void)
 
   application.SendNotification();
   application.Render(0);
-  blendMode = actor.GetRendererAt(0u).GetProperty<int>( Renderer::Property::BLENDING_MODE );
+  blendMode = actor.GetRendererAt(0u).GetProperty<int>( Renderer::Property::BLEND_MODE );
   DALI_TEST_EQUALS( static_cast<BlendingMode::Type>(blendMode), BlendingMode::ON, TEST_LOCATION );
 
   END_TEST;
@@ -949,13 +949,13 @@ int UtcDaliRendererFactoryResetRenderer1(void)
 
   Vector4 actualValue(Vector4::ZERO);
   TestGlAbstraction& gl = application.GetGlAbstraction();
-  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "blendColor", actualValue ) );
+  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "mixColor", actualValue ) );
   DALI_TEST_EQUALS( actualValue, Color::RED, TEST_LOCATION );
 
   factory.ResetRenderer( controlRenderer, actor, Color::GREEN );
   application.SendNotification();
   application.Render(0);
-  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "blendColor", actualValue ) );
+  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "mixColor", actualValue ) );
   DALI_TEST_EQUALS( actualValue, Color::GREEN, TEST_LOCATION );
 
   Image bufferImage = CreateBufferImage( 100, 200, Vector4( 1.f, 1.f, 1.f, 1.f ) );
@@ -1009,7 +1009,7 @@ int UtcDaliRendererFactoryResetRenderer2(void)
   application.SendNotification();
   application.Render(0);
   Vector4 actualValue(Vector4::ZERO);
-  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "blendColor", actualValue ) );
+  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "mixColor", actualValue ) );
   DALI_TEST_EQUALS( actualValue, Color::RED, TEST_LOCATION );
 
   END_TEST;
index 97a9bdb..154eedd 100644 (file)
@@ -84,8 +84,6 @@ class FlexContainer;
  * |-------------------------|-------------|
  * | flex                    | float       |
  * | alignSelf               | integer     |
- * | flexPadding             | Vector4     |
- * | flexBorder              | Vector4     |
  * | flexMargin              | Vector4     |
  *
  * The available values for alignSelf are: ALIGN_AUTO, ALIGN_FLEX_START, ALIGN_CENTER, ALIGN_FLEX_END, ALIGN_STRETCH
@@ -97,9 +95,7 @@ class FlexContainer;
  *   "customProperties": {
  *     "flex":1,                        // property to make the item to receive the specified proportion of the free space in the container. If all items in the container use this pattern, their sizes will be proportional to the specified flex factor.
  *     "alignSelf":"flexStart",         // property to specify how the item will align along the cross axis, if set, this overides the default alignment for all items in the container
- *     "flexPadding":[10, 10, 10, 10],  // property to specify the space around the content (inside the flex border) of the item, if not set, default value is [0, 0, 0, 0]
- *     "flexBorder":[5, 5, 5, 5],       // property to specify the border that goes around the flex padding and the content of the item, if not set, default value is [0, 0, 0, 0]
- *     "flexMargin":[10, 10, 10, 10]    // property to specify the space outside the flex border, if not set, default value is [0, 0, 0, 0]
+ *     "flexMargin":[10, 10, 10, 10]    // property to specify the space around the item, if not set, default value is [0, 0, 0, 0]
  *   }
  * @endcode
  */
index 323a2cd..00e1271 100644 (file)
@@ -42,8 +42,6 @@ namespace
  */
 const char * const FLEX_PROPERTY_NAME("flex");
 const char * const ALIGN_SELF_PROPERTY_NAME("alignSelf");
-const char * const FLEX_PADDING_PROPERTY_NAME("flexPadding");
-const char * const FLEX_BORDER_PROPERTY_NAME("flexBorder");
 const char * const FLEX_MARGIN_PROPERTY_NAME("flexMargin");
 
 #if defined(DEBUG_ENABLED)
@@ -634,24 +632,6 @@ void FlexContainer::ComputeLayout()
         childNode->style.align_self = static_cast<css_align_t>(alignSelf);
       }
 
-      if( childActor.GetPropertyIndex( FLEX_PADDING_PROPERTY_NAME ) != Property::INVALID_INDEX )
-      {
-        Vector4 flexPadding = childActor.GetProperty( childActor.GetPropertyIndex(FLEX_PADDING_PROPERTY_NAME) ).Get<Vector4>();
-        childNode->style.padding[CSS_LEFT] = flexPadding.x;
-        childNode->style.padding[CSS_TOP] = flexPadding.y;
-        childNode->style.padding[CSS_RIGHT] = flexPadding.z;
-        childNode->style.padding[CSS_BOTTOM] = flexPadding.w;
-      }
-
-      if( childActor.GetPropertyIndex( FLEX_BORDER_PROPERTY_NAME ) != Property::INVALID_INDEX )
-      {
-        Vector4 flexBorder = childActor.GetProperty( childActor.GetPropertyIndex(FLEX_BORDER_PROPERTY_NAME) ).Get<Vector4>();
-        childNode->style.border[CSS_LEFT] = flexBorder.x;
-        childNode->style.border[CSS_TOP] = flexBorder.y;
-        childNode->style.border[CSS_RIGHT] = flexBorder.z;
-        childNode->style.border[CSS_BOTTOM] = flexBorder.w;
-      }
-
       if( childActor.GetPropertyIndex( FLEX_MARGIN_PROPERTY_NAME ) != Property::INVALID_INDEX )
       {
         Vector4 flexMargin = childActor.GetProperty( childActor.GetPropertyIndex(FLEX_MARGIN_PROPERTY_NAME) ).Get<Vector4>();
index 6d05a50..0f64ac0 100644 (file)
@@ -448,7 +448,7 @@ void Model3dView::OnInitialize()
 {
   //Create empty versions of the geometry and material so we always have a Renderer
   Geometry mesh = Geometry::New();
-  Shader shader = Shader::New( SIMPLE_VERTEX_SHADER, SIMPLE_FRAGMENT_SHADER, (Shader::ShaderHints)(Shader::HINT_REQUIRES_SELF_DEPTH_TEST | Shader::HINT_MODIFIES_GEOMETRY) );
+  Shader shader = Shader::New( SIMPLE_VERTEX_SHADER, SIMPLE_FRAGMENT_SHADER );
   mRenderer = Renderer::New( mesh, shader );
 
 }
@@ -525,6 +525,7 @@ void Model3dView::CreateGeometry()
     if( mRenderer )
     {
       mRenderer.SetGeometry( mMesh );
+      mRenderer.SetProperty( Renderer::Property::DEPTH_WRITE_MODE, DepthWriteMode::ON );
     }
   }
 }
@@ -557,20 +558,20 @@ void Model3dView::CreateMaterial()
   {
     if( (mTexture2Url != "") && (mTexture1Url != "") && (mIlluminationType == Toolkit::Model3dView::DIFFUSE_WITH_NORMAL_MAP) && mObjLoader.IsNormalMapPresent() )
     {
-      mShader = Shader::New( NRMMAP_VERTEX_SHADER, NRMMAP_FRAGMENT_SHADER, (Shader::ShaderHints)(Shader::HINT_REQUIRES_SELF_DEPTH_TEST | Shader::HINT_MODIFIES_GEOMETRY) );
+      mShader = Shader::New( NRMMAP_VERTEX_SHADER, NRMMAP_FRAGMENT_SHADER );
     }
     else if( mIlluminationType == Toolkit::Model3dView::DIFFUSE_WITH_TEXTURE )
     {
-      mShader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER, (Shader::ShaderHints)(Shader::HINT_REQUIRES_SELF_DEPTH_TEST | Shader::HINT_MODIFIES_GEOMETRY) );
+      mShader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
     }
     else
     {
-      mShader = Shader::New( SIMPLE_VERTEX_SHADER, SIMPLE_FRAGMENT_SHADER, (Shader::ShaderHints)(Shader::HINT_REQUIRES_SELF_DEPTH_TEST | Shader::HINT_MODIFIES_GEOMETRY) );
+      mShader = Shader::New( SIMPLE_VERTEX_SHADER, SIMPLE_FRAGMENT_SHADER );
     }
   }
   else
   {
-    mShader = Shader::New( SIMPLE_VERTEX_SHADER, SIMPLE_FRAGMENT_SHADER, (Shader::ShaderHints)(Shader::HINT_REQUIRES_SELF_DEPTH_TEST | Shader::HINT_MODIFIES_GEOMETRY) );
+    mShader = Shader::New( SIMPLE_VERTEX_SHADER, SIMPLE_FRAGMENT_SHADER );
   }
 
   mTextureSet = TextureSet::New();
@@ -579,7 +580,7 @@ void Model3dView::CreateMaterial()
   {
     mRenderer.SetTextures( mTextureSet );
     mRenderer.SetShader( mShader );
-    mRenderer.SetProperty( Renderer::Property::FACE_CULLING_MODE, Renderer::NONE);
+    mRenderer.SetProperty( Renderer::Property::FACE_CULLING_MODE, FaceCullingMode::BACK );
   }
 
   UpdateShaderUniforms();
index dd9c25d..857032a 100644 (file)
@@ -589,8 +589,6 @@ Geometry ObjLoader::CreateGeometry( Toolkit::Model3dView::IlluminationType illum
     surface.SetIndexBuffer ( &indices[0], indices.Size() );
   }
 
-  surface.SetRequiresDepthTesting( true );
-
   vertices.Clear();
   verticesExt.Clear();
   indices.Clear();
index 2fea479..5104216 100644 (file)
@@ -320,6 +320,7 @@ void PageTurnView::Page::UseEffect(Shader newShader, Geometry geometry)
     }
 
     renderer.SetTextures( textureSet );
+    renderer.SetProperty( Renderer::Property::DEPTH_WRITE_MODE, DepthWriteMode::ON );
     actor.AddRenderer( renderer );
   }
 }
@@ -393,7 +394,6 @@ void PageTurnView::OnInitialize()
   uint16_t width = static_cast<uint16_t>(mPageSize.width / DEFAULT_GRID_DENSITY + 0.5f);
   uint16_t height = static_cast<uint16_t>(mPageSize.height / DEFAULT_GRID_DENSITY + 0.5f);
   mGeometry = RendererFactoryCache::CreateGridGeometry( Uint16Pair( width, height ) );
-  mGeometry.SetRequiresDepthTesting( true );
 
   mPages.reserve( NUMBER_OF_CACHED_PAGES );
   for( int i = 0; i < NUMBER_OF_CACHED_PAGES; i++ )
index 3594538..d765ac7 100644 (file)
@@ -150,7 +150,7 @@ void BorderRenderer::DoSetOnStage( Actor& actor )
   mBorderColorIndex = (mImpl->mRenderer).RegisterProperty( COLOR_NAME, mBorderColor );
   if( mBorderColor.a < 1.f || mAntiAliasing)
   {
-    mImpl->mRenderer.SetProperty( Renderer::Property::BLENDING_MODE, BlendingMode::ON );
+    mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
   }
   mBorderSizeIndex = (mImpl->mRenderer).RegisterProperty( SIZE_NAME, mBorderSize );
 }
@@ -187,7 +187,7 @@ void BorderRenderer::SetBorderColor(const Vector4& color)
     (mImpl->mRenderer).SetProperty( mBorderColorIndex, color );
     if( color.a < 1.f )
     {
-      mImpl->mRenderer.SetProperty( Renderer::Property::BLENDING_MODE, BlendingMode::ON );
+      mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
     }
   }
 }
@@ -213,7 +213,7 @@ void BorderRenderer::RequireAntiAliasing( bool antiAliasing )
       mImpl->mRenderer.SetShader( borderShader );
       if( mAntiAliasing )
       {
-        mImpl->mRenderer.SetProperty( Renderer::Property::BLENDING_MODE, BlendingMode::ON );
+        mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
       }
     }
   }
index c054a5e..c09f86f 100644 (file)
@@ -38,7 +38,7 @@ namespace Internal
 
 namespace
 {
-const char * const COLOR_NAME("blendColor");
+const char * const COLOR_NAME("mixColor");
 
 const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
   attribute mediump vec2 aPosition;\n
@@ -55,18 +55,18 @@ const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
 
 const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
   uniform lowp vec4 uColor;\n
-  uniform lowp vec4 blendColor;\n
+  uniform lowp vec4 mixColor;\n
   \n
   void main()\n
   {\n
-    gl_FragColor = blendColor*uColor;\n
+    gl_FragColor = mixColor*uColor;\n
   }\n
 );
 }
 
 ColorRenderer::ColorRenderer( RendererFactoryCache& factoryCache )
 : ControlRenderer( factoryCache ),
-  mBlendColorIndex( Property::INVALID_INDEX )
+  mMixColorIndex( Property::INVALID_INDEX )
 {
 }
 
@@ -77,7 +77,7 @@ ColorRenderer::~ColorRenderer()
 void ColorRenderer::DoInitialize( Actor& actor, const Property::Map& propertyMap )
 {
   Property::Value* color = propertyMap.Find( COLOR_NAME );
-  if( !( color && color->Get(mBlendColor) ) )
+  if( !( color && color->Get(mMixColor) ) )
   {
     DALI_LOG_ERROR( "Fail to provide a color to the ColorRenderer object" );
   }
@@ -111,7 +111,7 @@ void ColorRenderer::DoCreatePropertyMap( Property::Map& map ) const
 {
   map.Clear();
   map.Insert( RENDERER_TYPE, COLOR_RENDERER );
-  map.Insert( COLOR_NAME, mBlendColor );
+  map.Insert( COLOR_NAME, mMixColor );
 }
 
 void ColorRenderer::InitializeRenderer()
@@ -132,23 +132,23 @@ void ColorRenderer::InitializeRenderer()
 
   mImpl->mRenderer = Renderer::New( geometry, shader );
 
-  mBlendColorIndex = mImpl->mRenderer.RegisterProperty( COLOR_NAME, mBlendColor );
-  if( mBlendColor.a < 1.f )
+  mMixColorIndex = mImpl->mRenderer.RegisterProperty( COLOR_NAME, mMixColor );
+  if( mMixColor.a < 1.f )
   {
-    mImpl->mRenderer.SetProperty( Renderer::Property::BLENDING_MODE, BlendingMode::ON );
+    mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
   }
 }
 
 void ColorRenderer::SetColor(const Vector4& color)
 {
-  mBlendColor = color;
+  mMixColor = color;
 
   if( mImpl->mRenderer )
   {
-    (mImpl->mRenderer).SetProperty( mBlendColorIndex, color );
+    (mImpl->mRenderer).SetProperty( mMixColorIndex, color );
     if( color.a < 1.f )
     {
-      mImpl->mRenderer.SetProperty( Renderer::Property::BLENDING_MODE, BlendingMode::ON );
+      mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
     }
   }
 }
index 6d13204..d5c7a94 100644 (file)
@@ -37,7 +37,7 @@ namespace Internal
  *
  * | %Property Name  | Type        |
  * |-----------------|-------------|
- * | blendColor      | VECTOR4     |
+ * | mixColor        | VECTOR4     |
  */
 class ColorRenderer: public ControlRenderer
 {
@@ -113,8 +113,8 @@ private:
 
 private:
 
-  Vector4 mBlendColor;
-  Property::Index mBlendColorIndex;
+  Vector4 mMixColor;
+  Property::Index mMixColorIndex;
 
 };
 
index 9992bf5..df5a006 100644 (file)
@@ -47,9 +47,7 @@ const char * const CUSTOM_SHADER_HINTS( "hints" ); ///< type STRING for a hint f
 /**
  * where hints should be contain strings of the following shader hints:
  *   "none"                    | corresponds to HINT_NONE
- *   "requiresSelfDepthTest"   | corresponds to HINT_REQUIRES_SELF_DEPTH_TEST
  *   "outputIsTransparent"     | corresponds to HINT_OUTPUT_IS_TRANSPARENT
- *   "outputIsOpaque"          | corresponds to HINT_OUTPUT_IS_OPAQUE
  *   "modifiesGeometry"        | corresponds to HINT_MODIFIES_GEOMETRY
  */
 
@@ -59,18 +57,10 @@ Shader::ShaderHints HintFromString( std::string hintString )
   {
     return Shader::HINT_NONE;
   }
-  else if( hintString == "requiresSelfDepthTest" )
-  {
-    return Shader::HINT_REQUIRES_SELF_DEPTH_TEST;
-  }
   else if( hintString == "outputIsTransparent" )
   {
     return Shader::HINT_OUTPUT_IS_TRANSPARENT;
   }
-  else if( hintString == "outputIsOpaque" )
-  {
-    return Shader::HINT_OUTPUT_IS_OPAQUE;
-  }
   else if( hintString == "modifiesGeometry" )
   {
     return Shader::HINT_MODIFIES_GEOMETRY;
index eec8029..6b35829 100644 (file)
@@ -183,6 +183,7 @@ GradientRenderer::GradientRenderer( RendererFactoryCache& factoryCache )
 : ControlRenderer( factoryCache ),
   mGradientType( LINEAR )
 {
+  mImpl->mFlags |= Impl::IS_PREMULTIPLIED_ALPHA;
 }
 
 GradientRenderer::~GradientRenderer()
@@ -275,7 +276,17 @@ void GradientRenderer::DoCreatePropertyMap( Property::Map& map ) const
   for( unsigned int i=0; i<stops.Count(); i++ )
   {
     offsets.PushBack( stops[i].mOffset );
-    colors.PushBack( stops[i].mStopColor );
+    if( EqualsZero(stops[i].mStopColor.a) )
+    {
+      colors.PushBack( Vector4::ZERO );
+    }
+    else
+    {
+      colors.PushBack( Vector4( stops[i].mStopColor.r / stops[i].mStopColor.a,
+                                stops[i].mStopColor.g / stops[i].mStopColor.a,
+                                stops[i].mStopColor.b / stops[i].mStopColor.a,
+                                stops[i].mStopColor.a));
+    }
   }
 
   map.Insert( STOP_OFFSET_NAME, offsets );
@@ -381,7 +392,7 @@ bool GradientRenderer::NewGradient(Type gradientType, const Property::Map& prope
       {
         if( (colorArray->GetElementAt(i)).Get(color) )
         {
-          mGradient->AddStop( offsetArray[i], color);
+          mGradient->AddStop( offsetArray[i], Vector4(color.r*color.a, color.g*color.a, color.b*color.a, color.a));
           numValidStop++;
         }
       }
index 51f9a97..1f8302a 100644 (file)
@@ -637,12 +637,12 @@ std::string TextSelectionPopup::GetPressedImage() const
    mOrderListOfButtons.reserve( 8u );
 
    // Create button for each possible option using Option priority
-   mOrderListOfButtons.push_back( ButtonRequirement( Toolkit::TextSelectionPopup::CUT, mCutOptionPriority, OPTION_CUT, POPUP_CUT_STRING , mCutIconImage, ( mEnabledButtons & Toolkit::TextSelectionPopup::CUT)  ) );
-   mOrderListOfButtons.push_back( ButtonRequirement( Toolkit::TextSelectionPopup::COPY, mCopyOptionPriority, OPTION_COPY, POPUP_COPY_STRING, mCopyIconImage, ( mEnabledButtons & Toolkit::TextSelectionPopup::COPY)  ) );
-   mOrderListOfButtons.push_back( ButtonRequirement( Toolkit::TextSelectionPopup::PASTE, mPasteOptionPriority, OPTION_PASTE, POPUP_PASTE_STRING, mPasteIconImage, ( mEnabledButtons & Toolkit::TextSelectionPopup::PASTE)  ) );
-   mOrderListOfButtons.push_back( ButtonRequirement( Toolkit::TextSelectionPopup::SELECT, mSelectOptionPriority, OPTION_SELECT_WORD, POPUP_SELECT_STRING, mSelectIconImage, ( mEnabledButtons & Toolkit::TextSelectionPopup::SELECT)  ) );
-   mOrderListOfButtons.push_back( ButtonRequirement( Toolkit::TextSelectionPopup::SELECT_ALL, mSelectAllOptionPriority, OPTION_SELECT_ALL, POPUP_SELECT_ALL_STRING, mSelectAllIconImage, ( mEnabledButtons & Toolkit::TextSelectionPopup::SELECT_ALL)  ) );
-   mOrderListOfButtons.push_back( ButtonRequirement( Toolkit::TextSelectionPopup::CLIPBOARD, mClipboardOptionPriority, OPTION_CLIPBOARD, POPUP_CLIPBOARD_STRING, mClipboardIconImage, ( mEnabledButtons & Toolkit::TextSelectionPopup::CLIPBOARD)  ) );
+   mOrderListOfButtons.push_back( ButtonRequirement( Toolkit::TextSelectionPopup::CUT, mCutOptionPriority, OPTION_CUT, POPUP_CUT_STRING , mCutIconImage, 0 != ( mEnabledButtons & Toolkit::TextSelectionPopup::CUT)  ) );
+   mOrderListOfButtons.push_back( ButtonRequirement( Toolkit::TextSelectionPopup::COPY, mCopyOptionPriority, OPTION_COPY, POPUP_COPY_STRING, mCopyIconImage, 0 != ( mEnabledButtons & Toolkit::TextSelectionPopup::COPY)  ) );
+   mOrderListOfButtons.push_back( ButtonRequirement( Toolkit::TextSelectionPopup::PASTE, mPasteOptionPriority, OPTION_PASTE, POPUP_PASTE_STRING, mPasteIconImage, 0 != ( mEnabledButtons & Toolkit::TextSelectionPopup::PASTE)  ) );
+   mOrderListOfButtons.push_back( ButtonRequirement( Toolkit::TextSelectionPopup::SELECT, mSelectOptionPriority, OPTION_SELECT_WORD, POPUP_SELECT_STRING, mSelectIconImage, 0 != ( mEnabledButtons & Toolkit::TextSelectionPopup::SELECT)  ) );
+   mOrderListOfButtons.push_back( ButtonRequirement( Toolkit::TextSelectionPopup::SELECT_ALL, mSelectAllOptionPriority, OPTION_SELECT_ALL, POPUP_SELECT_ALL_STRING, mSelectAllIconImage, 0 != ( mEnabledButtons & Toolkit::TextSelectionPopup::SELECT_ALL)  ) );
+   mOrderListOfButtons.push_back( ButtonRequirement( Toolkit::TextSelectionPopup::CLIPBOARD, mClipboardOptionPriority, OPTION_CLIPBOARD, POPUP_CLIPBOARD_STRING, mClipboardIconImage, 0 != ( mEnabledButtons & Toolkit::TextSelectionPopup::CLIPBOARD)  ) );
 
    // Sort the buttons according their priorities.
    std::sort( mOrderListOfButtons.begin(), mOrderListOfButtons.end(), TextSelectionPopup::ButtonPriorityCompare() );
index c4d9a87..f9cc430 100644 (file)
@@ -138,8 +138,10 @@ void Clipper::Initialize( const Vector2& size )
 void Clipper::OnStageConnect( Dali::Actor actor )
 {
   Renderer renderer = mImageActor.GetRendererAt(0);
-  renderer.SetBlendFunc(BlendingFactor::ONE, BlendingFactor::ONE_MINUS_SRC_ALPHA,
-                        BlendingFactor::ONE, BlendingFactor::ONE);
+  renderer.SetProperty( Renderer::Property::BLEND_FACTOR_SRC_RGB,    BlendFactor::ONE );
+  renderer.SetProperty( Renderer::Property::BLEND_FACTOR_DEST_RGB,   BlendFactor::ONE_MINUS_SRC_ALPHA );
+  renderer.SetProperty( Renderer::Property::BLEND_FACTOR_SRC_ALPHA,  BlendFactor::ONE );
+  renderer.SetProperty( Renderer::Property::BLEND_FACTOR_DEST_ALPHA, BlendFactor::ONE );
 }
 
 Clipper::Clipper()
index 4182acd..89b6f5b 100644 (file)
@@ -807,6 +807,7 @@ struct LayoutEngine::Impl
           {
             // Need to add a new line with no characters but with height to increase the layoutSize.height
             LineRun newLine;
+            Initialize( newLine );
             lines.PushBack( newLine );
 
             UpdateTextLayout( layoutParameters,
@@ -1193,6 +1194,21 @@ struct LayoutEngine::Impl
     }
   }
 
+  void Initialize( LineRun& line )
+  {
+    line.glyphRun.glyphIndex = 0u;
+    line.glyphRun.numberOfGlyphs = 0u;
+    line.characterRun.characterIndex = 0u;
+    line.characterRun.numberOfCharacters = 0u;
+    line.width = 0.f;
+    line.ascender = 0.f;
+    line.descender = 0.f;
+    line.extraLength = 0.f;
+    line.alignmentOffset = 0.f;
+    line.direction = !RTL;
+    line.ellipsis = false;
+  }
+
   LayoutEngine::Layout mLayout;
   LayoutEngine::HorizontalAlignment mHorizontalAlignment;
   LayoutEngine::VerticalAlignment mVerticalAlignment;
index b64ae2b..0d8cf5a 100644 (file)
@@ -78,174 +78,220 @@ CharacterDirection LogicalModel::GetCharacterDirection( CharacterIndex character
   return *( mCharacterDirections.Begin() + characterIndex );
 }
 
-void LogicalModel::SetVisualToLogicalMap( CharacterIndex startIndex,
-                                          Length numberOfCharacters )
+CharacterIndex LogicalModel::GetLogicalCursorIndex( CharacterIndex visualCursorIndex )
 {
-  mVisualToLogicalMap.Resize( numberOfCharacters );
+  // The total number of characters.
+  const Length numberOfCharacters = mText.Count();
 
-  CharacterIndex* modelVisualToLogicalMapBuffer = mVisualToLogicalMap.Begin();
+  const bool fetch = FetchBidirectionalLineInfo( visualCursorIndex );
+  if( !fetch )
+  {
+    // The character is not inside a bidi line.
+    return visualCursorIndex;
+  }
 
-  const BidirectionalLineInfoRun* const bidirectionalInfo = mBidirectionalLineInfo.Begin();
-  const Length numberOfRuns = mBidirectionalLineInfo.Count();
+  // The character's directions buffer.
+  const CharacterDirection* const modelCharacterDirections = mCharacterDirections.Begin();
 
-  CharacterIndex lastIndex = startIndex;
-  for( unsigned int bidiIndex = 0u; bidiIndex < numberOfRuns; ++bidiIndex )
-  {
-    const BidirectionalLineInfoRun& bidiLineInfo = *( bidirectionalInfo + bidiIndex );
+  // The bidirectional line info.
+  const BidirectionalLineInfoRun* const bidirectionalLineInfo = mBidirectionalLineInfo.Begin() + mBidirectionalLineIndex;
 
-    if( bidiLineInfo.characterRun.characterIndex + bidiLineInfo.characterRun.numberOfCharacters <= startIndex )
-    {
-      // Skip this paragraph. It has been already processed.
-      continue;
-    }
+  // Whether the paragraph starts with a right to left character.
+  const bool isRightToLeftParagraph = bidirectionalLineInfo->direction;
 
-    if( lastIndex < bidiLineInfo.characterRun.characterIndex )
+  CharacterIndex logicalCursorIndex = 0u;
+
+  if( 0u == visualCursorIndex )
+  {
+    if( isRightToLeftParagraph )
     {
-      // Fill with the identity.
-      for( ; lastIndex < bidiLineInfo.characterRun.characterIndex; ++lastIndex )
-      {
-        *( modelVisualToLogicalMapBuffer + lastIndex ) = lastIndex;
-      }
+      logicalCursorIndex = numberOfCharacters;
     }
-
-    // Fill the conversion table of the run.
-    for( CharacterIndex index = 0u;
-         index < bidiLineInfo.characterRun.numberOfCharacters;
-         ++index, ++lastIndex )
+    else // else logical position is zero.
     {
-      *( modelVisualToLogicalMapBuffer + lastIndex ) = bidiLineInfo.characterRun.characterIndex + *( bidiLineInfo.visualToLogicalMap + index );
+      logicalCursorIndex = 0u;
     }
   }
-
-  // Complete with the identity if there are some left to right characters after the last right to left.
-  for( ; lastIndex < numberOfCharacters; ++lastIndex )
+  else if( numberOfCharacters == visualCursorIndex )
   {
-    *( modelVisualToLogicalMapBuffer + lastIndex ) = lastIndex;
-  }
-
-  // Sets the visual to logical conversion map for cursor positions.
-  const Length numberOfCharactersPlusOne = numberOfCharacters + 1u;
-  mVisualToLogicalCursorMap.Resize( numberOfCharactersPlusOne );
-
-  CharacterIndex* modelVisualToLogicalCursorMap = mVisualToLogicalCursorMap.Begin();
-
-  const Length numberOfBidirectionalParagraphs = mBidirectionalParagraphInfo.Count();
-  BidirectionalParagraphInfoRun* bidirectionalParagraphInfoBuffer = mBidirectionalParagraphInfo.Begin();
-  BidirectionalParagraphInfoRun* bidirectionalParagraph = bidirectionalParagraphInfoBuffer;
-
-  const CharacterDirection* const modelCharacterDirections = mCharacterDirections.Begin();
-
-  Length bidirectionalParagraphIndex = 0u;
-  bool isRightToLeftParagraph = false;
-  for( CharacterIndex index = startIndex; index < numberOfCharactersPlusOne; ++index )
-  {
-    if( bidirectionalParagraph &&
-        ( bidirectionalParagraph->characterRun.characterIndex == index ) )
+    if( isRightToLeftParagraph )
     {
-      isRightToLeftParagraph = *( modelCharacterDirections + index );
+      logicalCursorIndex = 0u;
     }
-
-    if( 0u == index )
+    else // else logical position is the number of characters.
     {
-      if( isRightToLeftParagraph )
-      {
-        *( modelVisualToLogicalCursorMap + index ) = numberOfCharacters;
-      }
-      else // else logical position is zero.
-      {
-        *( modelVisualToLogicalCursorMap + index ) = 0u;
-      }
+      logicalCursorIndex = numberOfCharacters;
     }
-    else if( numberOfCharacters == index )
+  }
+  else
+  {
+    // Get the character indexed by  index - 1 and index
+    // and calculate the logical position according the directions of
+    // both characters and the direction of the paragraph.
+
+    const CharacterIndex previousVisualCursorIndex = visualCursorIndex - 1u;
+    const CharacterIndex previousLogicalCursorIndex = *( bidirectionalLineInfo->visualToLogicalMap + previousVisualCursorIndex - bidirectionalLineInfo->characterRun.characterIndex ) + bidirectionalLineInfo->characterRun.characterIndex;
+    const CharacterIndex currentLogicalCursorIndex = *( bidirectionalLineInfo->visualToLogicalMap + visualCursorIndex - bidirectionalLineInfo->characterRun.characterIndex ) + bidirectionalLineInfo->characterRun.characterIndex;
+
+    const CharacterDirection previousCharacterDirection = *( modelCharacterDirections + previousLogicalCursorIndex );
+    const CharacterDirection currentCharacterDirection = *( modelCharacterDirections + currentLogicalCursorIndex );
+
+    if( previousCharacterDirection == currentCharacterDirection )
     {
-      if( isRightToLeftParagraph )
+      // Both glyphs have the same direction.
+      if( previousCharacterDirection )
       {
-        *( modelVisualToLogicalCursorMap + index ) = 0u;
+        logicalCursorIndex = previousLogicalCursorIndex;
       }
-      else // else logical position is the number of characters.
+      else
       {
-        *( modelVisualToLogicalCursorMap + index ) = numberOfCharacters;
+        logicalCursorIndex = currentLogicalCursorIndex;
       }
     }
     else
     {
-      // Get the character indexed by  index - 1 and index
-      // and calculate the logical position according the directions of
-      // both characters and the direction of the paragraph.
-
-      const CharacterIndex previousIndex = index - 1u;
-      const CharacterIndex logicalPosition0 = *( modelVisualToLogicalMapBuffer + previousIndex );
-      const CharacterIndex logicalPosition1 = *( modelVisualToLogicalMapBuffer + index );
-
-      const CharacterDirection direction0 = *( modelCharacterDirections + logicalPosition0 );
-      const CharacterDirection direction1 = *( modelCharacterDirections + logicalPosition1 );
-
-      if( direction0 == direction1 )
+      if( isRightToLeftParagraph )
       {
-        // Both glyphs have the same direction.
-        if( direction0 )
+        if( currentCharacterDirection )
         {
-          *( modelVisualToLogicalCursorMap + index ) = logicalPosition0;
+          logicalCursorIndex = currentLogicalCursorIndex + 1u;
         }
         else
         {
-          *( modelVisualToLogicalCursorMap + index ) = logicalPosition1;
+          logicalCursorIndex = previousLogicalCursorIndex;
         }
       }
       else
       {
-        if( isRightToLeftParagraph )
+        if( previousCharacterDirection )
         {
-          if( direction1 )
-          {
-            *( modelVisualToLogicalCursorMap + index ) = logicalPosition1 + 1u;
-          }
-          else
-          {
-            *( modelVisualToLogicalCursorMap + index ) = logicalPosition0;
-          }
+          logicalCursorIndex = currentLogicalCursorIndex;
         }
         else
         {
-          if( direction0 )
-          {
-            *( modelVisualToLogicalCursorMap + index ) = logicalPosition1;
-          }
-          else
-          {
-            *( modelVisualToLogicalCursorMap + index ) = logicalPosition0 + 1u;
-          }
+          logicalCursorIndex = previousLogicalCursorIndex + 1u;
         }
       }
     }
+  }
+
+  return logicalCursorIndex;
+}
 
-    if( bidirectionalParagraph &&
-        ( bidirectionalParagraph->characterRun.characterIndex + bidirectionalParagraph->characterRun.numberOfCharacters == index ) )
+CharacterIndex LogicalModel::GetLogicalCharacterIndex( CharacterIndex visualCharacterIndex )
+{
+  const bool fetch = FetchBidirectionalLineInfo( visualCharacterIndex );
+  if( !fetch )
+  {
+    // The character is not inside a bidi line.
+    return visualCharacterIndex;
+  }
+
+  // The bidirectional line info.
+  const BidirectionalLineInfoRun* const bidirectionalLineInfo = mBidirectionalLineInfo.Begin() + mBidirectionalLineIndex;
+
+  return *( bidirectionalLineInfo->visualToLogicalMap + visualCharacterIndex - bidirectionalLineInfo->characterRun.characterIndex ) + bidirectionalLineInfo->characterRun.characterIndex;
+}
+
+bool LogicalModel::FetchBidirectionalLineInfo( CharacterIndex characterIndex )
+{
+  // The number of bidirectional lines.
+  const Length numberOfBidirectionalLines = mBidirectionalLineInfo.Count();
+
+  if( 0u == numberOfBidirectionalLines )
+  {
+    // If there is no bidirectional info.
+    return false;
+  }
+
+  // Find the bidi line where the character is laid-out.
+
+  const BidirectionalLineInfoRun* const bidirectionalLineInfoBuffer = mBidirectionalLineInfo.Begin();
+
+  // Check first if the character is in the previously fetched line.
+
+  BidirectionalLineRunIndex bidiLineIndex = 0u;
+  CharacterIndex lastCharacterOfRightToLeftRun = 0u;
+  if( mBidirectionalLineIndex < numberOfBidirectionalLines )
+  {
+    const BidirectionalLineInfoRun& bidiLineRun = *( bidirectionalLineInfoBuffer + mBidirectionalLineIndex );
+
+    // Whether the character index is just after the last one. i.e The cursor position after the last character.
+    const bool isLastIndex = characterIndex == mText.Count();
+
+    const CharacterIndex lastCharacterOfRunPlusOne = bidiLineRun.characterRun.characterIndex + bidiLineRun.characterRun.numberOfCharacters;
+    if( ( bidiLineRun.characterRun.characterIndex <= characterIndex ) &&
+        ( ( characterIndex < lastCharacterOfRunPlusOne ) || ( isLastIndex && ( characterIndex == lastCharacterOfRunPlusOne ) ) ) )
+    {
+      // The character is in the previously fetched bidi line.
+      return true;
+    }
+    else
     {
-      isRightToLeftParagraph = false;
-      ++bidirectionalParagraphIndex;
-      if( bidirectionalParagraphIndex < numberOfBidirectionalParagraphs )
+      // The character is not in the previously fetched line.
+
+      if( isLastIndex )
       {
-        bidirectionalParagraph = bidirectionalParagraphInfoBuffer + bidirectionalParagraphIndex;
+        // The given index is one after the last character, so it's not in a bidi line.
+        // Check if it's just after the last bidi line.
+        const BidirectionalLineRunIndex lastBidiLineIndex = numberOfBidirectionalLines - 1u;
+        const BidirectionalLineInfoRun& bidiLineRun = *( bidirectionalLineInfoBuffer + lastBidiLineIndex );
+
+        if( characterIndex == bidiLineRun.characterRun.characterIndex + bidiLineRun.characterRun.numberOfCharacters )
+        {
+          // The character is in the last bidi line.
+          mBidirectionalLineIndex = lastBidiLineIndex;
+          return true;
+        }
+      }
+
+      // Set the bidi line index from where to start the fetch.
+
+      if( characterIndex < bidiLineRun.characterRun.characterIndex )
+      {
+        // Start the fetch from the beginning.
+        bidiLineIndex = 0u;
       }
       else
       {
-        bidirectionalParagraph = NULL;
+        // Start the fetch from the next line.
+        bidiLineIndex = mBidirectionalLineIndex + 1u;
+        lastCharacterOfRightToLeftRun = lastCharacterOfRunPlusOne - 1u;
       }
     }
   }
-}
 
-CharacterIndex LogicalModel::GetLogicalCharacterIndex( CharacterIndex visualCharacterIndex ) const
-{
-  if( 0u == mVisualToLogicalMap.Count() )
+  // The character has not been found in the previously fetched bidi line.
+  for( Vector<BidirectionalLineInfoRun>::ConstIterator it = bidirectionalLineInfoBuffer + bidiLineIndex,
+         endIt = mBidirectionalLineInfo.End();
+       it != endIt;
+       ++it, ++bidiLineIndex )
   {
-    // If there is no visual to logical info is because the whole text is left to right.
-    // Return the identity.
-    return visualCharacterIndex;
+    const BidirectionalLineInfoRun& bidiLineRun = *it;
+
+    if( ( lastCharacterOfRightToLeftRun < characterIndex ) && ( characterIndex < bidiLineRun.characterRun.characterIndex ) )
+    {
+      // The character is not inside a bidi line.
+      return false;
+    }
+
+    const CharacterIndex lastCharacterOfRunPlusOne = bidiLineRun.characterRun.characterIndex + bidiLineRun.characterRun.numberOfCharacters;
+    lastCharacterOfRightToLeftRun = lastCharacterOfRunPlusOne - 1u;
+    if( ( bidiLineRun.characterRun.characterIndex <= characterIndex ) &&
+        ( characterIndex < lastCharacterOfRunPlusOne ) )
+    {
+      // Bidi line found. Fetch the line.
+      mBidirectionalLineIndex = bidiLineIndex;
+      return true;
+    }
   }
 
-  return *( mVisualToLogicalMap.Begin() + visualCharacterIndex );
+  return false;
+}
+
+BidirectionalLineRunIndex LogicalModel::GetBidirectionalLineInfo() const
+{
+  return mBidirectionalLineIndex;
 }
 
 void LogicalModel::UpdateTextStyleRuns( CharacterIndex index, int numberOfCharacters )
@@ -541,6 +587,7 @@ LogicalModel::~LogicalModel()
 }
 
 LogicalModel::LogicalModel()
+: mBidirectionalLineIndex( 0u )
 {
 }
 
index 089af8e..6ff820d 100644 (file)
@@ -89,17 +89,13 @@ public:
   // Visual <--> Logical conversion tables.
 
   /**
-   * @brief Sets the visual to logical and the logical to visual map tables.
+   * @brief Retrieves the logical cursor index for the given visual cursor index.
    *
-   * Replaces any map tables previously set.
+   * @param[in] visualCursorIndex The visual cursor index.
    *
-   * @note If the number of runs is zero the bidirectional info buffer is cleared.
-   *
-   * @param[in] startIndex Character index from where the conversion tables are set.
-   * @param[in] numberOfCharacters The number of characters.
+   * @return The logical cursor index.
    */
-  void SetVisualToLogicalMap( CharacterIndex startIndex,
-                              Length numberOfCharacters );
+  CharacterIndex GetLogicalCursorIndex( CharacterIndex visualCursorIndex );
 
   /**
    * @brief Retrieves the logical character index for the given visual character index.
@@ -108,7 +104,25 @@ public:
    *
    * @return The logical character index.
    */
-  CharacterIndex GetLogicalCharacterIndex( CharacterIndex visualCharacterIndex ) const;
+  CharacterIndex GetLogicalCharacterIndex( CharacterIndex visualCharacterIndex );
+
+  /**
+   * @brief Fetch the bidirectional line info for the given character.
+   *
+   * Call GetBidirectionalLineInfo() to retrieve the last fetched line.
+   *
+   * @param[in] characterIndex The character index.
+   *
+   * @return @e true if the given @e character is in a bidirectional line.
+   */
+  bool FetchBidirectionalLineInfo( CharacterIndex characterIndex );
+
+  /**
+   * @brief Retrieves the last fetched bidirectional line info.
+   *
+   * @return The index of the bidirectional line info.
+   */
+  BidirectionalLineRunIndex GetBidirectionalLineInfo() const;
 
   // Text style.
 
@@ -188,10 +202,10 @@ public:
   Vector<WordBreakInfo>                 mWordBreakInfo;
   Vector<ParagraphRun>                  mParagraphInfo;
   Vector<BidirectionalParagraphInfoRun> mBidirectionalParagraphInfo;
-  Vector<CharacterDirection>            mCharacterDirections;        ///< For each character, whether is right to left. ( @e flase is left to right, @e true right to left ).
+  Vector<CharacterDirection>            mCharacterDirections;              ///< For each character, whether is right to left. ( @e flase is left to right, @e true right to left ).
   Vector<BidirectionalLineInfoRun>      mBidirectionalLineInfo;
-  Vector<CharacterIndex>                mVisualToLogicalMap;         ///< Bidirectional visual to logical conversion table.
-  Vector<CharacterIndex>                mVisualToLogicalCursorMap;   ///< Bidirectional visual to logical cursor conversion table.
+
+  BidirectionalLineRunIndex             mBidirectionalLineIndex;           ///< The last fetched bidirectional line info.
 };
 
 } // namespace Text
index f8ecde3..6ea6352 100644 (file)
@@ -102,6 +102,28 @@ struct StyleStack
 };
 
 /**
+ * @brief Initializes a font run description to its defaults.
+ *
+ * @param[in,out] fontRun The font description run to initialize.
+ */
+void Initialize( FontDescriptionRun& fontRun )
+{
+  fontRun.characterRun.characterIndex = 0u;
+  fontRun.characterRun.numberOfCharacters = 0u;
+  fontRun.familyName = NULL;
+  fontRun.familyLength = 0u;
+  fontRun.weight = TextAbstraction::FontWeight::NORMAL;
+  fontRun.width = TextAbstraction::FontWidth::NORMAL;
+  fontRun.slant = TextAbstraction::FontSlant::NORMAL;
+  fontRun.size = 0u;
+  fontRun.familyDefined = false;
+  fontRun.weightDefined = false;
+  fontRun.widthDefined = false;
+  fontRun.slantDefined = false;
+  fontRun.sizeDefined = false;
+}
+
+/**
  * @brief Splits the tag string into the tag name and its attributes.
  *
  * The attributes are stored in a vector in the tag.
@@ -399,18 +421,12 @@ void ProcessMarkupString( const std::string& markupString, MarkupProcessData& ma
         {
           // Create a new font run.
           FontDescriptionRun fontRun;
-          fontRun.characterRun.numberOfCharacters = 0u;
+          Initialize( fontRun );
 
           // Fill the run with the parameters.
           fontRun.characterRun.characterIndex = characterIndex;
           fontRun.slant = TextAbstraction::FontSlant::ITALIC;
-
-          fontRun.familyName = NULL;
-          fontRun.familyDefined = false;
-          fontRun.weightDefined = false;
-          fontRun.widthDefined = false;
           fontRun.slantDefined = true;
-          fontRun.sizeDefined = false;
 
           // Push the font run in the logical model.
           markupProcessData.fontRuns.PushBack( fontRun );
@@ -445,19 +461,12 @@ void ProcessMarkupString( const std::string& markupString, MarkupProcessData& ma
         {
           // Create a new font run.
           FontDescriptionRun fontRun;
-          fontRun.characterRun.numberOfCharacters = 0u;
+          Initialize( fontRun );
 
           // Fill the run with the parameters.
           fontRun.characterRun.characterIndex = characterIndex;
-
           fontRun.weight = TextAbstraction::FontWeight::BOLD;
-
-          fontRun.familyName = NULL;
-          fontRun.familyDefined = false;
           fontRun.weightDefined = true;
-          fontRun.widthDefined = false;
-          fontRun.slantDefined = false;
-          fontRun.sizeDefined = false;
 
           // Push the font run in the logical model.
           markupProcessData.fontRuns.PushBack( fontRun );
@@ -481,18 +490,11 @@ void ProcessMarkupString( const std::string& markupString, MarkupProcessData& ma
         {
           // Create a new font run.
           FontDescriptionRun fontRun;
-          fontRun.characterRun.numberOfCharacters = 0u;
+          Initialize( fontRun );
 
           // Fill the run with the parameters.
           fontRun.characterRun.characterIndex = characterIndex;
 
-          fontRun.familyName = NULL;
-          fontRun.familyDefined = false;
-          fontRun.weightDefined = false;
-          fontRun.widthDefined = false;
-          fontRun.slantDefined = false;
-          fontRun.sizeDefined = false;
-
           ProcessFontTag( tag, fontRun );
 
           // Push the font run in the logical model.
index 966deff..2db0faa 100644 (file)
@@ -493,7 +493,7 @@ struct AtlasRenderer::Impl
     Shader shader( mGlyphManager.GetShader( meshRecord.mAtlasId ) );
     Dali::Renderer renderer = Dali::Renderer::New( quadGeometry, shader );
     renderer.SetTextures( textureSet );
-    renderer.SetProperty( Dali::Renderer::Property::BLENDING_MODE, BlendingMode::ON );
+    renderer.SetProperty( Dali::Renderer::Property::BLEND_MODE, BlendMode::ON );
     renderer.SetProperty( Dali::Renderer::Property::DEPTH_INDEX, DepthIndex::CONTENT + mDepth );
     Actor actor = Actor::New();
 #if defined(DEBUG_ENABLED)
index 56820ae..d863268 100644 (file)
@@ -300,17 +300,17 @@ void Controller::Impl::CalculateTextUpdateIndices( Length& numberOfCharacters )
   }
   else
   {
-    CharacterIndex lastIndex = 0u;
+    Length numberOfCharactersToUpdate = 0u;
     if( mTextUpdateInfo.mFullRelayoutNeeded )
     {
-      lastIndex = mTextUpdateInfo.mPreviousNumberOfCharacters;
+      numberOfCharactersToUpdate = mTextUpdateInfo.mPreviousNumberOfCharacters;
     }
     else
     {
-      lastIndex = ( mTextUpdateInfo.mNumberOfCharactersToRemove > 0u ) ? mTextUpdateInfo.mNumberOfCharactersToRemove : 1u;
+      numberOfCharactersToUpdate = ( mTextUpdateInfo.mNumberOfCharactersToRemove > 0u ) ? mTextUpdateInfo.mNumberOfCharactersToRemove : 1u;
     }
     mLogicalModel->FindParagraphs( mTextUpdateInfo.mCharacterIndex,
-                                   lastIndex,
+                                   numberOfCharactersToUpdate,
                                    paragraphsToBeUpdated );
   }
 
@@ -345,36 +345,36 @@ void Controller::Impl::CalculateTextUpdateIndices( Length& numberOfCharacters )
 
 void Controller::Impl::ClearFullModelData( OperationsMask operations )
 {
-  if( GET_LINE_BREAKS & operations )
+  if( NO_OPERATION != ( GET_LINE_BREAKS & operations ) )
   {
     mLogicalModel->mLineBreakInfo.Clear();
     mLogicalModel->mParagraphInfo.Clear();
   }
 
-  if( GET_WORD_BREAKS & operations )
+  if( NO_OPERATION != ( GET_WORD_BREAKS & operations ) )
   {
     mLogicalModel->mLineBreakInfo.Clear();
   }
 
-  if( GET_SCRIPTS & operations )
+  if( NO_OPERATION != ( GET_SCRIPTS & operations ) )
   {
     mLogicalModel->mScriptRuns.Clear();
   }
 
-  if( VALIDATE_FONTS & operations )
+  if( NO_OPERATION != ( VALIDATE_FONTS & operations ) )
   {
     mLogicalModel->mFontRuns.Clear();
   }
 
   if( 0u != mLogicalModel->mBidirectionalParagraphInfo.Count() )
   {
-    if( BIDI_INFO & operations )
+    if( NO_OPERATION != ( BIDI_INFO & operations ) )
     {
       mLogicalModel->mBidirectionalParagraphInfo.Clear();
       mLogicalModel->mCharacterDirections.Clear();
     }
 
-    if( REORDER & operations )
+    if( NO_OPERATION != ( REORDER & operations ) )
     {
       // Free the allocated memory used to store the conversion table in the bidirectional line info run.
       for( Vector<BidirectionalLineInfoRun>::Iterator it = mLogicalModel->mBidirectionalLineInfo.Begin(),
@@ -388,12 +388,10 @@ void Controller::Impl::ClearFullModelData( OperationsMask operations )
         bidiLineInfo.visualToLogicalMap = NULL;
       }
       mLogicalModel->mBidirectionalLineInfo.Clear();
-
-      mLogicalModel->mVisualToLogicalMap.Clear();
     }
   }
 
-  if( SHAPE_TEXT & operations )
+  if( NO_OPERATION != ( SHAPE_TEXT & operations ) )
   {
     mVisualModel->mGlyphs.Clear();
     mVisualModel->mGlyphsToCharacters.Clear();
@@ -403,12 +401,12 @@ void Controller::Impl::ClearFullModelData( OperationsMask operations )
     mVisualModel->mGlyphPositions.Clear();
   }
 
-  if( LAYOUT & operations )
+  if( NO_OPERATION != ( LAYOUT & operations ) )
   {
     mVisualModel->mLines.Clear();
   }
 
-  if( COLOR & operations )
+  if( NO_OPERATION != ( COLOR & operations ) )
   {
     mVisualModel->mColorIndices.Clear();
   }
@@ -418,7 +416,7 @@ void Controller::Impl::ClearCharacterModelData( CharacterIndex startIndex, Chara
 {
   const CharacterIndex endIndexPlusOne = endIndex + 1u;
 
-  if( GET_LINE_BREAKS & operations )
+  if( NO_OPERATION != ( GET_LINE_BREAKS & operations ) )
   {
     // Clear the line break info.
     LineBreakInfo* lineBreakInfoBuffer = mLogicalModel->mLineBreakInfo.Begin();
@@ -432,7 +430,7 @@ void Controller::Impl::ClearCharacterModelData( CharacterIndex startIndex, Chara
                         mLogicalModel->mParagraphInfo );
   }
 
-  if( GET_WORD_BREAKS & operations )
+  if( NO_OPERATION != ( GET_WORD_BREAKS & operations ) )
   {
     // Clear the word break info.
     WordBreakInfo* wordBreakInfoBuffer = mLogicalModel->mWordBreakInfo.Begin();
@@ -441,7 +439,7 @@ void Controller::Impl::ClearCharacterModelData( CharacterIndex startIndex, Chara
                                          wordBreakInfoBuffer + endIndexPlusOne );
   }
 
-  if( GET_SCRIPTS & operations )
+  if( NO_OPERATION != ( GET_SCRIPTS & operations ) )
   {
     // Clear the scripts.
     ClearCharacterRuns( startIndex,
@@ -449,7 +447,7 @@ void Controller::Impl::ClearCharacterModelData( CharacterIndex startIndex, Chara
                         mLogicalModel->mScriptRuns );
   }
 
-  if( VALIDATE_FONTS & operations )
+  if( NO_OPERATION != ( VALIDATE_FONTS & operations ) )
   {
     // Clear the fonts.
     ClearCharacterRuns( startIndex,
@@ -459,7 +457,7 @@ void Controller::Impl::ClearCharacterModelData( CharacterIndex startIndex, Chara
 
   if( 0u != mLogicalModel->mBidirectionalParagraphInfo.Count() )
   {
-    if( BIDI_INFO & operations )
+    if( NO_OPERATION != ( BIDI_INFO & operations ) )
     {
       // Clear the bidirectional paragraph info.
       ClearCharacterRuns( startIndex,
@@ -473,7 +471,7 @@ void Controller::Impl::ClearCharacterModelData( CharacterIndex startIndex, Chara
                                                  characterDirectionsBuffer + endIndexPlusOne );
     }
 
-    if( REORDER & operations )
+    if( NO_OPERATION != ( REORDER & operations ) )
     {
       uint32_t startRemoveIndex = mLogicalModel->mBidirectionalLineInfo.Count();
       uint32_t endRemoveIndex = startRemoveIndex;
@@ -499,10 +497,6 @@ void Controller::Impl::ClearCharacterModelData( CharacterIndex startIndex, Chara
 
       mLogicalModel->mBidirectionalLineInfo.Erase( bidirectionalLineInfoBuffer + startRemoveIndex,
                                                    bidirectionalLineInfoBuffer + endRemoveIndex );
-
-      CharacterIndex* visualToLogicalMapBuffer = mLogicalModel->mVisualToLogicalMap.Begin();
-      mLogicalModel->mVisualToLogicalMap.Erase( visualToLogicalMapBuffer + startIndex,
-                                                visualToLogicalMapBuffer + endIndexPlusOne );
     }
   }
 }
@@ -519,7 +513,7 @@ void Controller::Impl::ClearGlyphModelData( CharacterIndex startIndex, Character
   const GlyphIndex endGlyphIndexPlusOne = *( charactersToGlyphBuffer + endIndex ) + *( glyphsPerCharacterBuffer + endIndex );
   const Length numberOfGlyphsRemoved = endGlyphIndexPlusOne - mTextUpdateInfo.mStartGlyphIndex;
 
-  if( SHAPE_TEXT & operations )
+  if( NO_OPERATION != ( SHAPE_TEXT & operations ) )
   {
     // Update the character to glyph indices.
     for( Vector<GlyphIndex>::Iterator it =  charactersToGlyphBuffer + endIndexPlusOne,
@@ -571,7 +565,7 @@ void Controller::Impl::ClearGlyphModelData( CharacterIndex startIndex, Character
                                          positionsBuffer + endGlyphIndexPlusOne );
   }
 
-  if( LAYOUT & operations )
+  if( NO_OPERATION != ( LAYOUT & operations ) )
   {
     // Clear the lines.
     uint32_t startRemoveIndex = mVisualModel->mLines.Count();
@@ -599,7 +593,7 @@ void Controller::Impl::ClearGlyphModelData( CharacterIndex startIndex, Character
                                 linesBuffer + endRemoveIndex );
   }
 
-  if( COLOR & operations )
+  if( NO_OPERATION != ( COLOR & operations ) )
   {
     if( 0u != mVisualModel->mColorIndices.Count() )
     {
@@ -672,7 +666,7 @@ bool Controller::Impl::UpdateModel( OperationsMask operationsRequired )
   Vector<LineBreakInfo>& lineBreakInfo = mLogicalModel->mLineBreakInfo;
   const Length requestedNumberOfCharacters = mTextUpdateInfo.mRequestedNumberOfCharacters;
 
-  if( GET_LINE_BREAKS & operations )
+  if( NO_OPERATION != ( GET_LINE_BREAKS & operations ) )
   {
     // Retrieves the line break info. The line break info is used to split the text in 'paragraphs' to
     // calculate the bidirectional info for each 'paragraph'.
@@ -692,7 +686,7 @@ bool Controller::Impl::UpdateModel( OperationsMask operationsRequired )
   }
 
   Vector<WordBreakInfo>& wordBreakInfo = mLogicalModel->mWordBreakInfo;
-  if( GET_WORD_BREAKS & operations )
+  if( NO_OPERATION != ( GET_WORD_BREAKS & operations ) )
   {
     // Retrieves the word break info. The word break info is used to layout the text (where to wrap the text in lines).
     wordBreakInfo.Resize( numberOfCharacters, TextAbstraction::WORD_NO_BREAK );
@@ -704,8 +698,8 @@ bool Controller::Impl::UpdateModel( OperationsMask operationsRequired )
     updated = true;
   }
 
-  const bool getScripts = GET_SCRIPTS & operations;
-  const bool validateFonts = VALIDATE_FONTS & operations;
+  const bool getScripts = NO_OPERATION != ( GET_SCRIPTS & operations );
+  const bool validateFonts = NO_OPERATION != ( VALIDATE_FONTS & operations );
 
   Vector<ScriptRun>& scripts = mLogicalModel->mScriptRuns;
   Vector<FontRun>& validFonts = mLogicalModel->mFontRuns;
@@ -749,7 +743,7 @@ bool Controller::Impl::UpdateModel( OperationsMask operationsRequired )
   Vector<Character> mirroredUtf32Characters;
   bool textMirrored = false;
   const Length numberOfParagraphs = mLogicalModel->mParagraphInfo.Count();
-  if( BIDI_INFO & operations )
+  if( NO_OPERATION != ( BIDI_INFO & operations ) )
   {
     Vector<BidirectionalParagraphInfoRun>& bidirectionalInfo = mLogicalModel->mBidirectionalParagraphInfo;
     bidirectionalInfo.Reserve( numberOfParagraphs );
@@ -797,7 +791,7 @@ bool Controller::Impl::UpdateModel( OperationsMask operationsRequired )
   newParagraphGlyphs.Reserve( numberOfParagraphs );
 
   const Length currentNumberOfGlyphs = glyphs.Count();
-  if( SHAPE_TEXT & operations )
+  if( NO_OPERATION != ( SHAPE_TEXT & operations ) )
   {
     const Vector<Character>& textToShape = textMirrored ? mirroredUtf32Characters : utf32Characters;
     // Shapes the text.
@@ -821,7 +815,7 @@ bool Controller::Impl::UpdateModel( OperationsMask operationsRequired )
 
   const Length numberOfGlyphs = glyphs.Count() - currentNumberOfGlyphs;
 
-  if( GET_GLYPH_METRICS & operations )
+  if( NO_OPERATION != ( GET_GLYPH_METRICS & operations ) )
   {
     GlyphInfo* glyphsBuffer = glyphs.Begin();
     mMetrics->GetGlyphMetrics( glyphsBuffer + mTextUpdateInfo.mStartGlyphIndex, numberOfGlyphs );
@@ -839,7 +833,7 @@ bool Controller::Impl::UpdateModel( OperationsMask operationsRequired )
     updated = true;
   }
 
-  if( COLOR & operationsRequired )
+  if( NO_OPERATION != ( COLOR & operationsRequired ) )
   {
     // Set the color runs in glyphs.
     SetColorSegmentationInfo( mLogicalModel->mColorRuns,
@@ -1939,10 +1933,6 @@ CharacterIndex Controller::Impl::GetClosestCursorIndex( float visualX,
   const Vector<Vector2>& positions = mVisualModel->mGlyphPositions;
   const Vector2* const positionsBuffer = positions.Begin();
 
-  // Get the visual to logical conversion tables.
-  const CharacterIndex* const visualToLogicalBuffer = ( 0u != mLogicalModel->mVisualToLogicalMap.Count() ) ? mLogicalModel->mVisualToLogicalMap.Begin() : NULL;
-  const CharacterIndex* const visualToLogicalCursorBuffer = mLogicalModel->mVisualToLogicalCursorMap.Begin();
-
   // Get the character to glyph conversion table.
   const GlyphIndex* const charactersToGlyphBuffer = mVisualModel->mCharactersToGlyph.Begin();
 
@@ -1952,9 +1942,6 @@ CharacterIndex Controller::Impl::GetClosestCursorIndex( float visualX,
   // Get the glyph's info buffer.
   const GlyphInfo* const glyphInfoBuffer = mVisualModel->mGlyphs.Begin();
 
-  // If the vector is void, there is no right to left characters.
-  const bool hasRightToLeftCharacters = NULL != visualToLogicalBuffer;
-
   const CharacterIndex startCharacter = line.characterRun.characterIndex;
   const CharacterIndex endCharacter   = line.characterRun.characterIndex + line.characterRun.numberOfCharacters;
   DALI_ASSERT_DEBUG( endCharacter <= mLogicalModel->mText.Count() && "Invalid line info" );
@@ -1968,7 +1955,7 @@ CharacterIndex Controller::Impl::GetClosestCursorIndex( float visualX,
   for( ; !matched && ( visualIndex < endCharacter ); ++visualIndex )
   {
     // The character in logical order.
-    const CharacterIndex characterLogicalOrderIndex = hasRightToLeftCharacters ? *( visualToLogicalBuffer + visualIndex ) : visualIndex;
+    const CharacterIndex characterLogicalOrderIndex = mLogicalModel->GetLogicalCharacterIndex( visualIndex );
 
     // Get the script of the character.
     const Script script = mLogicalModel->GetScript( characterLogicalOrderIndex );
@@ -1982,7 +1969,7 @@ CharacterIndex Controller::Impl::GetClosestCursorIndex( float visualX,
     {
       // Get the first character/glyph of the group of glyphs.
       const CharacterIndex firstVisualCharacterIndex = 1u + visualIndex - numberOfCharacters;
-      const CharacterIndex firstLogicalCharacterIndex = hasRightToLeftCharacters ? *( visualToLogicalBuffer + firstVisualCharacterIndex ) : firstVisualCharacterIndex;
+      const CharacterIndex firstLogicalCharacterIndex = mLogicalModel->GetLogicalCharacterIndex( firstVisualCharacterIndex );
       const GlyphIndex firstLogicalGlyphIndex = *( charactersToGlyphBuffer + firstLogicalCharacterIndex );
 
       // Get the metrics for the group of glyphs.
@@ -2025,7 +2012,6 @@ CharacterIndex Controller::Impl::GetClosestCursorIndex( float visualX,
 
   }
 
-
   // Return the logical position of the cursor in characters.
 
   if( !matched )
@@ -2033,7 +2019,7 @@ CharacterIndex Controller::Impl::GetClosestCursorIndex( float visualX,
     visualIndex = endCharacter;
   }
 
-  logicalIndex = hasRightToLeftCharacters ? *( visualToLogicalCursorBuffer + visualIndex ) : visualIndex;
+  logicalIndex = mLogicalModel->GetLogicalCursorIndex( visualIndex );
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "%p closest visualIndex %d logicalIndex %d\n", this, visualIndex, logicalIndex );
 
   DALI_ASSERT_DEBUG( ( logicalIndex <= mLogicalModel->mText.Count() && logicalIndex >= 0 ) && "GetClosestCursorIndex - Out of bounds index" );
index 4e566ab..99b0c69 100644 (file)
@@ -628,6 +628,14 @@ struct Controller::Impl
    */
   void ScrollTextToMatchCursor( const CursorInfo& cursorInfo );
 
+private:
+  // Declared private and left undefined to avoid copies.
+  Impl( const Impl& );
+  // Declared private and left undefined to avoid copies.
+  Impl& operator=( const Impl& );
+
+public:
+
   ControlInterface& mControlInterface;     ///< Reference to the text controller.
   LogicalModelPtr mLogicalModel;           ///< Pointer to the logical model.
   VisualModelPtr  mVisualModel;            ///< Pointer to the visual model.
index 37110dc..c733384 100644 (file)
@@ -1430,7 +1430,7 @@ bool Controller::DoRelayout( const Size& size,
   const CharacterIndex startIndex = mImpl->mTextUpdateInfo.mParagraphCharacterIndex;
   const Length requestedNumberOfCharacters = mImpl->mTextUpdateInfo.mRequestedNumberOfCharacters;
 
-  if( LAYOUT & operations )
+  if( NO_OPERATION != ( LAYOUT & operations ) )
   {
     // Some vectors with data needed to layout and reorder may be void
     // after the first time the text has been laid out.
@@ -1449,7 +1449,7 @@ bool Controller::DoRelayout( const Size& size,
 
     if( 0u == totalNumberOfGlyphs )
     {
-      if( UPDATE_ACTUAL_SIZE & operations )
+      if( NO_OPERATION != ( UPDATE_ACTUAL_SIZE & operations ) )
       {
         mImpl->mVisualModel->SetLayoutSize( Size::ZERO );
       }
@@ -1503,7 +1503,7 @@ bool Controller::DoRelayout( const Size& size,
     if( viewUpdated )
     {
       // Reorder the lines
-      if( REORDER & operations )
+      if( NO_OPERATION != ( REORDER & operations ) )
       {
         Vector<BidirectionalParagraphInfoRun>& bidirectionalInfo = mImpl->mLogicalModel->mBidirectionalParagraphInfo;
         Vector<BidirectionalLineInfoRun>& bidirectionalLineInfo = mImpl->mLogicalModel->mBidirectionalLineInfo;
@@ -1526,14 +1526,6 @@ bool Controller::DoRelayout( const Size& size,
           layoutParameters.lineBidirectionalInfoRunsBuffer = bidirectionalLineInfo.Begin();
           layoutParameters.numberOfBidirectionalInfoRuns = bidirectionalLineInfo.Count();
 
-          // TODO: update the conversion map instead creating it from scratch.
-          //       Note this tables store indices to characters, so update the table means modify all the indices of the text after the last updated character.
-          //       It's better to refactor this. Store this table per line and don't update the indices.
-          //       For the cursor position probably is better to use the function instead creating a table.
-          // Set the bidirectional info into the model.
-          mImpl->mLogicalModel->SetVisualToLogicalMap( 0u,
-                                                       mImpl->mLogicalModel->mText.Count() );
-
           // Re-layout the text. Reorder those lines with right to left characters.
           mImpl->mLayoutEngine.ReLayoutRightToLeftLines( layoutParameters,
                                                          startIndex,
@@ -1544,7 +1536,7 @@ bool Controller::DoRelayout( const Size& size,
       } // REORDER
 
       // Sets the actual size.
-      if( UPDATE_ACTUAL_SIZE & operations )
+      if( NO_OPERATION != ( UPDATE_ACTUAL_SIZE & operations ) )
       {
         mImpl->mVisualModel->SetLayoutSize( layoutSize );
       }
@@ -1558,7 +1550,7 @@ bool Controller::DoRelayout( const Size& size,
     layoutSize = mImpl->mVisualModel->GetLayoutSize();
   }
 
-  if( ALIGN & operations )
+  if( NO_OPERATION != ( ALIGN & operations ) )
   {
     // The laid-out lines.
     Vector<LineRun>& lines = mImpl->mVisualModel->mLines;
@@ -2113,10 +2105,10 @@ void Controller::TapEvent( unsigned int tapCount, float x, float y )
       // This is to avoid unnecessary relayouts when tapping an empty text-field
       bool relayoutNeeded( false );
 
-      if( ( EventData::EDITING_WITH_PASTE_POPUP == mImpl->mEventData->mState ) ||
+      if( ( EventData::EDITING_WITH_POPUP == mImpl->mEventData->mState ) ||
           ( EventData::EDITING_WITH_PASTE_POPUP == mImpl->mEventData->mState ) )
       {
-        mImpl->ChangeState( EventData::EDITING_WITH_GRAB_HANDLE);  // If Popup shown hide it here so can be shown again if required.
+        mImpl->ChangeState( EventData::EDITING_WITH_GRAB_HANDLE );  // If Popup shown hide it here so can be shown again if required.
       }
 
       if( mImpl->IsShowingRealText() && ( EventData::INACTIVE != mImpl->mEventData->mState ) )
index 681ffc7..b346d90 100644 (file)
@@ -100,7 +100,10 @@ void ParseFontStyleString( const std::string& style, Property::Map& map )
   {
     const TreeNode* const node = parser.GetRoot();
 
-    CreateFontStyleMap( node, map );
+    if( NULL != node )
+    {
+      CreateFontStyleMap( node, map );
+    }
   }
 }
 
index 79c1b80..c8a0900 100644 (file)
@@ -77,9 +77,9 @@ class Button;
  * | stateChanged     | @ref StateChangedSignal()   |
  *
  * Actions
- * | %Action Name     | %Button method called       |
+ * | %Action Name     | Description                 |
  * |------------------|-----------------------------|
- * | buttonClick      | %DoClickAction()            |
+ * | buttonClick      | Simulates a button click    |
  * @SINCE_1_0.0
  */
 class DALI_IMPORT_API Button : public Control
index 45fbe44..33acab9 100644 (file)
@@ -163,8 +163,6 @@ TypeAction registerAction( typeRegistration, ACTION_ACCESSIBILITY_ACTIVATED, &Do
 
 DALI_TYPE_REGISTRATION_END()
 
-const char * const COLOR_RENDERER_COLOR_NAME("blendColor");
-
 } // unnamed namespace
 
 namespace Internal
@@ -179,6 +177,7 @@ public:
 : mControlImpl( controlImpl ),
   mStyleName(""),
   mBackgroundRenderer(),
+  mBackgroundColor(Color::TRANSPARENT),
   mStartingPinchScale( NULL ),
   mKeyEventSignal(),
   mPinchGestureDetector(),
@@ -369,6 +368,7 @@ public:
   Control& mControlImpl;
   std::string mStyleName;
   Toolkit::ControlRenderer mBackgroundRenderer;   ///< The control renderer to render the background
+  Vector4 mBackgroundColor;                       ///< The color of the background renderer
   Vector3* mStartingPinchScale;      ///< The scale when a pinch gesture starts, TODO: consider removing this
   Toolkit::Control::KeyEventSignalType mKeyEventSignal;
   Toolkit::Control::KeyInputFocusSignalType mKeyInputFocusGainedSignal;
@@ -441,6 +441,8 @@ const std::string& Control::GetStyleName() const
 
 void Control::SetBackgroundColor( const Vector4& color )
 {
+  mImpl->mBackgroundColor = color;
+
   Actor self( Self() );
   Toolkit::RendererFactory factory = Toolkit::RendererFactory::Get();
   factory.ResetRenderer( mImpl->mBackgroundRenderer, self, color );
@@ -449,19 +451,7 @@ void Control::SetBackgroundColor( const Vector4& color )
 
 Vector4 Control::GetBackgroundColor() const
 {
-  if( mImpl->mBackgroundRenderer && ( &typeid( GetImplementation(mImpl->mBackgroundRenderer) ) == &typeid( ColorRenderer ) ) )
-  {
-     Property::Map map;
-     mImpl->mBackgroundRenderer.CreatePropertyMap( map );
-     const Property::Value* colorValue = map.Find( COLOR_RENDERER_COLOR_NAME );
-     Vector4 color;
-     if( colorValue && colorValue->Get(color))
-     {
-       return color;
-     }
-  }
-
-  return Color::TRANSPARENT;
+  return mImpl->mBackgroundColor;
 }
 
 void Control::SetBackground(const Property::Map& map)
index bf1d3b1..908becd 100644 (file)
@@ -31,7 +31,7 @@ namespace Toolkit
 
 const unsigned int TOOLKIT_MAJOR_VERSION = 1;
 const unsigned int TOOLKIT_MINOR_VERSION = 1;
-const unsigned int TOOLKIT_MICRO_VERSION = 32;
+const unsigned int TOOLKIT_MICRO_VERSION = 33;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 889106c..422839e 100644 (file)
@@ -28,6 +28,29 @@ animation.AnimateTo( Property( actor1, Dali::Actor::Property::POSITION ), Vector
 animation.AnimateBy( Property( actor2, Dali::Actor::Property::POSITION ), Vector3(10.0f, 50.0f, 0.0f) ); // End Position: 20.0f, 60.0f, 0.0f
 ~~~
 
+Note, for rotations, AnimateTo uses spherical linear interpolation to animate to the new orientation (i.e. it will take the shortest path). Because of this, the number of complete revolutions in any given angle will be reduced to 0. For example,
+
+(Assume actor1 is at orientation 0 degrees about Z-Axis at the start of the animation)
+~~~{.cpp}
+// Animate the orientation of actor1 to 390 degrees about the Z-AXIS
+animation.AnimateTo( Property( actor1, Dali::Actor::Property::ORIENTATION ), AngleAxis( Degree( 390 ), Vector3::ZAXIS ) );
+~~~
+
+will only rotate 30 degrees about the Z axis, as that is the shortest path to the final orientation.
+
+AnimateBy will preserve the full revolution count of any angle passed in using AngleAxis, for example, AngleAxis( Degree( 770 ), Vector3::ZAXIS ) will revolve 2 full times before reaching the final angle of 50 degrees from the original orientation.
+
+However, because Quaternions do not preserve the revolution count, AnimateBy will only rotate 50 degrees if the relative value is constructed using a Quaternion. For example,
+
+(Assume actor1 and actor 2 are at orientation 0 degrees about Z-Axis at the start of the animation)
+~~~{.cpp}
+// Animate the orientation of actor1 3.5 times about the Z-AXIS
+animation.AnimateBy( Property( actor1, Dali::Actor::Property::ORIENTATION ), AngleAxis( Degree( 360 * 3.5 ), Vector3::ZAXIS ) );
+
+// But the same degree value will only rotate 180 degrees if a Quaternion is used instead:
+animation.AnimateBy( Property( actor2, Dali::Actor::Property::ORIENTATION ), Quaternion( Degree( 360 * 3.5 ), Vector3::ZAXIS ) );
+~~~
+
 ### Playback Control
 
 When an animation is created, it can be played:
@@ -126,4 +149,4 @@ To animate actor1 along this path:
 ~~~{.cpp}
 animation.Animate( actor1, path, Vector3::ZERO );
 ~~~
-The third parameter is the forward vector (in local space coordinate system) that will be oriented with the path's tangent direction.
\ No newline at end of file
+The third parameter is the forward vector (in local space coordinate system) that will be oriented with the path's tangent direction.
index 8f77b8d..b19b5dd 100644 (file)
@@ -34,7 +34,7 @@ Renders a solid color to the control's quad.
 
 | Property Name | Type    | Required | Description               |
 |---------------|:-------:|:--------:|---------------------------|
-| blendColor    | VECTOR4 | Yes      | The solid color required. |
+| mixColor      | VECTOR4 | Yes      | The solid color required. |
 
 ### Usage
 
@@ -44,7 +44,7 @@ Dali::Toolkit::Control control = Dali::Toolkit::Control::New();
 
 Dali::Property::Map map;
 map[ "rendererType" ] = "color";
-map[ "blendColor" ] = Color::RED;
+map[ "mixColor" ] = Color::RED;
 
 control.SetProperty( Dali::Toolkit::Control::Property::BACKGROUND, map );
 ~~~
@@ -56,7 +56,7 @@ var control = new dali.Control( "Control" );
 control.background =
 {
   rendererType : "color",
-  blendColor : dali.COLOR_RED
+  mixColor : dali.COLOR_RED
 };
 ~~~
 ___________________________________________________________________________________________________
index c9a388b..5f14f07 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    The OpenGLES Canvas Core Library Toolkit
-Version:    1.1.32
+Version:    1.1.33
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-2-Clause and MIT
index 1311506..eab1614 100644 (file)
@@ -178,29 +178,29 @@ const IntegerPair EnumTable[] =
     { "SAMPLING_MODE_NO_FILTER",        SamplingMode::NO_FILTER },
     { "SAMPLING_MODE_DONT_CARE",        SamplingMode::DONT_CARE },
 
-    { "BLEND_FACTOR_ZERO",                                  BlendingFactor::ZERO                    },
-    { "BLEND_FACTOR_ONE",                                   BlendingFactor::ONE                     },
-    { "BLEND_FACTOR_SRC_COLOR",                             BlendingFactor::SRC_COLOR               },
-    { "BLEND_FACTOR_ONE_MINUS_SRC_COLOR",                   BlendingFactor::ONE_MINUS_SRC_COLOR     },
-    { "BLEND_FACTOR_SRC_ALPHA",                             BlendingFactor::SRC_ALPHA               },
-    { "BLEND_FACTOR_ONE_MINUS_SRC_ALPHA",                   BlendingFactor::ONE_MINUS_SRC_ALPHA     },
-    { "BLEND_FACTOR_DST_ALPHA",                             BlendingFactor::DST_ALPHA                },
-    { "BLEND_FACTOR_ONE_MINUS_DST_ALPHA",                   BlendingFactor::ONE_MINUS_DST_ALPHA      },
-    { "BLEND_FACTOR_DST_COLOR",                             BlendingFactor::DST_COLOR                },
-    { "BLEND_FACTOR_ONE_MINUS_DST_COLOR",                   BlendingFactor::ONE_MINUS_DST_COLOR      },
-    { "BLEND_FACTOR_SRC_ALPHA_SATURATE",                    BlendingFactor::SRC_ALPHA_SATURATE       },
-    { "BLEND_FACTOR_CONSTANT_COLOR",                        BlendingFactor::CONSTANT_COLOR           },
-    { "BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR",              BlendingFactor::ONE_MINUS_CONSTANT_COLOR },
-    { "BLEND_FACTOR_CONSTANT_ALPHA" ,                       BlendingFactor::CONSTANT_ALPHA           },
-    { "BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA",              BlendingFactor::ONE_MINUS_CONSTANT_ALPHA },
-
-    { "BLENDING_OFF",                                      BlendingMode::OFF             },
-    { "BLENDING_AUTO",                                     BlendingMode::AUTO            },
-    { "BLENDING_ON",                                       BlendingMode::ON              },
-
-    { "BLEND_EQUATION_ADD",                                BlendingEquation::ADD              },
-    { "BLEND_EQUATION_SUBTRACT",                           BlendingEquation::SUBTRACT         },
-    { "BLEND_EQUATION_REVERSE_SUBTRACT",                   BlendingEquation::REVERSE_SUBTRACT },
+    { "BLEND_FACTOR_ZERO",                                  BlendFactor::ZERO                    },
+    { "BLEND_FACTOR_ONE",                                   BlendFactor::ONE                     },
+    { "BLEND_FACTOR_SRC_COLOR",                             BlendFactor::SRC_COLOR               },
+    { "BLEND_FACTOR_ONE_MINUS_SRC_COLOR",                   BlendFactor::ONE_MINUS_SRC_COLOR     },
+    { "BLEND_FACTOR_SRC_ALPHA",                             BlendFactor::SRC_ALPHA               },
+    { "BLEND_FACTOR_ONE_MINUS_SRC_ALPHA",                   BlendFactor::ONE_MINUS_SRC_ALPHA     },
+    { "BLEND_FACTOR_DST_ALPHA",                             BlendFactor::DST_ALPHA                },
+    { "BLEND_FACTOR_ONE_MINUS_DST_ALPHA",                   BlendFactor::ONE_MINUS_DST_ALPHA      },
+    { "BLEND_FACTOR_DST_COLOR",                             BlendFactor::DST_COLOR                },
+    { "BLEND_FACTOR_ONE_MINUS_DST_COLOR",                   BlendFactor::ONE_MINUS_DST_COLOR      },
+    { "BLEND_FACTOR_SRC_ALPHA_SATURATE",                    BlendFactor::SRC_ALPHA_SATURATE       },
+    { "BLEND_FACTOR_CONSTANT_COLOR",                        BlendFactor::CONSTANT_COLOR           },
+    { "BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR",              BlendFactor::ONE_MINUS_CONSTANT_COLOR },
+    { "BLEND_FACTOR_CONSTANT_ALPHA" ,                       BlendFactor::CONSTANT_ALPHA           },
+    { "BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA",              BlendFactor::ONE_MINUS_CONSTANT_ALPHA },
+
+    { "BLEND_MODE_OFF",                                      BlendMode::OFF             },
+    { "BLEND_MODE_AUTO",                                     BlendMode::AUTO            },
+    { "BLEND_MODE_ON",                                       BlendMode::ON              },
+
+    { "BLEND_EQUATION_ADD",                                BlendEquation::ADD              },
+    { "BLEND_EQUATION_SUBTRACT",                           BlendEquation::SUBTRACT         },
+    { "BLEND_EQUATION_REVERSE_SUBTRACT",                   BlendEquation::REVERSE_SUBTRACT },
 
     { "CAMERA_FREE_LOOK"             ,      Camera::FREE_LOOK                   },
     { "CAMERA_LOOK_AT_TARGET"        ,      Camera::LOOK_AT_TARGET              },
@@ -217,10 +217,14 @@ const IntegerPair EnumTable[] =
     { "WRAP_MODE_REPEAT",                     WrapMode::REPEAT           },
     { "WRAP_MODE_MIRRORED_REPEAT",            WrapMode::MIRRORED_REPEAT  },
 
-    { "MATERIAL_NONE",                        Renderer::NONE                      },
-    { "MATERIAL_CULL_BACK",                   Renderer::CULL_BACK                 },
-    { "MATERIAL_CULL_FRONT",                  Renderer::CULL_FRONT                },
-    { "MATERIAL_CULL_BACK_AND_FRONT",         Renderer::CULL_BACK_AND_FRONT       },
+    { "FACE_CULLING_NONE",                    FaceCullingMode::NONE           },
+    { "FACE_CULLING_BACK",                    FaceCullingMode::BACK           },
+    { "FACE_CULLING_FRONT",                   FaceCullingMode::FRONT          },
+    { "FACE_CULLING_FRONT_AND_BACK",          FaceCullingMode::FRONT_AND_BACK },
+
+    { "DEPTH_WRITE_OFF",                      DepthWriteMode::OFF   },
+    { "DEPTH_WRITE_AUTO",                     DepthWriteMode::AUTO  },
+    { "DEPTH_WRITE_ON",                       DepthWriteMode::ON    },
 
     { "GEOMETRY_POINTS",                      Geometry::POINTS          },
     { "GEOMETRY_LINES",                       Geometry::LINES           },
index e9c35a9..af216bd 100644 (file)
@@ -214,14 +214,21 @@ void GeometryApi::SetIndexBuffer( const v8::FunctionCallbackInfo<v8::Value>& arg
   }
   else
   {
-    int size = V8Utils::GetIntegerParameter( PARAMETER_1, found, isolate, args, 0);
+    unsigned int size = V8Utils::GetIntegerParameter( PARAMETER_1, found, isolate, args, 0);
     if( !found )
     {
       DALI_SCRIPT_EXCEPTION( isolate, "missing buffer size from param 1" );
     }
     else
     {
-      geometry.SetIndexBuffer( static_cast<const unsigned short*>(data), size );
+      Dali::Vector<unsigned short> indices;
+      indices.Resize( size );
+      unsigned int* indexData = static_cast<unsigned int*>(data);
+      for( size_t i(0); i<size; ++i )
+      {
+        indices[i] = indexData[i];
+      }
+      geometry.SetIndexBuffer( &indices[0], size );
     }
   }
 }
index 5efcd94..8834c35 100644 (file)
@@ -205,162 +205,6 @@ void RendererApi::GetTextures( const v8::FunctionCallbackInfo<v8::Value>& args )
   args.GetReturnValue().Set( localObject );
 }
 
-/**
- * Specify the pixel arithmetic used when the actor is blended.
- *
- * @for Renderer
- * @method setBlendFunc
- * @param {integer} srcFactorRgb Source Blending RGB
- * @param {integer} destFactorRgb Destination Blending RGB
- * @param {integer} srcFactorAlpha Source Blending Alpha
- * @param {integer} destFactorAlpha Destination Blending Alpha
- * @example
- *    //blending constants
- *    dali.BLEND_FACTOR_ZERO
- *    dali.BLEND_FACTOR_ONE
- *    dali.BLEND_FACTOR_SRC_COLOR
- *    dali.BLEND_FACTOR_ONE_MINUS_SRC_COLOR
- *    dali.BLEND_FACTOR_SRC_ALPHA
- *    dali.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA
- *    dali.BLEND_FACTOR_DST_ALPHA
- *    dali.BLEND_FACTOR_ONE_MINUS_DST_ALPHA
- *    dali.BLEND_FACTOR_DST_COLOR
- *    dali.BLEND_FACTOR_ONE_MINUS_DST_COLOR
- *    dali.BLEND_FACTOR_SRC_ALPHA_SATURATE
- *    dali.BLEND_FACTOR_CONSTANT_COLOR
- *    dali.BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR
- *    dali.BLEND_FACTOR_CONSTANT_ALPHA
- *    dali.BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA
- *
- *    renderer.setBlendFunc( dali.BLEND_FACTOR_CONSTANT_COLOR, dali.BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR,
- *                           dali.BLEND_FACTOR_CONSTANT_ALPHA, dali.BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA );
- */
-void RendererApi::SetBlendFunc( const v8::FunctionCallbackInfo< v8::Value >& args )
-{
-  v8::Isolate* isolate = args.GetIsolate();
-  v8::HandleScope handleScope( isolate );
-
-  Renderer renderer = GetRenderer( isolate, args );
-
-  int params[4];
-  bool foundAllParams(false);
-  V8Utils::ReadIntegerArguments( foundAllParams, &params[0], 4, args, 0 );
-  if( foundAllParams )
-  {
-    renderer.SetBlendFunc( static_cast< Dali::BlendingFactor::Type>(params[0]),
-                           static_cast< Dali::BlendingFactor::Type>(params[1]),
-                           static_cast< Dali::BlendingFactor::Type>(params[2]),
-                           static_cast< Dali::BlendingFactor::Type>(params[3]) );
-  }
-  else
-  {
-    DALI_SCRIPT_EXCEPTION( isolate, "invalid blendFunc parameter");
-  }
-}
-
-/**
- * Query the pixel arithmetic used when the actor is blended.
- *
- * @for Renderer
- * @method getBlendFunc
- * @return {Object} Blend properties
- * @example Blend properties object has 4 fields
- *
- *      blendProperties.sourceRgb // source rgb enum
- *      blendProperties.destinationRgb // destination rgb enum
- *      blendProperties.sourceAlpha source // alpha enum
- *      blendProperties.destinationAlpha // destination alpha enum
- */
-void RendererApi::GetBlendFunc( const v8::FunctionCallbackInfo< v8::Value >& args )
-{
-  // Pass by reference doesn't work in Javascript
-  // For now just return a vector 4...
-
-  BlendingFactor::Type srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha;
-  v8::Isolate* isolate = args.GetIsolate();
-  v8::HandleScope handleScope( isolate );
-
-  Renderer renderer = GetRenderer( isolate, args );
-
-  renderer.GetBlendFunc( srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha );
-
-  v8::Local<v8::Object> blendProperties = v8::Object::New( isolate );
-
-  blendProperties->Set( v8::String::NewFromUtf8( isolate, "sourceRgb" ),        v8::Integer::New( isolate, srcFactorRgb) );
-  blendProperties->Set( v8::String::NewFromUtf8( isolate, "destinationRgb" ),   v8::Integer::New( isolate, destFactorRgb ) );
-  blendProperties->Set( v8::String::NewFromUtf8( isolate, "sourceAlpha" ),      v8::Integer::New( isolate, srcFactorAlpha  ) );
-  blendProperties->Set( v8::String::NewFromUtf8( isolate, "destinationAlpha" ), v8::Integer::New( isolate, destFactorAlpha ) );
-
-  args.GetReturnValue().Set( blendProperties );
-}
-
-/**
- * Specify the equation used when the actor is blended.
- *
- * @for Renderer
- * @method setBlendEquation
- * @param { integer } equationRgb The equation used for combining red, green, and blue components.
- * @param { integer } equationAlpha The equation used for combining the alpha component.
- * @example
- *      // blend equation is one of the following
- *      dali.BLEND_EQUATION_ADD
- *      dali.BLEND_EQUATION_SUBTRACT
- *      dali.BLEND_EQUATION_REVERSE_SUBTRACT
- *
- *      renderer.setBlendEquation( dali.BLEND_EQUATION_ADD, dali.BLEND_EQUATION_REVERSE_SUBTRACT );
- */
-void RendererApi::SetBlendEquation( const v8::FunctionCallbackInfo< v8::Value >& args )
-{
-  v8::Isolate* isolate = args.GetIsolate();
-  v8::HandleScope handleScope( isolate );
-
-  Renderer renderer = GetRenderer( isolate, args );
-
-  int params[2];
-  bool foundAllParams(false);
-  V8Utils::ReadIntegerArguments( foundAllParams, &params[0], 2, args, 0 );
-  if( foundAllParams )
-  {
-    renderer.SetBlendEquation( static_cast< BlendingEquation::Type>(params[0]), static_cast< BlendingEquation::Type>(params[1]) );
-  }
-  else
-  {
-    DALI_SCRIPT_EXCEPTION( isolate, "invalid BlendEquation parameter");
-  }
-}
-
-/**
- * Query the equation used when the actor is blended.
- *
- * @for Renderer
- * @method getBlendEquation
- * @return {Object} Blend equations
- * @example Blend equations object has 2 fields
- *
- *      blendEquations.equationRgb // equation used for combining rgb components
- *      blendEquations.equationAlpha // equation used for combining alpha components
- */
-void RendererApi::GetBlendEquation( const v8::FunctionCallbackInfo< v8::Value >& args )
-{
-  // Pass by reference doesn't work in Javascript
-  // For now just return a vector 2...
-
-  BlendingEquation::Type equationRgb, equationAlpha;
-  v8::Isolate* isolate = args.GetIsolate();
-  v8::HandleScope handleScope( isolate );
-
-  Renderer renderer = GetRenderer( isolate, args );
-
-  renderer.GetBlendEquation( equationRgb, equationAlpha );
-
-  v8::Local<v8::Object> blendEquations = v8::Object::New( isolate );
-
-  blendEquations->Set( v8::String::NewFromUtf8( isolate, "equationRgb" ),   v8::Integer::New( isolate, equationRgb) );
-  blendEquations->Set( v8::String::NewFromUtf8( isolate, "equationAlpha" ), v8::Integer::New( isolate, equationAlpha ) );
-
-  args.GetReturnValue().Set( blendEquations );
-}
-
 } // namespace V8Plugin
 
 } // namespace Dali
index 6080bd2..2e08977 100644 (file)
@@ -74,9 +74,7 @@ struct ShaderHintPair
 
 const ShaderHintPair ShaderHintTable[]=
 {
-    {"requiresSelfDepthTest",  Shader::HINT_REQUIRES_SELF_DEPTH_TEST },
     {"outputIsTransparent",    Shader::HINT_OUTPUT_IS_TRANSPARENT },
-    {"outputIsOpaque",         Shader::HINT_OUTPUT_IS_OPAQUE   },
     {"modifiesGeometry",       Shader::HINT_MODIFIES_GEOMETRY },
 };