diff options
| author | 2021-02-26 23:32:32 +0000 | |
|---|---|---|
| committer | 2021-02-26 23:32:32 +0000 | |
| commit | 53c4e8aa7c347f8e187090effd15ba7d803b110a (patch) | |
| tree | 699dacdc15543fd313bc5f0196418ce8db3a29ca /services/surfaceflinger/RegionSamplingThread.cpp | |
| parent | d2bed277967c45e19f2310d5c20be46235a08d78 (diff) | |
| parent | 0d995106c0fb4480ac1de5f58667d918fa9aea62 (diff) | |
Merge "Dispatch texture destruction off of render thread for screenshots" into sc-dev
Diffstat (limited to 'services/surfaceflinger/RegionSamplingThread.cpp')
| -rw-r--r-- | services/surfaceflinger/RegionSamplingThread.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/services/surfaceflinger/RegionSamplingThread.cpp b/services/surfaceflinger/RegionSamplingThread.cpp index 09615f920d..e06bc88f7c 100644 --- a/services/surfaceflinger/RegionSamplingThread.cpp +++ b/services/surfaceflinger/RegionSamplingThread.cpp @@ -481,6 +481,12 @@ void RegionSamplingThread::captureSample() { // 1) The region sampling thread is the last owner of the buffer, and the freeing of the buffer // happens in this thread, as opposed to the main thread. // 2) The listener(s) receive their notifications prior to freeing the buffer. + if (mCachedBuffer != nullptr && mCachedBuffer != buffer) { + if (mFlinger.getRenderEngine().getRenderEngineType() == + renderengine::RenderEngine::RenderEngineType::SKIA_GL_THREADED) { + mFlinger.getRenderEngine().unbindExternalTextureBuffer(mCachedBuffer->getId()); + } + } mCachedBuffer = buffer; ATRACE_INT(lumaSamplingStepTag, static_cast<int>(samplingStep::noWorkNeeded)); } |