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

Commit c34f5ddd authored by Brian Lindahl's avatar Brian Lindahl Committed by Android (Google) Code Review
Browse files

Merge changes from topic "android-display-processing-3" into main

* changes:
  Add API to retrieve max layer picture profiles
  Notify listeners about active picture profiles
parents 8348655e 5541f127
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -3056,6 +3056,14 @@ void SurfaceComposerClient::setDisplayPowerMode(const sp<IBinder>& token,
    ComposerServiceAIDL::getComposerService()->setPowerMode(token, mode);
}

status_t SurfaceComposerClient::getMaxLayerPictureProfiles(const sp<IBinder>& token,
                                                           int32_t* outMaxProfiles) {
    binder::Status status =
            ComposerServiceAIDL::getComposerService()->getMaxLayerPictureProfiles(token,
                                                                                  outMaxProfiles);
    return statusTFromBinderStatus(status);
}

status_t SurfaceComposerClient::getCompositionPreference(
        ui::Dataspace* defaultDataspace, ui::PixelFormat* defaultPixelFormat,
        ui::Dataspace* wideColorGamutDataspace, ui::PixelFormat* wideColorGamutPixelFormat) {
@@ -3280,6 +3288,13 @@ status_t SurfaceComposerClient::removeHdrLayerInfoListener(
    return statusTFromBinderStatus(status);
}

status_t SurfaceComposerClient::setActivePictureListener(
        const sp<gui::IActivePictureListener>& listener) {
    binder::Status status =
            ComposerServiceAIDL::getComposerService()->setActivePictureListener(listener);
    return statusTFromBinderStatus(status);
}

status_t SurfaceComposerClient::notifyPowerBoost(int32_t boostId) {
    binder::Status status = ComposerServiceAIDL::getComposerService()->notifyPowerBoost(boostId);
    return statusTFromBinderStatus(status);
+32 −0
Original line number Diff line number Diff line
/*
 * Copyright 2024 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.gui;

/**
 * Visible content that is using picture processing.
 * @hide
 */
parcelable ActivePicture {
    /** The layer ID that is using picture processing. */
    int layerId;

    /** UID that owns layer using picture processing. */
    int ownerUid;

    /** ID of the picture profile that was used to configure the picture processing. */
    long pictureProfileId;
}
+30 −0
Original line number Diff line number Diff line
/*
 * Copyright 2024 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.gui;

import android.gui.ActivePicture;

/**
 * Receive callbacks whenever the visible content using picture profiles changes.
 * @hide
 */
interface IActivePictureListener {
    /**
     * Callback reporting the visible content on the screen using picture profiles.
     */
    oneway void onActivePicturesChanged(in ActivePicture[] activePictures);
}
+12 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import android.gui.FrameEvent;
import android.gui.FrameStats;
import android.gui.HdrConversionCapability;
import android.gui.HdrConversionStrategy;
import android.gui.IActivePictureListener;
import android.gui.IDisplayEventConnection;
import android.gui.IFpsListener;
import android.gui.IHdrLayerInfoListener;
@@ -227,6 +228,11 @@ interface ISurfaceComposer {
     */
    void setGameContentType(IBinder display, boolean on);

    /**
     * Gets the maximum number of picture profiles supported by the display.
     */
    int getMaxLayerPictureProfiles(IBinder display);

    /**
     * Capture the specified screen. This requires READ_FRAME_BUFFER
     * permission.  This function will fail if there is a secure window on
@@ -599,4 +605,10 @@ interface ISurfaceComposer {
     * past the provided VSync.
     */
    oneway void removeJankListener(int layerId, IJankListener listener, long afterVsync);

    /**
     * Sets the listener used to monitor visible content that is being processed with picture
     * profiles.
     */
    oneway void setActivePictureListener(IActivePictureListener listener);
}
+11 −0
Original line number Diff line number Diff line
@@ -298,6 +298,8 @@ public:
    static status_t removeHdrLayerInfoListener(const sp<IBinder>& displayToken,
                                               const sp<gui::IHdrLayerInfoListener>& listener);

    static status_t setActivePictureListener(const sp<gui::IActivePictureListener>& listener);

    /*
     * Sends a power boost to the composer. This function is asynchronous.
     *
@@ -343,6 +345,15 @@ public:

    static bool flagEdgeExtensionEffectUseShader();

    /**
     * Returns how many picture profiles are supported by the display.
     *
     * displayToken
     *      The token of the display.
     */
    static status_t getMaxLayerPictureProfiles(const sp<IBinder>& displayToken,
                                               int32_t* outMaxProfiles);

    // ------------------------------------------------------------------------
    // surface creation / destruction

Loading