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

Commit 73ec6419 authored by Peiyong Lin's avatar Peiyong Lin Committed by Android (Google) Code Review
Browse files

Merge "Traverse layers in main thread."

parents ac4a6fcc 5680227b
Loading
Loading
Loading
Loading
+8 −3
Original line number Original line Diff line number Diff line
@@ -5660,9 +5660,14 @@ status_t SurfaceFlinger::captureScreenCommon(RenderAreaFuture renderAreaFuture,
    const bool supportsProtected = getRenderEngine().supportsProtectedContent();
    const bool supportsProtected = getRenderEngine().supportsProtectedContent();
    bool hasProtectedLayer = false;
    bool hasProtectedLayer = false;
    if (allowProtected && supportsProtected) {
    if (allowProtected && supportsProtected) {
        hasProtectedLayer = schedule([=]() {
                                bool protectedLayerFound = false;
                                traverseLayers([&](Layer* layer) {
                                traverseLayers([&](Layer* layer) {
            hasProtectedLayer = hasProtectedLayer || (layer->isVisible() && layer->isProtected());
                                    protectedLayerFound = protectedLayerFound ||
                                            (layer->isVisible() && layer->isProtected());
                                });
                                });
                                return protectedLayerFound;
                            }).get();
    }
    }


    const uint32_t usage = GRALLOC_USAGE_HW_COMPOSER | GRALLOC_USAGE_HW_RENDER |
    const uint32_t usage = GRALLOC_USAGE_HW_COMPOSER | GRALLOC_USAGE_HW_RENDER |