Commit Graph

441 Commits

Author SHA1 Message Date
Lucas Rocha
2d869489ef More efficient resetResult() loop in LayoutEngine 2015-09-10 11:19:28 +01:00
Lucas Rocha
909c14117f Fix dimension check for STRETCH children
The correct check is on the layout state, no the style.
2015-09-10 11:19:28 +01:00
Lucas Rocha
9a149c83ff Avoid extra work when justifyContent is FLEX_START
Remaining space and between space only need to be updated when
justifyContent is not FLEX_START.
2015-09-10 11:19:28 +01:00
Lucas Rocha
2321165d53 Move condition to the non-redundant block
No need to check for RELATIVE position when position type is ABSOLUTE
and dimension is set.
2015-09-08 15:34:51 +01:00
Lucas Rocha
d1a49a4f0b Reduce search range of flexible children
We were traversing all children to only perform calculations/changes to
flexible children in order to avoid new allocations during layout. This
diff ensures we only visit flexible children during layout calculations
if any are present. We accomplish this by keeping a private linked list
of flexible children.
2015-09-08 15:34:51 +01:00
Lucas Rocha
793220faf8 Skip final loop on absolute children, if possible
There's no need to go through all absolute children at the end of the
layout calculation if the node at hand doesn't have any. This also
ensures only absolutely positioned children are traversed in the final
loop.
2015-09-08 15:34:51 +01:00
Lucas Rocha
996f2a03d5 Merge pre-fill loop into main line loop
There's no need to go through all children before starting the main line loop
as we'll visit all children in the former loop anyway. This diff merges the
pre-fill loop into the main line one to avoid an extraneous traversal on the
node's children.
2015-09-08 15:34:27 +01:00
Lucas Rocha
877a2838a6 Skip trailing position loop, if possible
There's no need to set the trailing position on left-to-right layouts
as the nodes will already have what we need (x, y, width, and height).
This means we still have an extra cost for reversed layout directions
but they are not as common as LTR ones.
2015-09-08 15:33:26 +01:00
Lucas Rocha
1ab785b7a3 Inline immutable values in layout algorithm
Store immutable values from the node being laid out to avoid unnecessary
method invocations during layout calculation. This gives us a 3%-5%
performance boost in my benchmarks on Android.
2015-09-08 15:15:52 +01:00
Lucas Rocha
06c708053f Change Java to use array indexes instead of methods
Method invocations are not entirely free on Android. Change the
generated Java code to use the same array-based approach used in
JS and C to compute dimensions, positions, etc instead of relying
too heavily on method invovations. As a bonus, the Java transpiler
becomes a lot simpler because the code is more analogous to the C
counterpart.

