Skip to content

Commit

Permalink
Create a unified target for the txt and minikin library, tests and be…
Browse files Browse the repository at this point in the history
…nchmarks. (flutter#4016)
  • Loading branch information
chinmaygarde authored Aug 26, 2017
1 parent 2ada410 commit aa0726f
Show file tree
Hide file tree
Showing 138 changed files with 268 additions and 1,759 deletions.
8 changes: 6 additions & 2 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ group("flutter") {
if (!is_fuchsia) {
if (current_toolchain == host_toolchain) {
deps += [
"//dart:create_sdk",
"//flutter/frontend_server",
"//dart:create_sdk",
"//flutter/frontend_server",
]
}
}
Expand All @@ -42,8 +42,12 @@ group("flutter") {
"//flutter/fml:fml_unittests",
"//flutter/sky/engine/wtf:wtf_unittests",
"//flutter/synchronization:synchronization_unittests",
"//flutter/third_party/txt:txt_unittests",
"//lib/ftl:ftl_unittests",
]
if (is_linux) {
deps += [ "//flutter/third_party/txt:txt_benchmarks" ]
}
}
}

Expand Down
11 changes: 0 additions & 11 deletions third_party/txt/Android.bp

This file was deleted.

147 changes: 118 additions & 29 deletions third_party/txt/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@
# limitations under the License.

config("txt_config") {
include_dirs = [
"//lib/txt/include",
"//third_party/harfbuzz/src",
"//lib/txt/shims",
]
visibility = [ ":*" ]
include_dirs = [ "src" ]
}

