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

Commit 8bf3b1a4 authored by Wonsik Kim's avatar Wonsik Kim Committed by Android (Google) Code Review
Browse files

Merge "Revert "Implement video plane layer""

parents 75d84069 29fa9590
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -49,7 +49,6 @@ public:


        eFXSurfaceNormal    = 0x00000000,
        eFXSurfaceNormal    = 0x00000000,
        eFXSurfaceDim       = 0x00020000,
        eFXSurfaceDim       = 0x00020000,
        eFXSurfaceVideoPlane= 0x00040000,
        eFXSurfaceMask      = 0x000F0000,
        eFXSurfaceMask      = 0x000F0000,
    };
    };


+0 −1
Original line number Original line Diff line number Diff line
@@ -10,7 +10,6 @@ LOCAL_SRC_FILES:= \
    FrameTracker.cpp \
    FrameTracker.cpp \
    Layer.cpp \
    Layer.cpp \
    LayerDim.cpp \
    LayerDim.cpp \
    LayerVideoPlane.cpp \
    MessageQueue.cpp \
    MessageQueue.cpp \
    SurfaceFlinger.cpp \
    SurfaceFlinger.cpp \
    SurfaceFlingerConsumer.cpp \
    SurfaceFlingerConsumer.cpp \
+0 −66
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2014 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.
 */

#include <stdlib.h>
#include <stdint.h>
#include <sys/types.h>

#include <utils/Errors.h>
#include <utils/Log.h>

#include <ui/GraphicBuffer.h>

#include "LayerVideoPlane.h"
#include "SurfaceFlinger.h"
#include "DisplayDevice.h"
#include "RenderEngine/RenderEngine.h"

#define DEBUG_BLUE_SURFACE 1

namespace android {
// ---------------------------------------------------------------------------

LayerVideoPlane::LayerVideoPlane(SurfaceFlinger* flinger, const sp<Client>& client,
        const String8& name, uint32_t w, uint32_t h, uint32_t flags)
    : Layer(flinger, client, name, w, h, flags) {
}

LayerVideoPlane::~LayerVideoPlane() {
}

void LayerVideoPlane::onDraw(const sp<const DisplayDevice>& hw,
        const Region& /* clip */, bool useIdentityTransform) const
{
#if DEBUG_BLUE_SURFACE
    Mesh mesh(Mesh::TRIANGLE_FAN, 4, 2);
    computeGeometry(hw, mesh, useIdentityTransform);
    RenderEngine& engine(mFlinger->getRenderEngine());
    engine.setupFillWithColor(0.0f, 0.0f, 1.0f, 1.0f);
    engine.drawMesh(mesh);
#else
    // TODO
#endif
}

bool LayerVideoPlane::isVisible() const {
    const Layer::State& s(getDrawingState());
    return !(s.flags & layer_state_t::eLayerHidden);
}


// ---------------------------------------------------------------------------

}; // namespace android
+0 −47
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2014 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.
 */

#ifndef ANDROID_LAYER_VIDEO_PLANE_H
#define ANDROID_LAYER_VIDEO_PLANE_H

#include <stdint.h>
#include <sys/types.h>

#include "Layer.h"

// ---------------------------------------------------------------------------

namespace android {

class LayerVideoPlane : public Layer
{
public:
            LayerVideoPlane(SurfaceFlinger* flinger, const sp<Client>& client,
                    const String8& name, uint32_t w, uint32_t h, uint32_t flags);
    virtual ~LayerVideoPlane();

    virtual const char* getTypeId() const { return "LayerVideoPlane"; }
    virtual void onDraw(const sp<const DisplayDevice>& hw, const Region& clip,
            bool useIdentityTransform) const;
    virtual bool isFixedSize() const      { return true; }
    virtual bool isVisible() const;
};

// ---------------------------------------------------------------------------

}; // namespace android

#endif // ANDROID_LAYER_VIDEO_PLANE_H
+0 −16
Original line number Original line Diff line number Diff line
@@ -65,7 +65,6 @@
#include "EventThread.h"
#include "EventThread.h"
#include "Layer.h"
#include "Layer.h"
#include "LayerDim.h"
#include "LayerDim.h"
#include "LayerVideoPlane.h"
#include "SurfaceFlinger.h"
#include "SurfaceFlinger.h"


#include "DisplayHardware/FramebufferSurface.h"
#include "DisplayHardware/FramebufferSurface.h"
@@ -1939,11 +1938,6 @@ status_t SurfaceFlinger::createLayer(
                    name, w, h, flags,
                    name, w, h, flags,
                    handle, gbp, &layer);
                    handle, gbp, &layer);
            break;
            break;
        case ISurfaceComposerClient::eFXSurfaceVideoPlane:
            result = createVideoPlaneLayer(client,
                    name, w, h, flags,
                    handle, gbp, &layer);
            break;
        default:
        default:
            result = BAD_VALUE;
            result = BAD_VALUE;
            break;
            break;
@@ -2001,16 +1995,6 @@ status_t SurfaceFlinger::createDimLayer(const sp<Client>& client,
    return NO_ERROR;
    return NO_ERROR;
}
}


status_t SurfaceFlinger::createVideoPlaneLayer(const sp<Client>& client,
        const String8& name, uint32_t w, uint32_t h, uint32_t flags,
        sp<IBinder>* handle, sp<IGraphicBufferProducer>* gbp, sp<Layer>* outLayer)
{
    *outLayer = new LayerVideoPlane(this, client, name, w, h, flags);
    *handle = (*outLayer)->getHandle();
    *gbp = (*outLayer)->getBufferQueue();
    return NO_ERROR;
}

status_t SurfaceFlinger::onLayerRemoved(const sp<Client>& client, const sp<IBinder>& handle)
status_t SurfaceFlinger::onLayerRemoved(const sp<Client>& client, const sp<IBinder>& handle)
{
{
    // called by the window manager when it wants to remove a Layer
    // called by the window manager when it wants to remove a Layer
Loading