am 0638a4fa
: Merge "libgui/SF: Propagate SECURE Layer flag changes" into mnc-dev
* commit '0638a4fac7250e260c0102c770090cb7eefca936': libgui/SF: Propagate SECURE Layer flag changes
This commit is contained in:
commit
c8c0992ace
@ -39,6 +39,7 @@ struct layer_state_t {
|
|||||||
enum {
|
enum {
|
||||||
eLayerHidden = 0x01, // SURFACE_HIDDEN in SurfaceControl.java
|
eLayerHidden = 0x01, // SURFACE_HIDDEN in SurfaceControl.java
|
||||||
eLayerOpaque = 0x02, // SURFACE_OPAQUE
|
eLayerOpaque = 0x02, // SURFACE_OPAQUE
|
||||||
|
eLayerSecure = 0x80, // SECURE
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
@ -48,10 +49,9 @@ struct layer_state_t {
|
|||||||
eAlphaChanged = 0x00000008,
|
eAlphaChanged = 0x00000008,
|
||||||
eMatrixChanged = 0x00000010,
|
eMatrixChanged = 0x00000010,
|
||||||
eTransparentRegionChanged = 0x00000020,
|
eTransparentRegionChanged = 0x00000020,
|
||||||
eVisibilityChanged = 0x00000040,
|
eFlagsChanged = 0x00000040,
|
||||||
eLayerStackChanged = 0x00000080,
|
eLayerStackChanged = 0x00000080,
|
||||||
eCropChanged = 0x00000100,
|
eCropChanged = 0x00000100,
|
||||||
eOpacityChanged = 0x00000200,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
layer_state_t()
|
layer_state_t()
|
||||||
|
@ -310,11 +310,10 @@ status_t Composer::setFlags(const sp<SurfaceComposerClient>& client,
|
|||||||
layer_state_t* s = getLayerStateLocked(client, id);
|
layer_state_t* s = getLayerStateLocked(client, id);
|
||||||
if (!s)
|
if (!s)
|
||||||
return BAD_INDEX;
|
return BAD_INDEX;
|
||||||
if (mask & layer_state_t::eLayerOpaque) {
|
if (mask & layer_state_t::eLayerOpaque ||
|
||||||
s->what |= layer_state_t::eOpacityChanged;
|
mask & layer_state_t::eLayerHidden ||
|
||||||
}
|
mask & layer_state_t::eLayerSecure) {
|
||||||
if (mask & layer_state_t::eLayerHidden) {
|
s->what |= layer_state_t::eFlagsChanged;
|
||||||
s->what |= layer_state_t::eVisibilityChanged;
|
|
||||||
}
|
}
|
||||||
s->flags &= ~mask;
|
s->flags &= ~mask;
|
||||||
s->flags |= (flags & mask);
|
s->flags |= (flags & mask);
|
||||||
|
@ -76,7 +76,6 @@ Layer::Layer(SurfaceFlinger* flinger, const sp<Client>& client,
|
|||||||
mFiltering(false),
|
mFiltering(false),
|
||||||
mNeedsFiltering(false),
|
mNeedsFiltering(false),
|
||||||
mMesh(Mesh::TRIANGLE_FAN, 4, 2, 2),
|
mMesh(Mesh::TRIANGLE_FAN, 4, 2, 2),
|
||||||
mSecure(false),
|
|
||||||
mProtectedByApp(false),
|
mProtectedByApp(false),
|
||||||
mHasSurface(false),
|
mHasSurface(false),
|
||||||
mClientRef(client),
|
mClientRef(client),
|
||||||
@ -96,6 +95,8 @@ Layer::Layer(SurfaceFlinger* flinger, const sp<Client>& client,
|
|||||||
layerFlags |= layer_state_t::eLayerHidden;
|
layerFlags |= layer_state_t::eLayerHidden;
|
||||||
if (flags & ISurfaceComposerClient::eOpaque)
|
if (flags & ISurfaceComposerClient::eOpaque)
|
||||||
layerFlags |= layer_state_t::eLayerOpaque;
|
layerFlags |= layer_state_t::eLayerOpaque;
|
||||||
|
if (flags & ISurfaceComposerClient::eSecure)
|
||||||
|
layerFlags |= layer_state_t::eLayerSecure;
|
||||||
|
|
||||||
if (flags & ISurfaceComposerClient::eNonPremultiplied)
|
if (flags & ISurfaceComposerClient::eNonPremultiplied)
|
||||||
mPremultipliedAlpha = false;
|
mPremultipliedAlpha = false;
|
||||||
@ -256,7 +257,6 @@ status_t Layer::setBuffers( uint32_t w, uint32_t h,
|
|||||||
mFormat = format;
|
mFormat = format;
|
||||||
|
|
||||||
mPotentialCursor = (flags & ISurfaceComposerClient::eCursorWindow) ? true : false;
|
mPotentialCursor = (flags & ISurfaceComposerClient::eCursorWindow) ? true : false;
|
||||||
mSecure = (flags & ISurfaceComposerClient::eSecure) ? true : false;
|
|
||||||
mProtectedByApp = (flags & ISurfaceComposerClient::eProtectedByApp) ? true : false;
|
mProtectedByApp = (flags & ISurfaceComposerClient::eProtectedByApp) ? true : false;
|
||||||
mCurrentOpacity = getOpacityForFormat(format);
|
mCurrentOpacity = getOpacityForFormat(format);
|
||||||
|
|
||||||
@ -858,6 +858,12 @@ bool Layer::isOpaque(const Layer::State& s) const
|
|||||||
return ((s.flags & layer_state_t::eLayerOpaque) != 0) || mCurrentOpacity;
|
return ((s.flags & layer_state_t::eLayerOpaque) != 0) || mCurrentOpacity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Layer::isSecure() const
|
||||||
|
{
|
||||||
|
const Layer::State& s(mDrawingState);
|
||||||
|
return (s.flags & layer_state_t::eLayerSecure);
|
||||||
|
}
|
||||||
|
|
||||||
bool Layer::isProtected() const
|
bool Layer::isProtected() const
|
||||||
{
|
{
|
||||||
const sp<GraphicBuffer>& activeBuffer(mActiveBuffer);
|
const sp<GraphicBuffer>& activeBuffer(mActiveBuffer);
|
||||||
|
@ -174,7 +174,7 @@ public:
|
|||||||
* isSecure - true if this surface is secure, that is if it prevents
|
* isSecure - true if this surface is secure, that is if it prevents
|
||||||
* screenshots or VNC servers.
|
* screenshots or VNC servers.
|
||||||
*/
|
*/
|
||||||
virtual bool isSecure() const { return mSecure; }
|
virtual bool isSecure() const;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* isProtected - true if the layer may contain protected content in the
|
* isProtected - true if the layer may contain protected content in the
|
||||||
@ -402,7 +402,6 @@ private:
|
|||||||
mutable Texture mTexture;
|
mutable Texture mTexture;
|
||||||
|
|
||||||
// page-flip thread (currently main thread)
|
// page-flip thread (currently main thread)
|
||||||
bool mSecure; // no screenshots
|
|
||||||
bool mProtectedByApp; // application requires protected path to external sink
|
bool mProtectedByApp; // application requires protected path to external sink
|
||||||
|
|
||||||
// protected by mLock
|
// protected by mLock
|
||||||
|
@ -2235,9 +2235,7 @@ uint32_t SurfaceFlinger::setClientStateLocked(
|
|||||||
if (layer->setTransparentRegionHint(s.transparentRegion))
|
if (layer->setTransparentRegionHint(s.transparentRegion))
|
||||||
flags |= eTraversalNeeded;
|
flags |= eTraversalNeeded;
|
||||||
}
|
}
|
||||||
if ((what & layer_state_t::eVisibilityChanged) ||
|
if (what & layer_state_t::eFlagsChanged) {
|
||||||
(what & layer_state_t::eOpacityChanged)) {
|
|
||||||
// TODO: should we just use an eFlagsChanged for this?
|
|
||||||
if (layer->setFlags(s.flags, s.mask))
|
if (layer->setFlags(s.flags, s.mask))
|
||||||
flags |= eTraversalNeeded;
|
flags |= eTraversalNeeded;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user