Loading include/android/performance_hint.h +7 −6 Original line number Diff line number Diff line Loading @@ -233,11 +233,11 @@ int APerformanceHint_setPreferPowerEfficiency( * @param workDuration The {@link AWorkDuration} structure of times the thread group took to * complete its last task in nanoseconds breaking down into different components. * * The work period start timestamp, actual total duration and actual CPU duration must be * positive. * The work period start timestamp and actual total duration must be greater than zero. * * The actual GPU duration must be non-negative. If the actual GPU duration is 0, it means * the actual GPU duration is not measured. * The actual CPU and GPU durations must be greater than or equal to zero, and at least one * of them must be greater than zero. When one of them is equal to zero, it means that type * of work was not measured for this workload. * * @return 0 on success. * EINVAL if any duration is an invalid number. Loading Loading @@ -289,7 +289,8 @@ void AWorkDuration_setActualTotalDurationNanos(AWorkDuration* _Nonnull aWorkDura * * @param aWorkDuration The {@link AWorkDuration} created by calling {@link AWorkDuration_create()} * @param actualCpuDurationNanos The actual CPU work duration in nanoseconds. This number must be * greater than zero. * greater than or equal to zero. If it is equal to zero, that means the CPU was not * measured. */ void AWorkDuration_setActualCpuDurationNanos(AWorkDuration* _Nonnull aWorkDuration, int64_t actualCpuDurationNanos) __INTRODUCED_IN(__ANDROID_API_V__); Loading @@ -299,7 +300,7 @@ void AWorkDuration_setActualCpuDurationNanos(AWorkDuration* _Nonnull aWorkDurati * * @param aWorkDuration The {@link AWorkDuration} created by calling {@link AWorkDuration_create()}. * @param actualGpuDurationNanos The actual GPU work duration in nanoseconds, the number must be * non-negative. If the actual GPU duration is 0, it means the actual GPU duration is * greater than or equal to zero. If it is equal to zero, that means the GPU was not * measured. */ void AWorkDuration_setActualGpuDurationNanos(AWorkDuration* _Nonnull aWorkDuration, Loading include/ftl/fake_guard.h +1 −2 Original line number Diff line number Diff line Loading @@ -85,6 +85,5 @@ struct [[clang::scoped_lockable]] FakeGuard final { #define FTL_MAKE_FAKE_GUARD(arg1, arg2, guard, ...) guard // The void argument suppresses a warning about zero variadic macro arguments. #define FTL_FAKE_GUARD(...) \ FTL_MAKE_FAKE_GUARD(__VA_ARGS__, FTL_FAKE_GUARD2, FTL_FAKE_GUARD1, void)(__VA_ARGS__) FTL_MAKE_FAKE_GUARD(__VA_ARGS__, FTL_FAKE_GUARD2, FTL_FAKE_GUARD1, )(__VA_ARGS__) include/ftl/small_map.h +18 −4 Original line number Diff line number Diff line Loading @@ -107,12 +107,20 @@ class SmallMap final { template <typename Q, typename W, std::size_t M, typename E> SmallMap(SmallMap<Q, W, M, E> other) : map_(std::move(other.map_)) {} static constexpr size_type static_capacity() { return N; } size_type max_size() const { return map_.max_size(); } size_type size() const { return map_.size(); } bool empty() const { return map_.empty(); } // Returns whether the map is backed by static or dynamic storage. bool dynamic() const { return map_.dynamic(); } bool dynamic() const { if constexpr (static_capacity() > 0) { return map_.dynamic(); } else { return true; } } iterator begin() { return map_.begin(); } const_iterator begin() const { return cbegin(); } Loading Loading @@ -171,9 +179,15 @@ class SmallMap final { return {it, false}; } auto& ref = map_.emplace_back(std::piecewise_construct, std::forward_as_tuple(key), decltype(auto) ref_or_it = map_.emplace_back(std::piecewise_construct, std::forward_as_tuple(key), std::forward_as_tuple(std::forward<Args>(args)...)); return {&ref, true}; if constexpr (static_capacity() > 0) { return {&ref_or_it, true}; } else { return {ref_or_it, true}; } } // Replaces a mapping if it exists, and returns an iterator to it. Returns the end() iterator Loading include/ftl/small_vector.h +9 −10 Original line number Diff line number Diff line Loading @@ -124,30 +124,29 @@ class SmallVector final : details::ArrayTraits<T>, details::ArrayComparators<Sma DISPATCH(size_type, size, const) DISPATCH(bool, empty, const) // noexcept to suppress warning about zero variadic macro arguments. DISPATCH(iterator, begin, noexcept) DISPATCH(iterator, begin, ) DISPATCH(const_iterator, begin, const) DISPATCH(const_iterator, cbegin, const) DISPATCH(iterator, end, noexcept) DISPATCH(iterator, end, ) DISPATCH(const_iterator, end, const) DISPATCH(const_iterator, cend, const) DISPATCH(reverse_iterator, rbegin, noexcept) DISPATCH(reverse_iterator, rbegin, ) DISPATCH(const_reverse_iterator, rbegin, const) DISPATCH(const_reverse_iterator, crbegin, const) DISPATCH(reverse_iterator, rend, noexcept) DISPATCH(reverse_iterator, rend, ) DISPATCH(const_reverse_iterator, rend, const) DISPATCH(const_reverse_iterator, crend, const) DISPATCH(iterator, last, noexcept) DISPATCH(iterator, last, ) DISPATCH(const_iterator, last, const) DISPATCH(reference, front, noexcept) DISPATCH(reference, front, ) DISPATCH(const_reference, front, const) DISPATCH(reference, back, noexcept) DISPATCH(reference, back, ) DISPATCH(const_reference, back, const) reference operator[](size_type i) { Loading Loading @@ -211,13 +210,13 @@ class SmallVector final : details::ArrayTraits<T>, details::ArrayComparators<Sma // // The last() and end() iterators are invalidated. // DISPATCH(void, pop_back, noexcept) DISPATCH(void, pop_back, ) // Removes all elements. // // All iterators are invalidated. // DISPATCH(void, clear, noexcept) DISPATCH(void, clear, ) #undef DISPATCH Loading include/input/InputTransport.h +10 −1 Original line number Diff line number Diff line Loading @@ -300,6 +300,15 @@ public: void copyTo(android::os::InputChannelCore& outChannel) const; /** * Similar to "copyTo", but it takes ownership of the provided InputChannel (and after this is * called, it destroys it). * @param from the InputChannel that should be converted to InputChannelCore * @param outChannel the pre-allocated InputChannelCore to which to transfer the 'from' channel */ static void moveChannel(std::unique_ptr<InputChannel> from, android::os::InputChannelCore& outChannel); /** * The connection token is used to identify the input connection, i.e. * the pair of input channels that were created simultaneously. Input channels Loading Loading @@ -333,7 +342,7 @@ public: ~InputPublisher(); /* Gets the underlying input channel. */ inline std::shared_ptr<InputChannel> getChannel() const { return mChannel; } inline InputChannel& getChannel() const { return *mChannel; } /* Publishes a key event to the input channel. * Loading Loading
include/android/performance_hint.h +7 −6 Original line number Diff line number Diff line Loading @@ -233,11 +233,11 @@ int APerformanceHint_setPreferPowerEfficiency( * @param workDuration The {@link AWorkDuration} structure of times the thread group took to * complete its last task in nanoseconds breaking down into different components. * * The work period start timestamp, actual total duration and actual CPU duration must be * positive. * The work period start timestamp and actual total duration must be greater than zero. * * The actual GPU duration must be non-negative. If the actual GPU duration is 0, it means * the actual GPU duration is not measured. * The actual CPU and GPU durations must be greater than or equal to zero, and at least one * of them must be greater than zero. When one of them is equal to zero, it means that type * of work was not measured for this workload. * * @return 0 on success. * EINVAL if any duration is an invalid number. Loading Loading @@ -289,7 +289,8 @@ void AWorkDuration_setActualTotalDurationNanos(AWorkDuration* _Nonnull aWorkDura * * @param aWorkDuration The {@link AWorkDuration} created by calling {@link AWorkDuration_create()} * @param actualCpuDurationNanos The actual CPU work duration in nanoseconds. This number must be * greater than zero. * greater than or equal to zero. If it is equal to zero, that means the CPU was not * measured. */ void AWorkDuration_setActualCpuDurationNanos(AWorkDuration* _Nonnull aWorkDuration, int64_t actualCpuDurationNanos) __INTRODUCED_IN(__ANDROID_API_V__); Loading @@ -299,7 +300,7 @@ void AWorkDuration_setActualCpuDurationNanos(AWorkDuration* _Nonnull aWorkDurati * * @param aWorkDuration The {@link AWorkDuration} created by calling {@link AWorkDuration_create()}. * @param actualGpuDurationNanos The actual GPU work duration in nanoseconds, the number must be * non-negative. If the actual GPU duration is 0, it means the actual GPU duration is * greater than or equal to zero. If it is equal to zero, that means the GPU was not * measured. */ void AWorkDuration_setActualGpuDurationNanos(AWorkDuration* _Nonnull aWorkDuration, Loading
include/ftl/fake_guard.h +1 −2 Original line number Diff line number Diff line Loading @@ -85,6 +85,5 @@ struct [[clang::scoped_lockable]] FakeGuard final { #define FTL_MAKE_FAKE_GUARD(arg1, arg2, guard, ...) guard // The void argument suppresses a warning about zero variadic macro arguments. #define FTL_FAKE_GUARD(...) \ FTL_MAKE_FAKE_GUARD(__VA_ARGS__, FTL_FAKE_GUARD2, FTL_FAKE_GUARD1, void)(__VA_ARGS__) FTL_MAKE_FAKE_GUARD(__VA_ARGS__, FTL_FAKE_GUARD2, FTL_FAKE_GUARD1, )(__VA_ARGS__)
include/ftl/small_map.h +18 −4 Original line number Diff line number Diff line Loading @@ -107,12 +107,20 @@ class SmallMap final { template <typename Q, typename W, std::size_t M, typename E> SmallMap(SmallMap<Q, W, M, E> other) : map_(std::move(other.map_)) {} static constexpr size_type static_capacity() { return N; } size_type max_size() const { return map_.max_size(); } size_type size() const { return map_.size(); } bool empty() const { return map_.empty(); } // Returns whether the map is backed by static or dynamic storage. bool dynamic() const { return map_.dynamic(); } bool dynamic() const { if constexpr (static_capacity() > 0) { return map_.dynamic(); } else { return true; } } iterator begin() { return map_.begin(); } const_iterator begin() const { return cbegin(); } Loading Loading @@ -171,9 +179,15 @@ class SmallMap final { return {it, false}; } auto& ref = map_.emplace_back(std::piecewise_construct, std::forward_as_tuple(key), decltype(auto) ref_or_it = map_.emplace_back(std::piecewise_construct, std::forward_as_tuple(key), std::forward_as_tuple(std::forward<Args>(args)...)); return {&ref, true}; if constexpr (static_capacity() > 0) { return {&ref_or_it, true}; } else { return {ref_or_it, true}; } } // Replaces a mapping if it exists, and returns an iterator to it. Returns the end() iterator Loading
include/ftl/small_vector.h +9 −10 Original line number Diff line number Diff line Loading @@ -124,30 +124,29 @@ class SmallVector final : details::ArrayTraits<T>, details::ArrayComparators<Sma DISPATCH(size_type, size, const) DISPATCH(bool, empty, const) // noexcept to suppress warning about zero variadic macro arguments. DISPATCH(iterator, begin, noexcept) DISPATCH(iterator, begin, ) DISPATCH(const_iterator, begin, const) DISPATCH(const_iterator, cbegin, const) DISPATCH(iterator, end, noexcept) DISPATCH(iterator, end, ) DISPATCH(const_iterator, end, const) DISPATCH(const_iterator, cend, const) DISPATCH(reverse_iterator, rbegin, noexcept) DISPATCH(reverse_iterator, rbegin, ) DISPATCH(const_reverse_iterator, rbegin, const) DISPATCH(const_reverse_iterator, crbegin, const) DISPATCH(reverse_iterator, rend, noexcept) DISPATCH(reverse_iterator, rend, ) DISPATCH(const_reverse_iterator, rend, const) DISPATCH(const_reverse_iterator, crend, const) DISPATCH(iterator, last, noexcept) DISPATCH(iterator, last, ) DISPATCH(const_iterator, last, const) DISPATCH(reference, front, noexcept) DISPATCH(reference, front, ) DISPATCH(const_reference, front, const) DISPATCH(reference, back, noexcept) DISPATCH(reference, back, ) DISPATCH(const_reference, back, const) reference operator[](size_type i) { Loading Loading @@ -211,13 +210,13 @@ class SmallVector final : details::ArrayTraits<T>, details::ArrayComparators<Sma // // The last() and end() iterators are invalidated. // DISPATCH(void, pop_back, noexcept) DISPATCH(void, pop_back, ) // Removes all elements. // // All iterators are invalidated. // DISPATCH(void, clear, noexcept) DISPATCH(void, clear, ) #undef DISPATCH Loading
include/input/InputTransport.h +10 −1 Original line number Diff line number Diff line Loading @@ -300,6 +300,15 @@ public: void copyTo(android::os::InputChannelCore& outChannel) const; /** * Similar to "copyTo", but it takes ownership of the provided InputChannel (and after this is * called, it destroys it). * @param from the InputChannel that should be converted to InputChannelCore * @param outChannel the pre-allocated InputChannelCore to which to transfer the 'from' channel */ static void moveChannel(std::unique_ptr<InputChannel> from, android::os::InputChannelCore& outChannel); /** * The connection token is used to identify the input connection, i.e. * the pair of input channels that were created simultaneously. Input channels Loading Loading @@ -333,7 +342,7 @@ public: ~InputPublisher(); /* Gets the underlying input channel. */ inline std::shared_ptr<InputChannel> getChannel() const { return mChannel; } inline InputChannel& getChannel() const { return *mChannel; } /* Publishes a key event to the input channel. * Loading