Skip to content

Commit f32ef1f

Browse files
jason-simmonsksokolovskyi
authored andcommitted
Roll Abseil and remove a workaround for a Fuchsia target that was unable to build Abseil (flutter#172665)
Flutter was avoiding dependencies on Abseil's flat_hash_map library on Fuchsia because it brought in a time zone library that required the Fuchsia SDK. This PR rolls Abseil to a commit that fixes the path to the Fuchsia SDK.
1 parent f65d553 commit f32ef1f

File tree

3 files changed

+2
-53
lines changed

3 files changed

+2
-53
lines changed

DEPS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ deps = {
528528
Var('chromium_git') + '/external/github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator' + '@' + 'c788c52156f3ef7bc7ab769cb03c110a53ac8fcb',
529529

530530
'engine/src/flutter/third_party/abseil-cpp':
531-
Var('flutter_git') + '/third_party/abseil-cpp.git' + '@' + 'ff6504dc527b25fef0f3c531e7dba0ed6b69c162',
531+
Var('flutter_git') + '/third_party/abseil-cpp.git' + '@' + '182d30b2816f3fada3b7707cf9b0eb7d2e71a111',
532532

533533
# Dart packages
534534
'engine/src/flutter/third_party/pkg/archive':

engine/src/flutter/impeller/typographer/BUILD.gn

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,9 @@ impeller_component("typographer") {
3232
"../base",
3333
"../geometry",
3434
"../renderer",
35+
"//flutter/third_party/abseil-cpp/absl/container:flat_hash_map",
3536
]
3637

37-
if (!is_fuchsia) {
38-
public_deps +=
39-
[ "//flutter/third_party/abseil-cpp/absl/container:flat_hash_map" ]
40-
}
41-
4238
deps = [
4339
"//flutter/display_list:dl_path",
4440
"//flutter/fml",

engine/src/flutter/impeller/typographer/glyph_atlas.h

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,7 @@
99
#include <memory>
1010
#include <optional>
1111

12-
#include "flutter/fml/build_config.h"
13-
14-
#if defined(OS_FUCHSIA)
15-
// TODO(gaaclarke): Migrate to use absl. I couldn't get it working since absl
16-
// has special logic in its GN files for Fuchsia that I couldn't sort out.
17-
#define IMPELLER_TYPOGRAPHER_USE_STD_HASH
18-
#else
1912
#include "flutter/third_party/abseil-cpp/absl/container/flat_hash_map.h"
20-
#endif
21-
2213
#include "impeller/core/texture.h"
2314
#include "impeller/geometry/rect.h"
2415
#include "impeller/typographer/font_glyph_pair.h"
@@ -28,30 +19,6 @@ namespace impeller {
2819

2920
class FontGlyphAtlas;
3021

31-
/// Helper for AbslHashAdapter. Tallies a hash value with fml::HashCombine.
32-
template <typename T>
33-
struct AbslHashAdapterCombiner {
34-
std::size_t value = 0;
35-
36-
template <typename... Args>
37-
static AbslHashAdapterCombiner combine(AbslHashAdapterCombiner combiner,
38-
const Args&... args) {
39-
combiner.value = fml::HashCombine(combiner.value, args...);
40-
return combiner;
41-
}
42-
};
43-
44-
/// Adapts AbslHashValue functions to be used with std::unordered_map and the
45-
/// fml hash functions.
46-
template <typename T>
47-
struct AbslHashAdapter {
48-
constexpr std::size_t operator()(const T& element) const {
49-
AbslHashAdapterCombiner<T> combiner;
50-
combiner = AbslHashValue(std::move(combiner), element);
51-
return combiner.value;
52-
}
53-
};
54-
5522
struct FrameBounds {
5623
/// The bounds of the glyph within the glyph atlas.
5724
Rect atlas_bounds;
@@ -193,17 +160,10 @@ class GlyphAtlas {
193160
std::shared_ptr<Texture> texture_;
194161
size_t generation_ = 0;
195162

196-
#if defined(IMPELLER_TYPOGRAPHER_USE_STD_HASH)
197-
using FontAtlasMap = std::unordered_map<ScaledFont,
198-
FontGlyphAtlas,
199-
AbslHashAdapter<ScaledFont>,
200-
ScaledFont::Equal>;
201-
#else
202163
using FontAtlasMap = absl::flat_hash_map<ScaledFont,
203164
FontGlyphAtlas,
204165
absl::Hash<ScaledFont>,
205166
ScaledFont::Equal>;
206-
#endif
207167

208168
FontAtlasMap font_atlas_map_;
209169

@@ -291,17 +251,10 @@ class FontGlyphAtlas {
291251
private:
292252
friend class GlyphAtlas;
293253

294-
#if defined(IMPELLER_TYPOGRAPHER_USE_STD_HASH)
295-
using PositionsMap = std::unordered_map<SubpixelGlyph,
296-
FrameBounds,
297-
AbslHashAdapter<SubpixelGlyph>,
298-
SubpixelGlyph::Equal>;
299-
#else
300254
using PositionsMap = absl::flat_hash_map<SubpixelGlyph,
301255
FrameBounds,
302256
absl::Hash<SubpixelGlyph>,
303257
SubpixelGlyph::Equal>;
304-
#endif
305258

306259
PositionsMap positions_;
307260
FontGlyphAtlas(const FontGlyphAtlas&) = delete;

0 commit comments

Comments
 (0)