diff options
Diffstat (limited to 'services/surfaceflinger/LayerDim.cpp')
-rw-r--r-- | services/surfaceflinger/LayerDim.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/services/surfaceflinger/LayerDim.cpp b/services/surfaceflinger/LayerDim.cpp index 24ad706d02..f8c4139626 100644 --- a/services/surfaceflinger/LayerDim.cpp +++ b/services/surfaceflinger/LayerDim.cpp @@ -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 |