Make LayerDim a regular Layer instead of a LayerBase
this is in preparation to get rid of LayerBase entirely Change-Id: Ia051949fc5205fd87371331145356ee11598a597
This commit is contained in:
parent
b79f61d41e
commit
2f73af9212
@ -68,7 +68,7 @@ public:
|
||||
status_t setBuffers(uint32_t w, uint32_t h,
|
||||
PixelFormat format, uint32_t flags=0);
|
||||
|
||||
bool isFixedSize() const;
|
||||
virtual bool isFixedSize() const;
|
||||
|
||||
// LayerBase interface
|
||||
virtual void setGeometry(const sp<const DisplayDevice>& hw,
|
||||
|
@ -34,7 +34,7 @@ namespace android {
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
LayerDim::LayerDim(SurfaceFlinger* flinger, const sp<Client>& client)
|
||||
: LayerBase(flinger, client)
|
||||
: Layer(flinger, client)
|
||||
{
|
||||
}
|
||||
|
||||
@ -71,6 +71,25 @@ void LayerDim::onDraw(const sp<const DisplayDevice>& hw, const Region& clip) con
|
||||
}
|
||||
}
|
||||
|
||||
sp<ISurface> LayerDim::createSurface()
|
||||
{
|
||||
class BSurface : public BnSurface, public LayerCleaner {
|
||||
virtual sp<IGraphicBufferProducer> getSurfaceTexture() const { return 0; }
|
||||
public:
|
||||
BSurface(const sp<SurfaceFlinger>& flinger,
|
||||
const sp<LayerBase>& layer)
|
||||
: LayerCleaner(flinger, layer) { }
|
||||
};
|
||||
sp<ISurface> sur(new BSurface(mFlinger, this));
|
||||
return sur;
|
||||
}
|
||||
|
||||
bool LayerDim::isVisible() const {
|
||||
const Layer::State& s(mDrawingState);
|
||||
return !(s.flags & layer_state_t::eLayerHidden) && s.alpha;
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
}; // namespace android
|
||||
|
@ -23,13 +23,13 @@
|
||||
#include <EGL/egl.h>
|
||||
#include <EGL/eglext.h>
|
||||
|
||||
#include "LayerBase.h"
|
||||
#include "Layer.h"
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
namespace android {
|
||||
|
||||
class LayerDim : public LayerBase
|
||||
class LayerDim : public Layer
|
||||
{
|
||||
public:
|
||||
LayerDim(SurfaceFlinger* flinger, const sp<Client>& client);
|
||||
@ -41,6 +41,10 @@ public:
|
||||
virtual bool isProtectedByApp() const { return false; }
|
||||
virtual bool isProtectedByDRM() const { return false; }
|
||||
virtual const char* getTypeId() const { return "LayerDim"; }
|
||||
|
||||
virtual bool isFixedSize() const { return true; }
|
||||
virtual bool isVisible() const;
|
||||
virtual sp<ISurface> createSurface();
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user