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

Commit 1d4c6a66 authored by Kevin DuBois's avatar Kevin DuBois
Browse files

SF: clean up casting around histogram reporting

Takes advantage of the new binder Uint64Vector send/receive
capabilites to clean up a messy cast in the display histogram
functionality.

Fixes: 120504999
Test: boot
Test: libgui_test --gtest_filter="DisplayedContent*"

Change-Id: Ie8fe724d4d81999777e6ce1e8a610f55e0070d37
parent 2f82d5b8
Loading
Loading
Loading
Loading
+8 −16
Original line number Diff line number Diff line
@@ -675,23 +675,19 @@ public:
            return result;
        }

        result = reply.readInt64Vector(
                reinterpret_cast<std::vector<int64_t>*>(&outStats->component_0_sample));
        result = reply.readUint64Vector(&outStats->component_0_sample);
        if (result != NO_ERROR) {
            return result;
        }
        result = reply.readInt64Vector(
                reinterpret_cast<std::vector<int64_t>*>(&outStats->component_1_sample));
        result = reply.readUint64Vector(&outStats->component_1_sample);
        if (result != NO_ERROR) {
            return result;
        }
        result = reply.readInt64Vector(
                reinterpret_cast<std::vector<int64_t>*>(&outStats->component_2_sample));
        result = reply.readUint64Vector(&outStats->component_2_sample);
        if (result != NO_ERROR) {
            return result;
        }
        result = reply.readInt64Vector(
                reinterpret_cast<std::vector<int64_t>*>(&outStats->component_3_sample));
        result = reply.readUint64Vector(&outStats->component_3_sample);
        return result;
    }
};
@@ -1121,14 +1117,10 @@ status_t BnSurfaceComposer::onTransact(
            result = getDisplayedContentSample(display, maxFrames, timestamp, &stats);
            if (result == NO_ERROR) {
                reply->writeUint64(stats.numFrames);
                reply->writeInt64Vector(
                        *reinterpret_cast<std::vector<int64_t>*>(&stats.component_0_sample));
                reply->writeInt64Vector(
                        *reinterpret_cast<std::vector<int64_t>*>(&stats.component_1_sample));
                reply->writeInt64Vector(
                        *reinterpret_cast<std::vector<int64_t>*>(&stats.component_2_sample));
                reply->writeInt64Vector(
                        *reinterpret_cast<std::vector<int64_t>*>(&stats.component_3_sample));
                reply->writeUint64Vector(stats.component_0_sample);
                reply->writeUint64Vector(stats.component_1_sample);
                reply->writeUint64Vector(stats.component_2_sample);
                reply->writeUint64Vector(stats.component_3_sample);
            }
            return result;
        }