/frameworks/native/libs/ftl/ |
D | enum_test.cpp | 27 static_assert(ftl::enum_begin_v<E> == E::A); 28 static_assert(ftl::enum_last_v<E> == E::F); 29 static_assert(ftl::enum_size_v<E> == 6); 31 static_assert(ftl::enum_name<E::B>() == "B"); 32 static_assert(ftl::enum_name<E::ftl_last>() == "F"); 33 static_assert(ftl::enum_name(E::C).value_or("?") == "C"); 34 static_assert(ftl::enum_name(E{3}).value_or("?") == "?"); 36 static_assert(ftl::enum_name_full<E::B>() == "E::B"); 37 static_assert(ftl::enum_name_full<E::ftl_last>() == "E::F"); 38 static_assert(ftl::enum_name_full(E::C).value_or("?") == "E::C"); [all …]
|
D | non_null_test.cpp | 32 void get_length(const ftl::NonNull<std::shared_ptr<std::string>>& string_ptr, in get_length() 33 ftl::NonNull<std::size_t*> length_ptr) { in get_length() 38 using Pair = std::pair<ftl::NonNull<std::shared_ptr<int>>, std::shared_ptr<int>>; 40 Pair dupe_if(ftl::NonNull<std::unique_ptr<int>> non_null_ptr, bool condition) { in dupe_if() 44 auto non_null_shared_ptr = ftl::as_non_null(std::shared_ptr<int>(std::move(unique_ptr))); in dupe_if() 54 const auto string_ptr = ftl::as_non_null(std::make_shared<std::string>("android")); in TEST() 56 get_length(string_ptr, ftl::as_non_null(&size)); in TEST() 59 auto ptr = ftl::as_non_null(std::make_unique<int>(42)); in TEST() 69 using StringViewPtr = ftl::NonNull<const std::string_view*>; 70 constexpr StringViewPtr kApplePtr = ftl::as_non_null(&kApple); [all …]
|
D | algorithm_test.cpp | 28 const ftl::StaticVector vector = {1, 2, 3}; in TEST() 29 EXPECT_TRUE(ftl::contains(vector, 1)); in TEST() 31 EXPECT_FALSE(ftl::contains(vector, 0)); in TEST() 32 EXPECT_TRUE(ftl::contains(vector, 2)); in TEST() 33 EXPECT_TRUE(ftl::contains(vector, 3)); in TEST() 34 EXPECT_FALSE(ftl::contains(vector, 4)); in TEST() 41 const ftl::StaticVector vector = {"upside"sv, "down"sv, "cake"sv}; in TEST() 42 EXPECT_EQ(ftl::find_if(vector, [](const auto& str) { return str.front() == 'c'; }), "cake"sv); in TEST() 44 const ftl::SmallMap map = ftl::init::map<int, ftl::StaticVector<std::string_view, 3>>( in TEST() 49 EXPECT_EQ(14, ftl::find_if(map, [](const auto& pair) { in TEST() [all …]
|
D | string_test.cpp | 31 ftl::to_chars_buffer_t<> buffer; in TEST() 33 EXPECT_EQ(ftl::to_chars(buffer, 123u), "123"); in TEST() 34 EXPECT_EQ(ftl::to_chars(buffer, -42, ftl::Radix::kBin), "-0b101010"); in TEST() 35 EXPECT_EQ(ftl::to_chars(buffer, 0xcafe, ftl::Radix::kHex), "0xcafe"); in TEST() 36 EXPECT_EQ(ftl::to_chars(buffer, '*', ftl::Radix::kHex), "0x2a"); in TEST() 51 ftl::to_chars_buffer_t<T> buffer; in ToCharsTest() 53 EXPECT_EQ(ftl::to_chars(buffer, kMin, kRadix), F{}(kMin)); in ToCharsTest() 54 EXPECT_EQ(ftl::to_chars(buffer, kMax, kRadix), F{}(kMax)); in ToCharsTest() 55 EXPECT_EQ(ftl::to_chars(buffer, kNeg, kRadix), F{}(kNeg)); in ToCharsTest() 56 EXPECT_EQ(ftl::to_chars(buffer, kPos, kRadix), F{}(kPos)); in ToCharsTest() [all …]
|
D | function_test.cpp | 47 static_assert(std::is_invocable_r_v<void, ftl::Function<void()>>); 48 static_assert(std::is_trivially_copyable_v<ftl::Function<void()>>); 49 static_assert(std::is_trivially_destructible_v<ftl::Function<void()>>); 50 static_assert(std::is_trivially_copy_constructible_v<ftl::Function<void()>>); 51 static_assert(std::is_trivially_move_constructible_v<ftl::Function<void()>>); 52 static_assert(std::is_trivially_copy_assignable_v<ftl::Function<void()>>); 53 static_assert(std::is_trivially_move_assignable_v<ftl::Function<void()>>); 56 using function_traits = ftl::details::function_traits<T>; 67 static_assert(!ftl::is_function_v<KnownSizeFunctionObject<0>>); 68 static_assert(!ftl::is_function_v<std::function<void()>>); [all …]
|
D | concat_test.cpp | 25 ftl::Concat string(ftl::truncated<3>(name), ": ", -3, " dB"); in TEST() 32 EXPECT_EQ(ftl::Concat(u'a', ' ', U'b').str(), "97 98"); in TEST() 38 EXPECT_EQ(ftl::Concat(i[0], std::as_const(i[1]), u).str(), "-123"); in TEST() 42 EXPECT_EQ(ftl::Concat(b, "tt", c).str(), "falsetto"); in TEST() 47 static_assert(ftl::Concat{true, false, true}.str() == "truefalsetrue"); 48 static_assert(ftl::Concat{':', '-', ')'}.str() == ":-)"); 50 static_assert(ftl::Concat{"foo"}.str() == "foo"); 51 static_assert(ftl::Concat{ftl::truncated<3>("foobar")}.str() == "foo"); 53 constexpr ftl::Concat kConcat{"po", "trz", "ebie"}; 61 return ftl::Concat{ftl::truncated<1>("v???"), ftl::truncated<2>("ee??"), in concat() [all …]
|
D | small_map_test.cpp | 30 using ftl::SmallMap; 34 ftl::SmallMap<int, std::string, 3> map; in TEST() 38 map = ftl::init::map<int, std::string>(123, "abc")(-1)(42, 3u, '?'); in TEST() 56 EXPECT_EQ(map, SmallMap(ftl::init::map(-1, "xyz"sv)(0, "nil"sv)(42, "???"sv)(123, "abc"sv))); in TEST() 70 ftl::init::map<int, std::string>(123, "abc")(456, "def")(789, "ghi"); in TEST() 76 EXPECT_EQ(map, SmallMap(ftl::init::map(123, "abc"sv)(456, "def"sv)(789, "ghi"sv))); in TEST() 81 ftl::init::map<int, std::string>(123, "abc")(-1)(42, 3u, '?'); in TEST() 87 EXPECT_EQ(map, SmallMap(ftl::init::map(42, "???"sv)(123, "abc"sv)(-1, ""sv))); in TEST() 91 SmallMap map = ftl::init::map<int, std::string>(123, "abc")(-1)(42, 3u, '?'); in TEST() 98 EXPECT_EQ(map, SmallMap(ftl::init::map(-1, ""sv)(42, "???"sv)(123, "abc"sv))); in TEST() [all …]
|
D | future_test.cpp | 31 auto future = ftl::defer([](int x) { return x + 1; }, 99); in TEST() 35 auto future = ftl::yield(42); in TEST() 40 auto future = ftl::yield(std::move(ptr)); in TEST() 44 auto future = ftl::yield(123); in TEST() 45 ftl::Future<char> futures[] = {ftl::yield('a'), ftl::yield('b')}; in TEST() 47 ftl::Future<char> chain = ftl::Future(std::move(future)) in TEST() 74 std::packaged_task<ftl::Future<ByteVector>(ByteVector)> decrement_bytes( in TEST() 75 [](ByteVector bytes) { return ftl::defer(decrement, std::move(bytes)); }); in TEST() 84 ftl::Future(std::move(fetch)) in TEST() 96 .then([](ftl::Future<ByteVector> bytes) { return bytes; }) in TEST() [all …]
|
D | expected_test.cpp | 28 using IntExp = ftl::Expected<int, std::errc>; 29 using StringExp = ftl::Expected<std::string, std::errc>; 49 const auto exp = StringExp(ftl::Unexpected(std::errc::invalid_argument)); in TEST() 56 EXPECT_FALSE(IntExp(ftl::Unexpected(std::errc::io_error)).has_error([](auto) { return false; })); in TEST() 58 EXPECT_TRUE(StringExp(ftl::Unexpected(std::errc::permission_denied)).has_error([](auto e) { in TEST() 64 EXPECT_EQ(ftl::Optional(-1), IntExp(-1).value_opt()); in TEST() 65 EXPECT_EQ(std::nullopt, IntExp(ftl::Unexpected(std::errc::broken_pipe)).value_opt()); in TEST() 69 EXPECT_EQ(ftl::Optional('f'), in TEST() 75 EXPECT_EQ(ftl::Optional(6), std::move(exp).value_opt().transform(&std::string::length)); in TEST() 104 void uppercase(char& c, ftl::Optional<char> opt) { in uppercase() [all …]
|
D | mixins_test.cpp | 30 struct Id : ftl::Constructible<Id, std::int32_t>, ftl::Equatable<Id> { 36 struct Color : ftl::DefaultConstructible<Color, std::uint8_t>, 37 ftl::Equatable<Color>, 38 ftl::Orderable<Color> { 43 static_assert(ftl::to_underlying(Color(-1)) == 255u); 46 struct Sequence : ftl::DefaultConstructible<Sequence, std::int8_t, -1>, 47 ftl::Equatable<Sequence>, 48 ftl::Orderable<Sequence>, 49 ftl::Incrementable<Sequence> { 55 struct Timeout : ftl::DefaultConstructible<Timeout, std::chrono::seconds, 10>, [all …]
|
D | hash_test.cpp | 26 EXPECT_EQ(11160318154034397263ull, (ftl::stable_hash({}))); in TEST() 32 EXPECT_FALSE(ftl::stable_hash(string + '\n')); in TEST() 34 EXPECT_EQ(6278090252846864564ull, ftl::stable_hash(std::string_view(string).substr(0, 8))); in TEST() 35 EXPECT_EQ(1883356980931444616ull, ftl::stable_hash(std::string_view(string).substr(0, 16))); in TEST() 36 EXPECT_EQ(8073093283835059304ull, ftl::stable_hash(std::string_view(string).substr(0, 32))); in TEST() 37 EXPECT_EQ(18197365392429149980ull, ftl::stable_hash(string)); in TEST()
|
D | optional_test.cpp | 35 using ftl::Optional; 36 using ftl::StaticVector; 68 EXPECT_EQ("0b100"s, Optional(4).transform(std::bind(ftl::to_string<int>, _1, ftl::Radix::kBin))); in TEST() 95 EXPECT_EQ(ftl::unit, opt.transform(ftl::unit_fn([](std::string& str) { str.pop_back(); }))); in TEST() 210 using CharExp = ftl::Expected<char, std::errc>; in TEST() 211 using StringExp = ftl::Expected<std::string, std::errc>; in TEST() 214 EXPECT_EQ(CharExp(ftl::Unexpected(std::errc::broken_pipe)), in TEST() 218 EXPECT_EQ(StringExp(ftl::Unexpected(std::errc::protocol_error)), in TEST()
|
D | shared_mutex_test.cpp | 24 ftl::SharedMutex mutex; in TEST() 31 ftl::SharedMutex mutex; in TEST() 43 ftl::SharedMutex mutex; in TEST()
|
D | static_vector_test.cpp | 29 using ftl::StaticVector; 33 ftl::StaticVector<char, 3> vector; in TEST() 46 EXPECT_EQ(vector, (ftl::StaticVector{'c', 'b'})); in TEST() 52 vector = ftl::StaticVector(array); in TEST() 53 EXPECT_EQ(vector, (ftl::StaticVector{'h', 'i', '\0'})); in TEST() 55 ftl::StaticVector strings = ftl::init::list<std::string>("abc")("123456", 3u)(3u, '?'); in TEST() 102 ftl::init::list<std::string>("redolent", 3u)("velveteen", 6u)("cakewalk", 4u); in TEST() 112 StaticVector vector = ftl::init::list<std::string>(copy.c_str())(std::move(move))(list); in TEST() 137 StaticVector<String, 3> vector(ftl::kIteratorRange, strings, strings + 3); in TEST() 275 StaticVector strings = ftl::init::list<std::string>()()()("cake")("velvet")("red")(); in TEST() [all …]
|
/frameworks/native/libs/gui/include/gui/ |
D | PidUid.h | 26 struct Pid : ftl::Constructible<Pid, pid_t>, ftl::Equatable<Pid>, ftl::Orderable<Pid> { 31 constexpr auto val() const { return ftl::to_underlying(*this); } in val() 42 struct Uid : ftl::Constructible<Uid, uid_t>, ftl::Equatable<Uid>, ftl::Orderable<Uid> { 47 constexpr auto val() const { return ftl::to_underlying(*this); } in val()
|
/frameworks/native/libs/ui/include/ui/ |
D | DisplayMap.h | 28 using DisplayMap = ftl::SmallMap<Key, Value, kDisplayCapacity>; 32 using PhysicalDisplayMap = ftl::SmallMap<Key, Value, kPhysicalDisplayCapacity>; 35 using DisplayVector = ftl::SmallVector<T, kDisplayCapacity>; 38 using PhysicalDisplayVector = ftl::SmallVector<T, kPhysicalDisplayCapacity>;
|
D | LogicalDisplayId.h | 28 struct LogicalDisplayId : ftl::Constructible<LogicalDisplayId, int32_t>, 29 ftl::Equatable<LogicalDisplayId>, 30 ftl::Orderable<LogicalDisplayId> { 33 constexpr auto val() const { return ftl::to_underlying(*this); } in val()
|
/frameworks/native/services/surfaceflinger/ |
D | RefreshRateOverlay.h | 52 static std::unique_ptr<RefreshRateOverlay> create(FpsRange, ftl::Flags<Features>); 62 RefreshRateOverlay(ConstructorTag, FpsRange, ftl::Flags<Features>); 70 ui::Transform::RotationFlags, ftl::Flags<Features>); 90 using BufferCache = ftl::SmallMap<Key, Buffers, 9>; 99 const ftl::Flags<Features> mFeatures;
|
D | RenderAreaBuilder.h | 39 ftl::Flags<RenderArea::Options> options; 43 ftl::Flags<RenderArea::Options> options) in RenderAreaBuilder() 52 ftl::Flags<RenderArea::Options> options) in DisplayRenderAreaBuilder() 65 bool childrenOnly, ftl::Flags<RenderArea::Options> options) in LayerRenderAreaBuilder()
|
/frameworks/native/services/surfaceflinger/Scheduler/include/scheduler/ |
D | VsyncId.h | 28 struct VsyncId : ftl::DefaultConstructible<VsyncId, int64_t, -1>, 29 ftl::Incrementable<VsyncId>, 30 ftl::Equatable<VsyncId> {
|
/frameworks/native/services/surfaceflinger/CompositionEngine/tests/planner/ |
D | LayerStateTest.cpp | 102 EXPECT_EQ(ftl::Flags<LayerStateField>(LayerStateField::None), lhs.getDifferingFields(rhs)); in verifyUniqueDifferingFields() 103 EXPECT_EQ(ftl::Flags<LayerStateField>(LayerStateField::None), rhs.getDifferingFields(lhs)); in verifyUniqueDifferingFields() 107 ftl::Flags<LayerStateField> fields) { in verifyNonUniqueDifferingFields() 167 ftl::Flags<LayerStateField> updates = mLayerState->update(&newOutputLayer); in TEST_F() 169 EXPECT_EQ(ftl::Flags<LayerStateField>(LayerStateField::Id), updates); in TEST_F() 212 ftl::Flags<LayerStateField> updates = mLayerState->update(&newOutputLayer); in TEST_F() 214 EXPECT_EQ(ftl::Flags<LayerStateField>(LayerStateField::Name), updates); in TEST_F() 261 ftl::Flags<LayerStateField> updates = mLayerState->update(&newOutputLayer); in TEST_F() 263 EXPECT_EQ(ftl::Flags<LayerStateField>(LayerStateField::DisplayFrame), updates); in TEST_F() 333 ftl::Flags<LayerStateField> updates = mLayerState->update(&newOutputLayer); in TEST_F() [all …]
|
/frameworks/native/services/surfaceflinger/Scheduler/ |
D | VsyncSchedule.cpp | 59 VsyncSchedule::VsyncSchedule(ftl::NonNull<DisplayModePtr> modePtr, FeatureFlags features, in VsyncSchedule() 92 ftl::Optional<TimePoint> lastVsyncOpt) const { in vsyncDeadlineAfter() 103 dumper.dump("hwVsyncState", ftl::enum_string(mHwVsyncState)); in dump() 105 ftl::FakeGuard guard(kMainThreadContext); in dump() 106 dumper.dump("pendingHwVsyncState", ftl::enum_string(mPendingHwVsyncState)); in dump() 117 VsyncSchedule::TrackerPtr VsyncSchedule::createTracker(ftl::NonNull<DisplayModePtr> modePtr) { in createTracker() 153 void VsyncSchedule::onDisplayModeChanged(ftl::NonNull<DisplayModePtr> modePtr, bool force) { in onDisplayModeChanged() 159 bool VsyncSchedule::addResyncSample(TimePoint timestamp, ftl::Optional<Period> hwcVsyncPeriod) { in addResyncSample()
|
D | VsyncSchedule.h | 60 VsyncSchedule(ftl::NonNull<DisplayModePtr> modePtr, FeatureFlags, RequestHardwareVsync); 66 ftl::Optional<TimePoint> lastVsyncOpt = {}) const override; 76 void onDisplayModeChanged(ftl::NonNull<DisplayModePtr>, bool force); 81 bool addResyncSample(TimePoint timestamp, ftl::Optional<Period> hwcVsyncPeriod); 130 static TrackerPtr createTracker(ftl::NonNull<DisplayModePtr> modePtr);
|
D | RefreshRateStats.h | 77 using TotalTimes = ftl::SmallMap<std::string, std::chrono::milliseconds, 3>; 85 TotalTimes totalTimes = ftl::init::map("ScreenOff", mScreenOffTime); in getTotalTimes() 92 .or_else(ftl::static_ref<std::chrono::milliseconds>([] { in getTotalTimes() 130 .or_else(ftl::static_ref<std::chrono::milliseconds>([] { in flushTime() 162 ftl::SmallMap<Fps, std::chrono::milliseconds, 2, FpsApproxEqual> mFpsTotalTimes;
|
/frameworks/native/services/surfaceflinger/DisplayHardware/ |
D | DisplayMode.h | 49 struct DisplayModeId : ftl::DefaultConstructible<DisplayModeId, ui::DisplayModeId>, 50 ftl::Incrementable<DisplayModeId>, 51 ftl::Equatable<DisplayModeId>, 52 ftl::Orderable<DisplayModeId> { 56 using DisplayModes = ftl::SmallMap<DisplayModeId, DisplayModePtr, 3>; 193 ftl::to_underlying(mode.getId()), mode.getHwcId(), mode.getWidth(), in to_string()
|