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

Commit 358fcebf authored by George Burgess IV's avatar George Burgess IV Committed by android-build-merger
Browse files

Merge "LayerStats: Fix a use-after-free" am: e8014771

am: 3d6136d0

Change-Id: I4a20f62c645e08d236bc93636f3f48a3bf98e2dd
parents c0d97071 3d6136d0
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -68,7 +68,7 @@ void LayerStats::traverseLayerTreeStatsLocked(
        base::StringAppendF(&key, ",%s", layerCompositionType(layer->hwcCompositionType));
        base::StringAppendF(&key, ",%s", layerCompositionType(layer->hwcCompositionType));
        base::StringAppendF(&key, ",%d", layer->isProtected);
        base::StringAppendF(&key, ",%d", layer->isProtected);
        base::StringAppendF(&key, ",%s", layerTransform(layer->hwcTransform));
        base::StringAppendF(&key, ",%s", layerTransform(layer->hwcTransform));
        base::StringAppendF(&key, ",%s", layerPixelFormat(layer->activeBuffer.format));
        base::StringAppendF(&key, ",%s", layerPixelFormat(layer->activeBuffer.format).c_str());
        base::StringAppendF(&key, ",%s", layer->dataspace.c_str());
        base::StringAppendF(&key, ",%s", layer->dataspace.c_str());
        base::StringAppendF(&key, ",%s",
        base::StringAppendF(&key, ",%s",
                            destinationLocation(layer->hwcFrame.left, layerGlobal.resolution[0],
                            destinationLocation(layer->hwcFrame.left, layerGlobal.resolution[0],
@@ -162,8 +162,8 @@ const char* LayerStats::layerCompositionType(int32_t compositionType) {
    return getCompositionName(static_cast<hwc2_composition_t>(compositionType));
    return getCompositionName(static_cast<hwc2_composition_t>(compositionType));
}
}


const char* LayerStats::layerPixelFormat(int32_t pixelFormat) {
std::string LayerStats::layerPixelFormat(int32_t pixelFormat) {
    return decodePixelFormat(pixelFormat).c_str();
    return decodePixelFormat(pixelFormat);
}
}


std::string LayerStats::scaleRatioWH(const LayerProtoParser::Layer* layer) {
std::string LayerStats::scaleRatioWH(const LayerProtoParser::Layer* layer) {
+1 −1
Original line number Original line Diff line number Diff line
@@ -50,7 +50,7 @@ private:
    // Return the name of the composition type
    // Return the name of the composition type
    static const char* layerCompositionType(int32_t compositionType);
    static const char* layerCompositionType(int32_t compositionType);
    // Return the name of the pixel format
    // Return the name of the pixel format
    static const char* layerPixelFormat(int32_t pixelFormat);
    static std::string layerPixelFormat(int32_t pixelFormat);
    // Calculate scale ratios of layer's width/height with rotation information
    // Calculate scale ratios of layer's width/height with rotation information
    static std::string scaleRatioWH(const LayerProtoParser::Layer* layer);
    static std::string scaleRatioWH(const LayerProtoParser::Layer* layer);
    // Calculate scale ratio from source to destination and convert to string
    // Calculate scale ratio from source to destination and convert to string