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

Commit 114851e8 authored by Ram Indani's avatar Ram Indani Committed by Android (Google) Code Review
Browse files

Merge changes from topic "getsuggestedframerate" into main

* changes:
  SF: Adds support for getSuggestedFrameRate api
  Adds support for getSuggestedFrameRate api
parents cd19b68b d2a0e72f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@
#include <ui/DisplayMode.h>
#include <ui/DisplayState.h>
#include <ui/DynamicDisplayInfo.h>
#include <ui/FrameRateCategoryRate.h>

#include <android-base/thread_annotations.h>
#include <gui/LayerStatePermissions.h>
@@ -2814,6 +2815,8 @@ void SurfaceComposerClient::getDynamicDisplayInfoInternal(gui::DynamicDisplayInf
    outInfo->gameContentTypeSupported = ginfo.gameContentTypeSupported;
    outInfo->preferredBootDisplayMode = ginfo.preferredBootDisplayMode;
    outInfo->hasArrSupport = ginfo.hasArrSupport;
    outInfo->frameRateCategoryRate = ui::FrameRateCategoryRate(ginfo.frameRateCategoryRate.normal,
                                                               ginfo.frameRateCategoryRate.high);
}

status_t SurfaceComposerClient::getDynamicDisplayInfoFromId(int64_t displayId,
+4 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.gui;

import android.gui.DisplayMode;
import android.gui.FrameRateCategoryRate;
import android.gui.HdrCapabilities;

// Information about a physical display which may change on hotplug reconnect.
@@ -46,4 +47,7 @@ parcelable DynamicDisplayInfo {

    // Represents whether display supports ARR.
    boolean hasArrSupport;

    // Represents frame rate for FrameRateCategory Normal and High.
    FrameRateCategoryRate frameRateCategoryRate;
}
+24 −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;

/** @hide */
// Represents frame rate for FrameRateCategory Normal and High.
parcelable FrameRateCategoryRate {
    float normal;
    float high;
}
 No newline at end of file
+4 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include <optional>
#include <vector>

#include <ui/FrameRateCategoryRate.h>
#include <ui/GraphicTypes.h>
#include <ui/HdrCapabilities.h>

@@ -55,6 +56,9 @@ struct DynamicDisplayInfo {
    std::optional<ui::DisplayMode> getActiveDisplayMode() const;

    bool hasArrSupport;

    // Represents frame rate for FrameRateCategory Normal and High.
    ui::FrameRateCategoryRate frameRateCategoryRate;
};

} // namespace android::ui
+35 −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.
 */

#pragma once

namespace android::ui {

// Represents frame rate for FrameRateCategory Normal and High.
class FrameRateCategoryRate {
public:
    FrameRateCategoryRate(float normal = 0, float high = 0) : mNormal(normal), mHigh(high) {}

    float getNormal() const { return mNormal; }

    float getHigh() const { return mHigh; }

private:
    float mNormal;
    float mHigh;
};

} // namespace android::ui
 No newline at end of file
Loading