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

Commit 6a0c7a68 authored by Steve Kondik's avatar Steve Kondik Committed by Gerrit Code Review
Browse files

Merge "SurfaceFlinger: Return the current transform value when queried" into ics

parents 710a0db6 d1720155
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -276,7 +276,13 @@ int SurfaceTextureClient::query(int what, int* value) const {
                *value = mDefaultHeight;
                return NO_ERROR;
            case NATIVE_WINDOW_TRANSFORM_HINT:
#ifdef QCOM_HARDWARE
                if (mSurfaceTexture->query(what, value) != NO_ERROR) {
                    *value = mTransformHint;
                }
#else
                *value = mTransformHint;
#endif
                return NO_ERROR;
        }
    }
+21 −0
Original line number Diff line number Diff line
@@ -52,6 +52,27 @@ status_t SurfaceTextureLayer::setBufferCount(int bufferCount) {
    return res;
}

#ifdef QCOM_HARDWARE
int SurfaceTextureLayer::query(int what, int* value) {
    int ret = SurfaceTexture::query(what, value);
    if (ret != NO_ERROR) return ret;

    sp<Layer> layer(mLayer.promote());
    if (layer == NULL) return NO_INIT;

    switch (what) {
    case NATIVE_WINDOW_TRANSFORM_HINT:
        *value = layer->getTransformHint();
        break;
    default:
        // for later use
        break;
    }

    return NO_ERROR;
}
#endif

status_t SurfaceTextureLayer::queueBuffer(int buf, int64_t timestamp,
        uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform) {

+4 −0
Original line number Diff line number Diff line
@@ -45,6 +45,10 @@ public:
    virtual status_t setBufferCount(int bufferCount);

protected:
#ifdef QCOM_HARDWARE
    virtual int query(int what, int* value);
#endif

    virtual status_t queueBuffer(int buf, int64_t timestamp,
            uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform);