summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlec Mouri <alecmouri@google.com>2021-07-09 00:51:10 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2021-07-09 00:51:10 +0000
commita910271057b4cf527159900f9d2cd5e7a4ee54fd (patch)
tree5c6678549d0714266168dfbc0d7212d0be3b06f7
parent7b86b176d07c1e9d60089e5e0086a012c6b3e049 (diff)
parent7c4913dc2e12dc82351346523ba9ed33c3b50d49 (diff)
downloadnative-a910271057b4cf527159900f9d2cd5e7a4ee54fd.tar.gz
Merge "Actually use texture bounds in CachedSet::getTextureBounds" into sc-dev
-rw-r--r--services/surfaceflinger/CompositionEngine/include/compositionengine/impl/planner/CachedSet.h4
-rw-r--r--services/surfaceflinger/CompositionEngine/tests/planner/CachedSetTest.cpp2
2 files changed, 4 insertions, 2 deletions
diff --git a/services/surfaceflinger/CompositionEngine/include/compositionengine/impl/planner/CachedSet.h b/services/surfaceflinger/CompositionEngine/include/compositionengine/impl/planner/CachedSet.h
index 2bf931cb3d..2e7a377feb 100644
--- a/services/surfaceflinger/CompositionEngine/include/compositionengine/impl/planner/CachedSet.h
+++ b/services/surfaceflinger/CompositionEngine/include/compositionengine/impl/planner/CachedSet.h
@@ -65,7 +65,9 @@ public:
size_t getLayerCount() const { return mLayers.size(); }
const Layer& getFirstLayer() const { return mLayers[0]; }
const Rect& getBounds() const { return mBounds; }
- Rect getTextureBounds() const { return mOutputSpace.content; }
+ Rect getTextureBounds() const {
+ return mTexture ? mTexture->get()->getBuffer()->getBounds() : Rect::INVALID_RECT;
+ }
const Region& getVisibleRegion() const { return mVisibleRegion; }
size_t getAge() const { return mAge; }
std::shared_ptr<renderengine::ExternalTexture> getBuffer() const {
diff --git a/services/surfaceflinger/CompositionEngine/tests/planner/CachedSetTest.cpp b/services/surfaceflinger/CompositionEngine/tests/planner/CachedSetTest.cpp
index 7f0e186692..b05a594a92 100644
--- a/services/surfaceflinger/CompositionEngine/tests/planner/CachedSetTest.cpp
+++ b/services/surfaceflinger/CompositionEngine/tests/planner/CachedSetTest.cpp
@@ -355,7 +355,7 @@ TEST_F(CachedSetTest, render) {
expectReadyBuffer(cachedSet);
EXPECT_EQ(mOutputState.framebufferSpace, cachedSet.getOutputSpace());
- EXPECT_EQ(mOutputState.framebufferSpace.content, cachedSet.getTextureBounds());
+ EXPECT_EQ(Rect(kOutputSize.width, kOutputSize.height), cachedSet.getTextureBounds());
// Now check that appending a new cached set properly cleans up RenderEngine resources.
CachedSet::Layer& layer3 = *mTestLayers[2]->cachedSetLayer.get();