Skip to content

Commit 6da61e7

Browse files
committed
Remove FML dependency on geometry, tessellator (flutter#59)
* Remove FML dependency on geometry, tessellator * update readme
1 parent 0936dfa commit 6da61e7

File tree

16 files changed

+63
-25
lines changed

16 files changed

+63
-25
lines changed

impeller/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ Impeller itself may not depend on anything in `//flutter` except `//flutter/fml`
3838
and `flutter/display_list`. FML is a base library for C++ projects and Impeller
3939
implements the display list dispatcher interface to make it easy for Flutter to
4040
swap the renderer with Impeller. Impeller is meant to be used by the Flow
41-
(`//flutter/flow`) subsystem. Hence the name.
41+
(`//flutter/flow`) subsystem. Hence the name. The tessellator and geometry
42+
libraries are exceptions - they unconditionally may not depend on anything from
43+
`//flutter`.
4244

4345
An overview of the major sub-frameworks, their responsibilities, and, relative
4446
states of completion:

impeller/aiks/BUILD.gn

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ impeller_component("aiks") {
2727
"../entity",
2828
"../geometry",
2929
]
30+
31+
deps = [
32+
"//flutter/fml",
33+
34+
# FML depends on the Dart VM for tracing and getting the current
35+
# timepoint.
36+
"//flutter/runtime:libdart",
37+
]
3038
}
3139

3240
impeller_component("aiks_unittests") {

impeller/archivist/BUILD.gn

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,14 @@ impeller_component("archivist") {
3131

3232
public_deps = [ "../base" ]
3333

34-
deps = [ "//third_party/sqlite" ]
34+
deps = [
35+
"//flutter/fml",
36+
37+
# FML depends on the Dart VM for tracing and getting the current
38+
# timepoint.
39+
"//flutter/runtime:libdart",
40+
"//third_party/sqlite",
41+
]
3542
}
3643

3744
impeller_component("archivist_unittests") {

impeller/base/BUILD.gn

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ impeller_component("base") {
1818
"validation.cc",
1919
"validation.h",
2020
]
21+
22+
deps = [
23+
"//flutter/fml",
24+
25+
# FML depends on the Dart VM for tracing and getting the current
26+
# timepoint.
27+
"//flutter/runtime:libdart",
28+
]
2129
}
2230

2331
impeller_component("base_unittests") {

impeller/base/config.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
#pragma once
66

7-
#include "flutter/fml/build_config.h"
8-
97
#if defined(__GNUC__) || defined(__clang__)
108
#define IMPELLER_COMPILER_CLANG 1
119
#else // defined(__GNUC__) || defined(__clang__)

impeller/entity/BUILD.gn

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@ impeller_component("entity") {
5454
"../renderer",
5555
"../typographer",
5656
]
57+
58+
59+
deps = [
60+
"//flutter/fml",
61+
62+
# FML depends on the Dart VM for tracing and getting the current
63+
# timepoint.
64+
"//flutter/runtime:libdart",
65+
]
5766
}
5867

5968
impeller_component("entity_unittests") {

impeller/geometry/matrix_decomposition.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
#pragma once
66

7-
#include "flutter/fml/macros.h"
87
#include "impeller/geometry/quaternion.h"
98
#include "impeller/geometry/scalar.h"
109
#include "impeller/geometry/shear.h"

impeller/geometry/path.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
#include <optional>
88

9-
#include "flutter/fml/logging.h"
109
#include "impeller/geometry/path_component.h"
1110

1211
namespace impeller {
@@ -19,8 +18,6 @@ Path::~Path() = default;
1918

2019
std::tuple<size_t, size_t> Path::Polyline::GetContourPointBounds(
2120
size_t contour_index) const {
22-
FML_DCHECK(contour_index < contours.size());
23-
2421
const size_t start_index = contours[contour_index].start_index;
2522
const size_t end_index = (contour_index >= contours.size() - 1)
2623
? points.size()

impeller/geometry/path_builder.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
#pragma once
66

7-
#include "flutter/fml/macros.h"
87
#include "impeller/geometry/path.h"
98
#include "impeller/geometry/rect.h"
109
#include "impeller/geometry/scalar.h"
@@ -109,7 +108,8 @@ class PathBuilder {
109108

110109
Point ReflectedCubicControlPoint1() const;
111110

112-
FML_DISALLOW_COPY_AND_ASSIGN(PathBuilder);
111+
PathBuilder(const PathBuilder&) = delete;
112+
PathBuilder& operator=(const PathBuilder&&) = delete;
113113
};
114114

115115
} // namespace impeller

impeller/geometry/scalar.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#include <cfloat>
88
#include <valarray>
99

10-
#include "flutter/fml/logging.h"
1110
#include "impeller/geometry/constants.h"
1211

1312
namespace impeller {
@@ -17,7 +16,6 @@ using Scalar = float;
1716
constexpr inline bool ScalarNearlyEqual(Scalar x,
1817
Scalar y,
1918
Scalar tolerance = 1e-3) {
20-
FML_DCHECK(tolerance >= 0);
2119
return std::abs(x - y) <= tolerance;
2220
}
2321

impeller/image/BUILD.gn

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,19 @@ impeller_component("image") {
1717
"decompressed_image.cc",
1818
]
1919

20-
deps = [ "//third_party/skia" ]
21-
2220
public_deps = [
2321
"../base",
2422
"../geometry",
2523
]
24+
25+
deps = [
26+
"//flutter/fml",
27+
28+
# FML depends on the Dart VM for tracing and getting the current
29+
# timepoint.
30+
"//flutter/runtime:libdart",
31+
"//third_party/skia",
32+
]
2633
}
2734

2835
impeller_component("image_unittests") {

impeller/renderer/BUILD.gn

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,14 @@ impeller_component("renderer") {
110110
"../tessellator",
111111
]
112112

113+
deps = [
114+
"//flutter/fml",
115+
116+
# FML depends on the Dart VM for tracing and getting the current
117+
# timepoint.
118+
"//flutter/runtime:libdart",
119+
]
120+
113121
frameworks = [ "Metal.framework" ]
114122
}
115123

impeller/tessellator/BUILD.gn

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ shared_library("tessellator_shared") {
2727

2828
deps = [
2929
"../geometry",
30-
"//flutter/fml",
3130
"//third_party/libtess2",
3231
]
3332
}

impeller/tessellator/tessellator.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
#include "impeller/tessellator/tessellator.h"
66

7-
#include "flutter/fml/logging.h"
8-
#include "flutter/fml/trace_event.h"
97
#include "third_party/libtess2/Include/tesselator.h"
108

119
namespace impeller {
@@ -38,7 +36,6 @@ static void DestroyTessellator(TESStesselator* tessellator) {
3836

3937
bool Tessellator::Tessellate(const Path::Polyline& polyline,
4038
VertexCallback callback) const {
41-
TRACE_EVENT0("impeller", "Tessellator::Tessellate");
4239
if (!callback) {
4340
return false;
4441
}

impeller/tools/impeller.gni

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,6 @@ template("impeller_component") {
3636
cflags_objcc += flutter_cflags_objcc_arc + objc_warning_flags
3737

3838
public_configs += [ "//flutter/impeller:impeller_public_config" ]
39-
40-
deps += [
41-
"//flutter/fml",
42-
43-
# For tracing, seems to be pulled in by FML. Must be removed.
44-
"//flutter/runtime:libdart",
45-
]
4639
}
4740
}
4841

impeller/typographer/BUILD.gn

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ impeller_component("typographer") {
3636
"../renderer",
3737
"//third_party/skia",
3838
]
39+
40+
deps = [
41+
"//flutter/fml",
42+
43+
# FML depends on the Dart VM for tracing and getting the current
44+
# timepoint.
45+
"//flutter/runtime:libdart",
46+
]
3947
}
4048

4149
impeller_component("typographer_unittests") {

0 commit comments

Comments
 (0)