source_set("txt") {
Expand All @@ -29,34 +26,126 @@ source_set("txt") {
}

sources = [
"src/font_collection.cc",
"src/font_collection.h",
"src/font_skia.cc",
"src/font_skia.h",
"src/font_style.h",
"src/font_weight.h",
"src/paint_record.cc",
"src/paint_record.h",
"src/paragraph.cc",
"src/paragraph.h",
"src/paragraph_builder.cc",
"src/paragraph_builder.h",
"src/paragraph_style.cc",
"src/paragraph_style.h",
"src/styled_runs.cc",
"src/styled_runs.h",
"src/text_align.h",
"src/text_baseline.h",
"src/text_decoration.cc",
"src/text_decoration.h",
"src/text_style.cc",
"src/text_style.h",
"src/log/log.cc",
"src/log/log.h",
"src/minikin/CmapCoverage.cpp",
"src/minikin/CmapCoverage.h",
"src/minikin/Emoji.cpp",
"src/minikin/Emoji.h",
"src/minikin/FontCollection.cpp",
"src/minikin/FontCollection.h",
"src/minikin/FontFamily.cpp",
"src/minikin/FontFamily.h",
"src/minikin/FontLanguage.cpp",
"src/minikin/FontLanguage.h",
"src/minikin/FontLanguageListCache.cpp",
"src/minikin/FontLanguageListCache.h",
"src/minikin/FontUtils.cpp",
"src/minikin/FontUtils.h",
"src/minikin/GraphemeBreak.cpp",
"src/minikin/GraphemeBreak.h",
"src/minikin/HbFontCache.cpp",
"src/minikin/HbFontCache.h",
"src/minikin/Hyphenator.cpp",
"src/minikin/Hyphenator.h",
"src/minikin/Layout.cpp",
"src/minikin/Layout.h",
"src/minikin/LayoutUtils.cpp",
"src/minikin/LayoutUtils.h",
"src/minikin/LineBreaker.cpp",
"src/minikin/LineBreaker.h",
"src/minikin/Measurement.cpp",
"src/minikin/Measurement.h",
"src/minikin/MinikinFont.cpp",
"src/minikin/MinikinFont.h",
"src/minikin/MinikinInternal.cpp",
"src/minikin/MinikinInternal.h",
"src/minikin/SparseBitSet.cpp",
"src/minikin/SparseBitSet.h",
"src/minikin/WordBreaker.cpp",
"src/minikin/WordBreaker.h",
"src/txt/font_collection.cc",
"src/txt/font_collection.h",
"src/txt/font_skia.cc",
"src/txt/font_skia.h",
"src/txt/font_style.h",
"src/txt/font_weight.h",
"src/txt/paint_record.cc",
"src/txt/paint_record.h",
"src/txt/paragraph.cc",
"src/txt/paragraph.h",
"src/txt/paragraph_builder.cc",
"src/txt/paragraph_builder.h",
"src/txt/paragraph_style.cc",
"src/txt/paragraph_style.h",
"src/txt/styled_runs.cc",
"src/txt/styled_runs.h",
"src/txt/text_align.h",
"src/txt/text_baseline.h",
"src/txt/text_decoration.cc",
"src/txt/text_decoration.h",
"src/txt/text_style.cc",
"src/txt/text_style.h",
"src/utils/JenkinsHash.cpp",
"src/utils/JenkinsHash.h",
"src/utils/LruCache.h",
"src/utils/TypeHelpers.h",
]

public_configs = [ ":txt_config" ]

deps = [
"//lib/txt/libs/minikin",
public_deps = [
"//lib/ftl",
"//third_party/harfbuzz",
"//third_party/icu",
"//third_party/skia",
]

deps = [
"//third_party/skia:effects",
]
}

txt_common_executable_deps = [
"//dart/runtime:libdart_jit", # For logging.
"//flutter/fml", # For ICU initialization.
]

executable("txt_unittests") {
testonly = true

sources = [
"tests/font_collection_unittests.cc",
"tests/paragraph_unittests.cc",
"tests/render_test.cc",
"tests/render_test.h",
"tests/txt_run_all_unittests.cc",
"tests/utils.cc",
"tests/utils.h",
]

deps = [
":txt",
"//third_party/gtest",
] + txt_common_executable_deps
}

executable("txt_benchmarks") {
testonly = true

sources = [
"benchmarks/font_collection_benchmarks.cc",
"benchmarks/paint_record_benchmarks.cc",
"benchmarks/paragraph_benchmarks.cc",
"benchmarks/paragraph_builder_benchmarks.cc",
"benchmarks/styled_runs_benchmarks.cc",
"benchmarks/txt_run_all_benchmarks.cc",
"benchmarks/utils.cc",
"benchmarks/utils.h",
]

deps = [
":txt",
"//third_party/benchmark",
] + txt_common_executable_deps
}
30 changes: 0 additions & 30 deletions third_party/txt/app/Android.bp

This file was deleted.

64 changes: 0 additions & 64 deletions third_party/txt/app/HyphTool.cpp

This file was deleted.

47 changes: 0 additions & 47 deletions third_party/txt/benchmarks/BUILD.gn

This file was deleted.

2 changes: 1 addition & 1 deletion third_party/txt/benchmarks/font_collection_benchmarks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

#include "lib/ftl/command_line.h"
#include "lib/ftl/logging.h"
#include "lib/txt/src/font_collection.h"
#include "third_party/skia/include/ports/SkFontMgr.h"
#include "third_party/skia/include/ports/SkFontMgr_directory.h"
#include "txt/font_collection.h"
#include "utils.h"

namespace txt {
Expand Down
4 changes: 2 additions & 2 deletions third_party/txt/benchmarks/paint_record_benchmarks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

#include "lib/ftl/command_line.h"
#include "lib/ftl/logging.h"
#include "lib/txt/src/paint_record.h"
#include "lib/txt/src/text_style.h"
#include "txt/paint_record.h"
#include "txt/text_style.h"
#include "utils.h"

namespace txt {
Expand Down
16 changes: 8 additions & 8 deletions third_party/txt/benchmarks/paragraph_benchmarks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@
#include <minikin/Layout.h>
#include "lib/ftl/command_line.h"
#include "lib/ftl/logging.h"
#include "lib/txt/libs/minikin/LayoutUtils.h"
#include "lib/txt/src/font_collection.h"
#include "lib/txt/src/font_skia.h"
#include "lib/txt/src/font_style.h"
#include "lib/txt/src/font_weight.h"
#include "lib/txt/src/paragraph.h"
#include "lib/txt/src/paragraph_builder.h"
#include "lib/txt/src/text_align.h"
#include "minikin/LayoutUtils.h"
#include "third_party/icu/source/common/unicode/unistr.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkColor.h"
#include "txt/font_collection.h"
#include "txt/font_skia.h"
#include "txt/font_style.h"
#include "txt/font_weight.h"
#include "txt/paragraph.h"
#include "txt/paragraph_builder.h"
#include "txt/text_align.h"
#include "utils.h"

namespace txt {
Expand Down
Loading

0 comments on commit aa0726f

Please sign in to comment.