summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/Layer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'services/surfaceflinger/Layer.cpp')
-rw-r--r--services/surfaceflinger/Layer.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index aeaf1e1a14..624d11ec13 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -139,6 +139,7 @@ Layer::Layer(const LayerCreationArgs& args)
mDrawingState.destinationFrame.makeInvalid();
mDrawingState.isTrustedOverlay = false;
mDrawingState.dropInputMode = gui::DropInputMode::NONE;
+ mDrawingState.dimmingEnabled = true;
if (args.flags & ISurfaceComposerClient::eNoColorFill) {
// Set an invalid color so there is no color fill.
@@ -477,6 +478,7 @@ void Layer::preparePerFrameCompositionState() {
compositionState->colorTransformIsIdentity = !hasColorTransform();
compositionState->surfaceDamage = surfaceDamageRegion;
compositionState->hasProtectedContent = isProtected();
+ compositionState->dimmingEnabled = isDimmingEnabled();
const bool usesRoundedCorners = getRoundedCornerState().radius != 0.f;
@@ -1030,6 +1032,16 @@ bool Layer::setColorSpaceAgnostic(const bool agnostic) {
return true;
}
+bool Layer::setDimmingEnabled(const bool dimmingEnabled) {
+ if (mDrawingState.dimmingEnabled == dimmingEnabled) return false;
+
+ mDrawingState.sequence++;
+ mDrawingState.dimmingEnabled = dimmingEnabled;
+ mDrawingState.modified = true;
+ setTransactionFlags(eTransactionNeeded);
+ return true;
+}
+
bool Layer::setFrameRateSelectionPriority(int32_t priority) {
if (mDrawingState.frameRateSelectionPriority == priority) return false;
mDrawingState.frameRateSelectionPriority = priority;