summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/LayerFE.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'services/surfaceflinger/LayerFE.cpp')
-rw-r--r--services/surfaceflinger/LayerFE.cpp27
1 files changed, 17 insertions, 10 deletions
diff --git a/services/surfaceflinger/LayerFE.cpp b/services/surfaceflinger/LayerFE.cpp
index f855f278c3..2dbcb841ac 100644
--- a/services/surfaceflinger/LayerFE.cpp
+++ b/services/surfaceflinger/LayerFE.cpp
@@ -16,7 +16,7 @@
// #define LOG_NDEBUG 0
#undef LOG_TAG
-#define LOG_TAG "LayerFE"
+#define LOG_TAG "SurfaceFlinger"
#define ATRACE_TAG ATRACE_TAG_GRAPHICS
#include <gui/GLConsumer.h>
@@ -208,9 +208,15 @@ void LayerFE::prepareBufferStateClientComposition(
// activeBuffer, then we need to return LayerSettings.
return;
}
- const bool blackOutLayer =
- (mSnapshot->hasProtectedContent && !targetSettings.supportsProtectedContent) ||
- ((mSnapshot->isSecure || mSnapshot->hasProtectedContent) && !targetSettings.isSecure);
+ bool blackOutLayer;
+ if (FlagManager::getInstance().display_protected()) {
+ blackOutLayer = (mSnapshot->hasProtectedContent && !targetSettings.isProtected) ||
+ (mSnapshot->isSecure && !targetSettings.isSecure);
+ } else {
+ blackOutLayer = (mSnapshot->hasProtectedContent && !targetSettings.isProtected) ||
+ ((mSnapshot->isSecure || mSnapshot->hasProtectedContent) &&
+ !targetSettings.isSecure);
+ }
const bool bufferCanBeUsedAsHwTexture =
mSnapshot->externalTexture->getUsage() & GraphicBuffer::USAGE_HW_TEXTURE;
if (blackOutLayer || !bufferCanBeUsedAsHwTexture) {
@@ -223,9 +229,7 @@ void LayerFE::prepareBufferStateClientComposition(
layerSettings.source.buffer.buffer = mSnapshot->externalTexture;
layerSettings.source.buffer.isOpaque = mSnapshot->contentOpaque;
layerSettings.source.buffer.fence = mSnapshot->acquireFence;
- layerSettings.source.buffer.textureName = mSnapshot->textureName;
layerSettings.source.buffer.usePremultipliedAlpha = mSnapshot->premultipliedAlpha;
- layerSettings.source.buffer.isY410BT2020 = mSnapshot->isHdrY410;
bool hasSmpte2086 = mSnapshot->hdrMetadata.validTypes & HdrMetadata::SMPTE2086;
bool hasCta861_3 = mSnapshot->hdrMetadata.validTypes & HdrMetadata::CTA861_3;
float maxLuminance = 0.f;
@@ -249,10 +253,13 @@ void LayerFE::prepareBufferStateClientComposition(
layerSettings.frameNumber = mSnapshot->frameNumber;
layerSettings.bufferId = mSnapshot->externalTexture->getId();
+ const bool useFiltering = targetSettings.needsFiltering ||
+ mSnapshot->geomLayerTransform.needsBilinearFiltering();
+
// Query the texture matrix given our current filtering mode.
float textureMatrix[16];
getDrawingTransformMatrix(layerSettings.source.buffer.buffer, mSnapshot->geomContentCrop,
- mSnapshot->geomBufferTransform, targetSettings.needsFiltering,
+ mSnapshot->geomBufferTransform, useFiltering,
textureMatrix);
if (mSnapshot->geomBufferUsesDisplayInverseTransform) {
@@ -303,7 +310,7 @@ void LayerFE::prepareBufferStateClientComposition(
mat4::translate(vec4(translateX, translateY, 0.f, 1.f)) *
mat4::scale(vec4(scaleWidth, scaleHeight, 1.0f, 1.0f));
- layerSettings.source.buffer.useTextureFiltering = targetSettings.needsFiltering;
+ layerSettings.source.buffer.useTextureFiltering = useFiltering;
layerSettings.source.buffer.textureTransform =
mat4(static_cast<const float*>(textureMatrix)) * tr;
@@ -312,7 +319,7 @@ void LayerFE::prepareBufferStateClientComposition(
void LayerFE::prepareShadowClientComposition(LayerFE::LayerSettings& caster,
const Rect& layerStackRect) const {
- renderengine::ShadowSettings state = mSnapshot->shadowSettings;
+ ShadowSettings state = mSnapshot->shadowSettings;
if (state.length <= 0.f || (state.ambientColor.a <= 0.f && state.spotColor.a <= 0.f)) {
return;
}
@@ -347,7 +354,7 @@ const LayerMetadata* LayerFE::getRelativeMetadata() const {
}
int32_t LayerFE::getSequence() const {
- return mSnapshot->sequence;
+ return static_cast<int32_t>(mSnapshot->uniqueSequence);
}
bool LayerFE::hasRoundedCorners() const {