summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/surfaceflinger/BufferLayer.cpp10
-rw-r--r--services/surfaceflinger/BufferLayer.h4
2 files changed, 8 insertions, 6 deletions
diff --git a/services/surfaceflinger/BufferLayer.cpp b/services/surfaceflinger/BufferLayer.cpp
index 4e4d7dd371..4eafeac293 100644
--- a/services/surfaceflinger/BufferLayer.cpp
+++ b/services/surfaceflinger/BufferLayer.cpp
@@ -176,7 +176,7 @@ void BufferLayer::onDraw(const RenderArea& renderArea, const Region& clip,
if (!blackOutLayer) {
// TODO: we could be more subtle with isFixedSize()
- const bool useFiltering = needsFiltering(renderArea) || isFixedSize();
+ const bool useFiltering = needsFiltering() || renderArea.needsFiltering() || isFixedSize();
// Query the texture matrix given our current filtering mode.
float textureMatrix[16];
@@ -597,8 +597,11 @@ bool BufferLayer::getOpacityForFormat(uint32_t format) {
return true;
}
-bool BufferLayer::needsFiltering(const RenderArea& renderArea) const {
- return mNeedsFiltering || renderArea.needsFiltering();
+bool BufferLayer::needsFiltering() const {
+ const auto displayFrame = getBE().compositionInfo.hwc.displayFrame;
+ const auto sourceCrop = getBE().compositionInfo.hwc.sourceCrop;
+ return mNeedsFiltering || sourceCrop.getHeight() != displayFrame.getHeight() ||
+ sourceCrop.getWidth() != displayFrame.getWidth();
}
void BufferLayer::drawWithOpenGL(const RenderArea& renderArea, bool useIdentityTransform) const {
@@ -623,7 +626,6 @@ void BufferLayer::drawWithOpenGL(const RenderArea& renderArea, bool useIdentityT
*/
const Rect bounds{computeBounds()}; // Rounds from FloatRect
- ui::Transform t = getTransform();
Rect win = bounds;
const int bufferWidth = getBufferSize(s).getWidth();
const int bufferHeight = getBufferSize(s).getHeight();
diff --git a/services/surfaceflinger/BufferLayer.h b/services/surfaceflinger/BufferLayer.h
index be16cf584d..6eda20de20 100644
--- a/services/surfaceflinger/BufferLayer.h
+++ b/services/surfaceflinger/BufferLayer.h
@@ -168,8 +168,8 @@ protected:
const uint32_t mTextureName;
private:
- // needsLinearFiltering - true if this surface's state requires filtering
- bool needsFiltering(const RenderArea& renderArea) const;
+ // Returns true if this layer requires filtering
+ bool needsFiltering() const;
// drawing
void drawWithOpenGL(const RenderArea& renderArea, bool useIdentityTransform) const;