15 Commits

Author SHA1 Message Date
Adam Barth
b38ec59b63 Build txt_unittests
Many of these fail because they assume they're being executed on Android, but
at least they build.

Change-Id: I5d86e3d2632a0d6fa4219d3f5182f2683c9dd314
2017-05-08 12:40:16 -07:00
Seigo Nonaka
80a9239d69 Introduce FontCollection construct perf test
Test: ran minikin_perftest
Bug: 36232655
Change-Id: Ic4d88663d522be17540e2ac17c9b7ae64210275f
2017-03-17 07:42:21 -07:00
Seigo Nonaka
dfbc6e3742 Remove MinikinRefCounted and use shared_ptr instead
Let's use shared_ptr since manual ref counting can be a bug-prone and
using the global mutex inside destructor is not useful for some time.

To remove raw pointer manipulation, needed to change Layout
constructors. Layout is no longer copyable and need to pass
FontCollection to constructor.

Bug: 28119474
Test: minikin_tests passed
Test: hwui_unit_tests passed
Test: No performance regression in minikin_perftest.
Change-Id: I8824593206ecba74cbc9731e298f045e1ae442a3
2017-02-24 17:11:32 +09:00
Seigo Nonaka
41718c770d Remove FontFamily.addFont and make FontFamily immutable.
This is 2nd attempt of 41e02e96131c1ec66d013e4615348be013518dc4
The difference is adding clearElementsEithLock to Font class which
is necessary to delete Fonts object outside of minikin. This method
should be removed once http://b/28119474 is fixed.

Here is original commit message of reverted change.

This lays the groundwork for making SparseBitSet serializable.
FontFamily.addFont is only used when the FontFamily is constructed.
Thus, instead of calling FontFamily.addFont multiple time, passes
Font list to the constructor. By this change, FontFamily can be
immutable now.

By making FontFamily immutable, We can create FontFamily with
pre-calculated SparseBitSet.

Bug: 34042446
Bug: 28119474
Bug: 34378805
Test: minikin_tests has passed
Change-Id: Ice433931196f5ae79a1a7ee0c98020f914aeb5f2
2017-01-20 17:59:42 +09:00
Siyamed Sinir
cc0352cc67 Revert "Remove FontFamily.addFont and make FontFamily immutable."
This reverts commit 41e02e96131c1ec66d013e4615348be013518dc4.

Bug: 34378805
Change-Id: I8f1ee00b365c8b17c6140e9e286fbea082e31364
2017-01-20 02:01:21 +00:00
Seigo Nonaka
41e02e9613 Remove FontFamily.addFont and make FontFamily immutable.
This lays the groundwork for making SparseBitSet serializable.
FontFamily.addFont is only used when the FontFamily is constructed.
Thus, instead of calling FontFamily.addFont multiple time, passes
Font list to the constructor. By this change, FontFamily can be
immutable now.

By making FontFamily immutable, We can create FontFamily with
pre-calculated SparseBitSet.

Bug: 34042446
Test: minikin_tests has passed
Change-Id: I2576789fba6cb27687e920e2488e8bedbcf7d36f
2017-01-12 13:27:00 +09:00
Mark Salyzyn
77baca2bda resolve merge conflicts of dff2a9d to master
Test: compile
Bug: 30465923
Change-Id: I9bcbf910e90a9160ed2fd2f75c5d72dba6ad6fcf
2017-01-10 08:22:04 -08:00
Mark Salyzyn
32c12c0ac8 resolve merge conflicts of 2377a00 to master
Test: build
Bug: 26552300
Bug: 31289077
Change-Id: I6181ae7e84f9bdcbed50841c70d07f6906a10eb7
2016-12-28 13:51:49 -08:00
Seigo Nonaka
fd77b01ff2 Clean Up: Removing unused interface GetTable from MinikinFont.
This is 2nd attempt of Ifcd7a348d7fb5af081192899dbcdfc7fb4eebbf9

After Id766ab16a8d342bf7322a90e076e801271d527d4, GetTable is no longer
used in production due to poor performance and it is now only used in
tests. This CL removes GetTable interface from MinikinFont and update
tests code to use new interfaces, GetFontData, GetFontSize and
GetFontIndex.

Bug: 27860101
Test: Manually done
Change-Id: Ib48973ff25cdc61a4c666d28128266df0aaea83e
2016-11-17 17:36:51 +09:00
Seigo Nonaka
8d7ed7374b Revert "Clean Up: Removing unused interface GetTable from MinikinFont."
This reverts commit 1d525df4f0849a980c3204d5e4d41cbcc42f4ad6.

This causes a crash on Android Auto.

Bug: 32374752
Change-Id: Ia2ff77bf9a12351c6949f79ef6fa2d8016e3022d
2016-10-25 00:49:52 +00:00
Seigo Nonaka
1d525df4f0 Clean Up: Removing unused interface GetTable from MinikinFont.
After Id766ab16a8d342bf7322a90e076e801271d527d4, GetTable is no longer
used in production due to poor performance and it is now only used in
tests. This CL removes GetTable interface from MinikinFont and update
tests code to use new interfaces, GetFontData, GetFontSize and
GetFontIndex.

Bug: 27860101
Test: Manually done

Change-Id: Ifcd7a348d7fb5af081192899dbcdfc7fb4eebbf9
2016-10-18 08:16:18 +00:00
Seigo Nonaka
5e6bc85d69 Introduce FontCollection perftest
This CL introduces performance tests for FontCollection.

To support TTC file in /system/fonts, this CL also extends FontTestUtils

Bug:29142734
Change-Id: I9d8ad24ca55f61031b85623ab7c26234239e4f41
2016-06-28 08:52:35 +00:00
Seigo Nonaka
81c79d6e1e Fix test utilities
This fixes following three memory leaks in test utilities.
There is no problem in production code and this CL doesn't affect
any production behaviors.

- SkTypeface leaks due to forget calling SkSafeUnref in dtor.
- MinikinFontForTest leaks during constructing FontCollection.
- FontCollection leaks due to unnecessary AddRef.

Change-Id: I22e1e0307f1b2499296acb1aacc3ef66076a36e9
2016-06-21 16:47:25 +09:00
Seigo Nonaka
14e2d136aa Always use minikin namespace.
Here is a new policy of the namespace of minikin.
- All components should be in minikin namespace.
- All tests are also in minikin namespace and no anonymous namespace.

Bug: 29233740
Change-Id: I71a8a35049bb8d624f7a78797231e90fed1e2b8c
2016-06-11 00:11:17 +09:00
Seigo Nonaka
c38b249ef7 Reconstruct the directory structure of minikin tests.
To add perftests and reuse some utility classes, reconstruct
test directory structure.

- Move unit tests from minikin/tests to minikin/tests/unittests
- Extract utilitiy classes to minikin/tests/utils which will be
  used by perftests eventually.

Change-Id: I5026b177934e72ae67d362ee888302037da2f808
2016-06-09 03:25:03 +00:00