浏览代码

Update readme

Michael Ragazzon 6 年之前
父节点
当前提交
4582a8474c
共有 3 个文件被更改,包括 23 次插入3 次删除
  1. 3 2
      Samples/basic/animation/src/main.cpp
  2. 1 1
      Source/Core/ElementAnimation.cpp
  3. 19 0
      readme.md

+ 3 - 2
Samples/basic/animation/src/main.cpp

@@ -41,8 +41,9 @@
 //  - [offtopic] Improve performance of transform parser (hashtable)
 //  - [offtopic] Use double for absolute time, get and cache time for each render/update loop
 //  - [performance] Replace property name strings with handle IDs (ints). Tried this and reverted, see [0e390e9], too little gain for too much complexity.
-//  - [performance] Memory pools for common elements.
+//  - [performance] Memory pools for common elements. Also, a lot of temporary objects are created and destroyed.
 //  - [performance] Try replacing ElementAttributes with vector.
+//  - [performance] Can we optimize the layouting? E.g. why is ElementTextDefault::GenerateLine being called even when neither text nor size have seemingly been changed.
 
 class DemoWindow
 {
@@ -146,7 +147,7 @@ public:
 		  Replace 'resize' event with virtual function call: 53.0  [7ad658f]
 		  Use all_properties_dirty flag when constructing elements: 55.0 [fa6bd0a]
 		  Don't double create input elements: 58.0  [e162637]
-		  Memory pool for ElementMeta: 59.0
+		  Memory pool for ElementMeta: 59.0  [ece191a]
 		
 		*/
 

+ 1 - 1
Source/Core/ElementAnimation.cpp

@@ -196,7 +196,7 @@ static PrepareTransformResult PrepareTransformPair(Transform& t0, Transform& t1,
 	{
 		// Try to match the smallest set of primitives to the larger set, set missing keys in the small set to identity.
 		// Requirement: The small set must match types in the same order they appear in the big set.
-		// Example: (letter indicates type, number represent values)
+		// Example: (letter indicates type, number represents values)
 		// big:       a0 b0 c0 b1
 		//               ^     ^ 
 		// small:     b2 b3   

+ 19 - 0
readme.md

@@ -10,6 +10,23 @@ Original website at http://librocket.com
 This fork contains some additional features over the [original libRocket branch](https://github.com/libRocket/libRocket), briefly documented here. Some of the new features utilize features from C++17, thus, a C++17-compliant compiler should be used.
 
 
+## Breaking changes
+
+If upgrading from the original libRocket branch, some breaking changes should be considered:
+
+- Rocket::Core::String has been replaced by std::string, thus, interfacing with the library now requires you to change your string types. This change was motivated by a small performance gain, additionally, it should make it easier to interface with the library especially for users already using std::string in their codebase.
+- Querying the property of an element for size, position and similar may not work as expected right after changes to the document or style. This change is made for performance reasons, see the note below for reasoning and a workaround.
+
+## Performance
+
+Users moving to this fork should generally see a substantial performance increase. 
+
+- The update loop has been reworked to avoid doing unnecessary, repeated calculations whenever the document or style is changed. Instead of immediately updating properties on any affected elements, most of this work is done during the Context::Update call in a more carefully chosen order. Note that for this reason, when querying the Rocket API for properties such as size or position, this information may not be up-to-date with changes since the last Context::Update, such as newly added elements or classes. If this information is needed immediately, a call to ElementDocument::UpdateDocument can be made before such queries at a performance penalty.
+- Several containers have been replaced, such as std::map to [robin_hood::unordered_flat_map](https://github.com/martinus/robin-hood-hashing).
+- Reduced number of allocations and unnecessary recursive calls.
+- And many more, smaller optimizations, resulting in more than 4x performance increase for creation and destruction of a large number of elements. A benchmark for this is located in the animation sample for now.
+
+
 ## Transform property
 
 Based on the work of @shoemark, with additional fixes.
@@ -126,6 +143,8 @@ RCSS example usage:
 
 Internally, animations apply their properties on the local style of the element. Thus, mixing RML style attributes and animations should be avoided on the same element.
 
+Animations currently support full interpolation of transforms, largely following the CSS specifications. Additionally, interpolation support for colors, numbers, lengths, and percentages are implemented.
+
 Animations are very powerful coupled with transforms. See the animation sample project for more examples and details.