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

Commit bb66c9b5 authored by Mathias Agopian's avatar Mathias Agopian
Browse files

Fix a few issues with NATIVE_WINDOW_TRANSFORM_HINT

- fixed uninitialized variable
- set hint to indentity when transform is too complex
- make sure FrameBufferNativeWindow doesn't fail on needed perform commands

Bug: 4487161
Change-Id: I7cb2b0869b72404732eca7cb2d145ff669e2ed9b
parent bbb29412
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -55,6 +55,9 @@ void SurfaceTextureClient::init() {
    mQueryWidth = 0;
    mQueryHeight = 0;
    mQueryFormat = 0;
    mDefaultWidth = 0;
    mDefaultHeight = 0;
    mTransformHint = 0;
    mConnectedToCpu = false;
}

+7 −21
Original line number Diff line number Diff line
@@ -310,35 +310,21 @@ int FramebufferNativeWindow::perform(ANativeWindow* window,
        int operation, ...)
{
    switch (operation) {
        case NATIVE_WINDOW_SET_USAGE:
            // TODO: we should implement this
            return NO_ERROR;
        case NATIVE_WINDOW_CONNECT:
            // TODO: we should implement this
            return NO_ERROR;
        case NATIVE_WINDOW_DISCONNECT:
            // TODO: we should implement this
        case NATIVE_WINDOW_SET_USAGE:
        case NATIVE_WINDOW_SET_BUFFERS_GEOMETRY:
        case NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS:
        case NATIVE_WINDOW_SET_BUFFERS_FORMAT:
        case NATIVE_WINDOW_SET_BUFFERS_TRANSFORM:
            // TODO: we should implement these
            return NO_ERROR;

        case NATIVE_WINDOW_LOCK:
            return INVALID_OPERATION;
        case NATIVE_WINDOW_UNLOCK_AND_POST:
            return INVALID_OPERATION;
        case NATIVE_WINDOW_SET_CROP:
            return INVALID_OPERATION;
        case NATIVE_WINDOW_SET_BUFFER_COUNT:
            // TODO: we should implement this
            return INVALID_OPERATION;
        case NATIVE_WINDOW_SET_BUFFERS_GEOMETRY:
            return INVALID_OPERATION;
        case NATIVE_WINDOW_SET_BUFFERS_TRANSFORM:
            return INVALID_OPERATION;
        case NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP:
            return INVALID_OPERATION;
        case NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS:
            return INVALID_OPERATION;
        case NATIVE_WINDOW_SET_BUFFERS_FORMAT:
            // TODO: we should implement this
            return NO_ERROR;
        case NATIVE_WINDOW_SET_SCALING_MODE:
            return INVALID_OPERATION;
    }
+4 −0
Original line number Diff line number Diff line
@@ -60,6 +60,10 @@ status_t SurfaceTextureLayer::queueBuffer(int buf, int64_t timestamp,

    sp<Layer> layer(mLayer.promote());
    if (layer != NULL) {
        uint32_t orientation = layer->getOrientation();
        if (orientation & Transform::ROT_INVALID) {
            orientation = 0;
        }
        *outTransform = layer->getOrientation();
    }