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

0 commit comments

Comments
 (0)