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

Commit b9d331b0 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 11554395 from a0ae40f2 to 24Q3-release

Change-Id: I408c41859f52fc148530634c5c824971146c9ffa
parents 4d7974d7 a0ae40f2
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -532,7 +532,7 @@ void ASurfaceTransaction_setHdrMetadata_cta861_3(ASurfaceTransaction* transactio
 * using this API for formats that encode an HDR/SDR ratio as part of generating the buffer.
 *
 * @param surface_control The layer whose extended range brightness is being specified
 * @param currentBufferRatio The current hdr/sdr ratio of the current buffer as represented as
 * @param currentBufferRatio The current HDR/SDR ratio of the current buffer as represented as
 *                           peakHdrBrightnessInNits / targetSdrWhitePointInNits. For example if the
 *                           buffer was rendered with a target SDR whitepoint of 100nits and a max
 *                           display brightness of 200nits, this should be set to 2.0f.
@@ -546,7 +546,7 @@ void ASurfaceTransaction_setHdrMetadata_cta861_3(ASurfaceTransaction* transactio
 *
 *                           Must be finite && >= 1.0f
 *
 * @param desiredRatio The desired hdr/sdr ratio as represented as peakHdrBrightnessInNits /
 * @param desiredRatio The desired HDR/SDR ratio as represented as peakHdrBrightnessInNits /
 *                     targetSdrWhitePointInNits. This can be used to communicate the max desired
 *                     brightness range. This is similar to the "max luminance" value in other
 *                     HDR metadata formats, but represented as a ratio of the target SDR whitepoint
@@ -579,13 +579,13 @@ void ASurfaceTransaction_setExtendedRangeBrightness(ASurfaceTransaction* transac
                                            float desiredRatio) __INTRODUCED_IN(__ANDROID_API_U__);

/**
 * Sets the desired hdr headroom for the layer. See: ASurfaceTransaction_setExtendedRangeBrightness,
 * Sets the desired HDR headroom for the layer. See: ASurfaceTransaction_setExtendedRangeBrightness,
 * prefer using this API for formats that conform to HDR standards like HLG or HDR10, that do not
 * communicate a HDR/SDR ratio as part of generating the buffer.
 *
 * @param surface_control The layer whose desired hdr headroom is being specified
 * @param surface_control The layer whose desired HDR headroom is being specified
 *
 * @param desiredHeadroom The desired hdr/sdr ratio as represented as peakHdrBrightnessInNits /
 * @param desiredHeadroom The desired HDR/SDR ratio as represented as peakHdrBrightnessInNits /
 *                        targetSdrWhitePointInNits. This can be used to communicate the max
 *                        desired brightness range of the panel. The system may not be able to, or
 *                        may choose not to, deliver the requested range.
+1 −0
Original line number Diff line number Diff line
@@ -87,6 +87,7 @@ filegroup {
        "skia/SkiaRenderEngine.cpp",
        "skia/SkiaGLRenderEngine.cpp",
        "skia/SkiaVkRenderEngine.cpp",
        "skia/VulkanInterface.cpp",
        "skia/debug/CaptureTimer.cpp",
        "skia/debug/CommonPool.cpp",
        "skia/debug/SkiaCapture.cpp",
+26 −641

File changed.

Preview size limit exceeded, changes collapsed.

+37 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
#include <vk/GrVkBackendContext.h>

#include "SkiaRenderEngine.h"
#include "VulkanInterface.h"

namespace android {
namespace renderengine {
@@ -32,6 +33,42 @@ public:

    int getContextPriority() override;

    class DestroySemaphoreInfo {
    public:
        DestroySemaphoreInfo() = delete;
        DestroySemaphoreInfo(const DestroySemaphoreInfo&) = delete;
        DestroySemaphoreInfo& operator=(const DestroySemaphoreInfo&) = delete;
        DestroySemaphoreInfo& operator=(DestroySemaphoreInfo&&) = delete;

        DestroySemaphoreInfo(VulkanInterface& vulkanInterface, std::vector<VkSemaphore> semaphores)
              : mVulkanInterface(vulkanInterface), mSemaphores(std::move(semaphores)) {}
        DestroySemaphoreInfo(VulkanInterface& vulkanInterface, VkSemaphore semaphore)
              : DestroySemaphoreInfo(vulkanInterface, std::vector<VkSemaphore>(1, semaphore)) {}

        void unref() {
            --mRefs;
            if (!mRefs) {
                for (VkSemaphore semaphore : mSemaphores) {
                    mVulkanInterface.destroySemaphore(semaphore);
                }
                delete this;
            }
        }

    private:
        ~DestroySemaphoreInfo() = default;

        VulkanInterface& mVulkanInterface;
        std::vector<VkSemaphore> mSemaphores;
        // We need to make sure we don't delete the VkSemaphore until it is done being used by both
        // Skia (including by the GPU) and inside SkiaVkRenderEngine. So we always start with two
        // refs, one owned by Skia and one owned by the SkiaVkRenderEngine. The refs are decremented
        // each time unref() is called on this object. Skia will call unref() once it is done with
        // the semaphore and the GPU has finished work on the semaphore. SkiaVkRenderEngine calls
        // unref() after sending the semaphore to Skia and exporting it if need be.
        int mRefs = 2;
    };

protected:
    // Implementations of abstract SkiaRenderEngine functions specific to
    // rendering backend
+582 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading