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

Commit eb6d9e41 authored by Mathias Agopian's avatar Mathias Agopian Committed by Android Git Automerger
Browse files

am dad8bd33: am 438ca07b: Merge changes I66511c08,Ia051949f,Ic7451365,I5b571a4c into jb-mr2-dev

* commit 'dad8bd33':
  Get rid of LayerBase.
  Make LayerDim a regular Layer instead of a LayerBase
  fold LayerBaseClient into LayerBase
  Remove support for ScreenshotLayer
parents 96e383cb dad8bd33
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -48,9 +48,7 @@ public:
        eProtectedByDRM     = 0x00001000,

        eFXSurfaceNormal    = 0x00000000,
        eFXSurfaceBlur      = 0x00010000, // deprecated, same as Dim
        eFXSurfaceDim       = 0x00020000,
        eFXSurfaceScreenshot= 0x00030000,
        eFXSurfaceMask      = 0x000F0000,
    };

+0 −2
Original line number Diff line number Diff line
@@ -7,9 +7,7 @@ LOCAL_SRC_FILES:= \
    EventThread.cpp                         \
    FrameTracker.cpp                        \
    Layer.cpp                               \
    LayerBase.cpp                           \
    LayerDim.cpp                            \
    LayerScreenshot.cpp                     \
    DisplayHardware/FramebufferSurface.cpp  \
    DisplayHardware/HWComposer.cpp          \
    DisplayHardware/PowerHAL.cpp            \
+6 −7
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@

#include "Client.h"
#include "Layer.h"
#include "LayerBase.h"
#include "SurfaceFlinger.h"

namespace android {
@@ -43,7 +42,7 @@ Client::~Client()
{
    const size_t count = mLayers.size();
    for (size_t i=0 ; i<count ; i++) {
        sp<LayerBaseClient> layer(mLayers.valueAt(i).promote());
        sp<Layer> layer(mLayers.valueAt(i).promote());
        if (layer != 0) {
            mFlinger->removeLayer(layer);
        }
@@ -54,13 +53,13 @@ status_t Client::initCheck() const {
    return NO_ERROR;
}

void Client::attachLayer(const sp<IBinder>& handle, const sp<LayerBaseClient>& layer)
void Client::attachLayer(const sp<IBinder>& handle, const sp<Layer>& layer)
{
    Mutex::Autolock _l(mLock);
    mLayers.add(handle, layer);
}

void Client::detachLayer(const LayerBaseClient* layer)
void Client::detachLayer(const Layer* layer)
{
    Mutex::Autolock _l(mLock);
    // we do a linear search here, because this doesn't happen often
@@ -72,11 +71,11 @@ void Client::detachLayer(const LayerBaseClient* layer)
        }
    }
}
sp<LayerBaseClient> Client::getLayerUser(const sp<IBinder>& handle) const
sp<Layer> Client::getLayerUser(const sp<IBinder>& handle) const
{
    Mutex::Autolock _l(mLock);
    sp<LayerBaseClient> lbc;
    wp<LayerBaseClient> layer(mLayers.valueFor(handle));
    sp<Layer> lbc;
    wp<Layer> layer(mLayers.valueFor(handle));
    if (layer != 0) {
        lbc = layer.promote();
        ALOGE_IF(lbc==0, "getLayerUser(name=%p) is dead", handle.get());
+5 −5
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ namespace android {

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

class LayerBaseClient;
class Layer;
class SurfaceFlinger;

// ---------------------------------------------------------------------------
@@ -44,11 +44,11 @@ public:
    status_t initCheck() const;

    // protected by SurfaceFlinger::mStateLock
    void attachLayer(const sp<IBinder>& handle, const sp<LayerBaseClient>& layer);
    void attachLayer(const sp<IBinder>& handle, const sp<Layer>& layer);

    void detachLayer(const LayerBaseClient* layer);
    void detachLayer(const Layer* layer);

    sp<LayerBaseClient> getLayerUser(const sp<IBinder>& handle) const;
    sp<Layer> getLayerUser(const sp<IBinder>& handle) const;

private:
    // ISurfaceComposerClient interface
@@ -66,7 +66,7 @@ private:
    sp<SurfaceFlinger> mFlinger;

    // protected by mLock
    DefaultKeyedVector< wp<IBinder>, wp<LayerBaseClient> > mLayers;
    DefaultKeyedVector< wp<IBinder>, wp<Layer> > mLayers;

    // thread-safe
    mutable Mutex mLock;
+4 −4
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@
#include "DisplayDevice.h"
#include "GLExtensions.h"
#include "SurfaceFlinger.h"
#include "LayerBase.h"
#include "Layer.h"

// ----------------------------------------------------------------------------
using namespace android;
@@ -282,19 +282,19 @@ void DisplayDevice::setViewportAndProjection(const sp<const DisplayDevice>& hw)

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

void DisplayDevice::setVisibleLayersSortedByZ(const Vector< sp<LayerBase> >& layers) {
void DisplayDevice::setVisibleLayersSortedByZ(const Vector< sp<Layer> >& layers) {
    mVisibleLayersSortedByZ = layers;
    mSecureLayerVisible = false;
    size_t count = layers.size();
    for (size_t i=0 ; i<count ; i++) {
        const sp<LayerBase>& layer(layers[i]);
        const sp<Layer>& layer(layers[i]);
        if (layer->isSecure()) {
            mSecureLayerVisible = true;
        }
    }
}

const Vector< sp<LayerBase> >& DisplayDevice::getVisibleLayersSortedByZ() const {
const Vector< sp<Layer> >& DisplayDevice::getVisibleLayersSortedByZ() const {
    return mVisibleLayersSortedByZ;
}

Loading