In my local benchmarks this change gives us a major performance
boost on Android (between 15% and 30%) depending on the device
and the runtime (Dalvik|Art).
2015-09-08 15:15:46 +01:00
Colin Eberhardt
486b9a84bf 1.0.0 v1.0.0 2015-09-08 07:45:08 +01:00
Colin Eberhardt
00c8428015 Merge pull request #119 from ColinEberhardt/keywords
Keywords
2015-09-01 06:51:59 +01:00
Colin Eberhardt
ecb8f8e610 Added layout keyword 2015-09-01 06:10:34 +01:00
Colin Eberhardt
baf34484fe Updated repo to include cdnjs / npm instructions 2015-08-31 22:15:46 +01:00
Colin Eberhardt
5dd1482148 Minor build change
removed duplication of the step that creates the 'dist' folder
2015-08-31 22:09:30 +01:00
Colin Eberhardt
9d1abd8d51 added keywords 2015-08-31 22:05:14 +01:00
Christopher Chedeau
e6d3aea73d Merge pull request #117 from paramaggarwal/watch
Watch for changes and run tests during development using `grunt watch`.
2015-08-28 09:49:46 -07:00
Param Aggarwal
f9d308f923 Watch for changes and run tests during development using grunt watch. 2015-08-28 22:15:57 +05:30
Colin Eberhardt
68d45b4b9a 0.0.6 v0.0.6 2015-08-21 11:05:20 +01:00
Colin Eberhardt
99f44302fe Giving up on travis!
OK, Travis you have defeated me! reverting to a more manual release process
2015-08-21 11:04:46 +01:00
Colin Eberhardt
1e9a212799 0.0.5 v0.0.5 2015-08-21 09:20:12 +01:00
Colin Eberhardt
ca5490bdc5 updated npm login details - again! 2015-08-21 09:19:56 +01:00
Colin Eberhardt
0a80d40351 0.0.4 v0.0.4 2015-08-21 09:10:17 +01:00
Colin Eberhardt
d3c891f39a Updated the release process
Trying base64 encoded npm credentials
2015-08-21 08:59:49 +01:00
Colin Eberhardt
9c31f68f2e 0.0.3 release 0.0.3 2015-08-18 19:38:46 +01:00
Colin Eberhardt
ee6cf7129e Merge pull request #113 from ColinEberhardt/ci-releases
Added npm deploy when tags are pushed
2015-08-18 19:34:18 +01:00
Colin Eberhardt
eef605c221 Added npm deploy when tags are pushed 2015-08-17 21:48:57 +01:00
Colin Eberhardt
f85393fb01 Merge pull request #112 from ColinEberhardt/package-json-fix
Package json fix
2015-08-17 21:26:41 +01:00
Colin Eberhardt
fefc7b7496 Fixed variable name error
(should have run the code before commiting!)
2015-08-17 17:16:18 +01:00
Colin Eberhardt
9b11d202c9 Fixed reference to module entry point 2015-08-17 17:15:40 +01:00
Colin Eberhardt
e9b1258d5f Merge pull request #108 from ColinEberhardt/api-update
Updated the public API to no-longer extract nodes
2015-08-17 11:50:27 +01:00
Colin Eberhardt
cf8616e8e3 Merge pull request #109 from prenaux/master
Windows build, package C, and updated README
2015-08-13 18:00:22 +01:00
Pierre Renaux
d7708bc735 refact(Gruntfile.js): Use grunt-mkdir to create the dist folder ; 2015-08-13 17:56:03 +08:00
Pierre Renaux
b07454a14d build: Removed redundant loadNpmTasks ; Use config.delimiter instead of concat in java tasks ; Moved cTest variables to config ; 2015-08-13 17:43:42 +08:00
Pierre Renaux
c174b92f62 doc(README.md): Added alignContent in the list of supported attributes and in the default values ; 2015-08-13 17:11:05 +08:00
Pierre Renaux
fee4d39367 feat(Gruntfile.js): Added package-c task which creates a unified single header css-layout.h for use in C code ; 2015-08-13 16:56:41 +08:00
Colin Eberhardt
f9bb74aedf Updated the public API to no-longer extract nodes 2015-08-13 09:56:16 +01:00
Pierre Renaux
3e0a3697df feat(Gruntfile.js): Updated for Windows build ; 2015-08-13 16:30:58 +08:00
Colin Eberhardt
0de0186fbd Merge pull request #106 from ColinEberhardt/build-process-continues
Build complete and integrated with Travis
2015-08-13 08:37:26 +01:00
Colin Eberhardt
6eaa12e0b8 Added the JAR file 2015-08-12 08:54:53 +01:00
Colin Eberhardt
fec329f800 Updated README and travis.yml 2015-08-12 08:45:41 +01:00
Colin Eberhardt
6714c36824 Trying out travis 2015-08-12 08:25:57 +01:00
Colin Eberhardt
6d10a623d0 Added Java to the build 2015-08-12 07:42:29 +01:00
Colin Eberhardt
50c9712acd Merge pull request #105 from ColinEberhardt/build-process
Added a grunt build process
2015-08-12 07:19:20 +01:00
Colin Eberhardt
8ba0d1c608 Added transpile and 'c' tests 2015-08-12 06:17:53 +01:00
Colin Eberhardt
5653e4ef82 Fixed build and added distribution files to the repo 2015-08-11 21:22:27 +01:00
Colin Eberhardt
7f9b3afe33 Updated documentation
(And added missing change from previous commit!)
2015-08-11 17:56:21 +01:00
Colin Eberhardt
3b406b30c2 Module pattern is now implemented via templating
Previously two modules were defined, Layout.js, which is the internal implementation, and main.js, which depended on Layout.js and performed the fill / extract functionality required for a public JavaScript API.

This simplifies the implementation by just exposing a single UMD module by directly including Layout.js within the module wrapper.

Fixes #103
2015-08-11 17:42:59 +01:00
Colin Eberhardt
401f473449 Added eslint to the build
Fixes #102
2015-08-11 16:52:57 +01:00
Colin Eberhardt
74925f4439 Added karma testing to the gruntfile 2015-08-11 14:42:21 +01:00