Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b3750c50 authored by Angel Aguayo's avatar Angel Aguayo Committed by Android (Google) Code Review
Browse files

Merge "Consolidate WpHash declaration to a common file"

parents 6bffb5ee b398ee21
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@

#include "Clock.h"
#include "FrameTimeline/FrameTimeline.h"
#include "WpHash.h"

namespace android {

@@ -50,11 +51,6 @@ public:

private:
    mutable std::mutex mMutex;
    struct WpHash {
        size_t operator()(const wp<IBinder>& p) const {
            return std::hash<IBinder*>()(p.unsafe_get());
        }
    };

    struct TrackedListener {
        sp<gui::IFpsListener> listener;
+2 −5
Original line number Diff line number Diff line
@@ -22,6 +22,8 @@

#include <unordered_map>

#include "WpHash.h"

namespace android {

class HdrLayerInfoReporter final : public IBinder::DeathRecipient {
@@ -63,11 +65,6 @@ public:

private:
    mutable std::mutex mMutex;
    struct WpHash {
        size_t operator()(const wp<IBinder>& p) const {
            return std::hash<IBinder*>()(p.unsafe_get());
        }
    };

    struct TrackedListener {
        sp<gui::IHdrLayerInfoListener> listener;
+1 −5
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@
#include <unordered_map>

#include "Scheduler/OneShotTimer.h"
#include "WpHash.h"

namespace android {

@@ -88,11 +89,6 @@ private:
        sp<IRegionSamplingListener> listener;
    };

    struct WpHash {
        size_t operator()(const wp<IBinder>& p) const {
            return std::hash<IBinder*>()(p.unsafe_get());
        }
    };
    std::vector<float> sampleBuffer(
            const sp<GraphicBuffer>& buffer, const Point& leftTop,
            const std::vector<RegionSamplingThread::Descriptor>& descriptors, uint32_t orientation);
+2 −6
Original line number Diff line number Diff line
@@ -25,6 +25,8 @@
#include <binder/IBinder.h>
#include <utils/Timers.h>

#include "../WpHash.h"

namespace android::scheduler {

// State machine controlled by transaction flags. VsyncModulator switches to early phase offsets
@@ -124,12 +126,6 @@ private:
    using Schedule = TransactionSchedule;
    std::atomic<Schedule> mTransactionSchedule = Schedule::Late;

    struct WpHash {
        size_t operator()(const wp<IBinder>& p) const {
            return std::hash<IBinder*>()(p.unsafe_get());
        }
    };

    std::unordered_set<wp<IBinder>, WpHash> mEarlyWakeupRequests GUARDED_BY(mMutex);
    std::atomic<bool> mRefreshRateChangePending = false;

+2 −5
Original line number Diff line number Diff line
@@ -22,6 +22,8 @@

#include <unordered_map>

#include "WpHash.h"

namespace android {

class Layer;
@@ -54,11 +56,6 @@ public:

private:
    mutable std::mutex mMutex;
    struct WpHash {
        size_t operator()(const wp<IBinder>& p) const {
            return std::hash<IBinder*>()(p.unsafe_get());
        }
    };

    std::unordered_map<wp<IBinder>, sp<gui::ITunnelModeEnabledListener>, WpHash> mListeners
            GUARDED_BY(mMutex);
Loading