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

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

Snap for 8421339 from f192aea5 to tm-qpr1-release

Change-Id: I4fd44e696f457a1bb4384d0d099b0d43895776ab
parents 5c484761 f192aea5
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -16,8 +16,8 @@

#define LOG_TAG "LayerState"

#include <apex/window.h>
#include <inttypes.h>
#include <cinttypes>
#include <cmath>

#include <android/native_window.h>
#include <binder/Parcel.h>
@@ -25,10 +25,9 @@
#include <gui/ISurfaceComposerClient.h>
#include <gui/LayerState.h>
#include <private/gui/ParcelUtils.h>
#include <system/window.h>
#include <utils/Errors.h>

#include <cmath>

namespace android {

using gui::FocusRequest;
@@ -679,7 +678,9 @@ bool ValidateFrameRate(float frameRate, int8_t compatibility, int8_t changeFrame

    if (compatibility != ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_DEFAULT &&
        compatibility != ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_FIXED_SOURCE &&
        (!privileged || compatibility != ANATIVEWINDOW_FRAME_RATE_EXACT)) {
        (!privileged ||
         (compatibility != ANATIVEWINDOW_FRAME_RATE_EXACT &&
          compatibility != ANATIVEWINDOW_FRAME_RATE_NO_VOTE))) {
        ALOGE("%s failed - invalid compatibility value %d privileged: %s", functionName,
              compatibility, privileged ? "yes" : "no");
        return false;
+0 −13
Original line number Diff line number Diff line
@@ -39,19 +39,6 @@ enum ANativeWindowPerform {
    // clang-format on
};

/*
 * Internal extension of compatibility value for ANativeWindow_setFrameRate. */
enum ANativeWindow_FrameRateCompatibilityInternal {
    /**
     * This surface belongs to an app on the High Refresh Rate Deny list, and needs the display
     * to operate at the exact frame rate.
     *
     * This is used internally by the platform and should not be used by apps.
     * @hide
     */
    ANATIVEWINDOW_FRAME_RATE_EXACT = 100,
};

/**
 * Prototype of the function that an ANativeWindow implementation would call
 * when ANativeWindow_cancelBuffer is called.
+18 −0
Original line number Diff line number Diff line
@@ -1018,6 +1018,24 @@ static inline int native_window_set_auto_prerotation(struct ANativeWindow* windo
    return window->perform(window, NATIVE_WINDOW_SET_AUTO_PREROTATION, autoPrerotation);
}

/*
 * Internal extension of ANativeWindow_FrameRateCompatibility.
 */
enum {
    /**
     * This surface belongs to an app on the High Refresh Rate Deny list, and needs the display
     * to operate at the exact frame rate.
     *
     * Keep in sync with Surface.java constant.
     */
    ANATIVEWINDOW_FRAME_RATE_EXACT = 100,

    /**
     * This surface is ignored while choosing the refresh rate.
     */
    ANATIVEWINDOW_FRAME_RATE_NO_VOTE,
};

static inline int native_window_set_frame_rate(struct ANativeWindow* window, float frameRate,
                                        int8_t compatibility, int8_t changeFrameRateStrategy) {
    return window->perform(window, NATIVE_WINDOW_SET_FRAME_RATE, (double)frameRate,
+7 −1
Original line number Diff line number Diff line
@@ -114,7 +114,13 @@ void EffectLayer::preparePerFrameCompositionState() {
}

sp<compositionengine::LayerFE> EffectLayer::getCompositionEngineLayerFE() const {
    // There's no need to get a CE Layer if the EffectLayer isn't going to draw anything. In that
    // case, it acts more like a ContainerLayer so returning a null CE Layer makes more sense
    if (hasSomethingToDraw()) {
        return asLayerFE();
    } else {
        return nullptr;
    }
}

compositionengine::LayerFECompositionState* EffectLayer::editCompositionState() {
+2 −0
Original line number Diff line number Diff line
@@ -2596,6 +2596,8 @@ Layer::FrameRateCompatibility Layer::FrameRate::convertCompatibility(int8_t comp
            return FrameRateCompatibility::ExactOrMultiple;
        case ANATIVEWINDOW_FRAME_RATE_EXACT:
            return FrameRateCompatibility::Exact;
        case ANATIVEWINDOW_FRAME_RATE_NO_VOTE:
            return FrameRateCompatibility::NoVote;
        default:
            LOG_ALWAYS_FATAL("Invalid frame rate compatibility value %d", compatibility);
            return FrameRateCompatibility::Default;
Loading