summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Phillips <robertphillips@google.com>2023-08-23 15:18:27 -0400
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-09-15 21:19:15 +0000
commit1bb095c98715f6e34ffd8ab8c4b6721a007f8098 (patch)
tree285b0b6b97120013884843dcd5e060a691f5d1a3
parentbfcf75076e562945bae131a4929f29a90d0d2481 (diff)
downloadnative-1bb095c98715f6e34ffd8ab8c4b6721a007f8098.tar.gz
Don't look through the buffer cache in protected contexts
Test: manual - protected content in Netflix apk, even without blurring Without this change getOrCreateBackendTexture can return an un-Protected backend texture when a Protected one is required. This causes the Protected content draw to be dropped. Note: This CL originally landed in main as part of a broader fix for blurring protected content, but it has been discovered to fix other issues with protected content that were otherwise still visible in this branch. Bug: 242266174 Bug: 294357792 (cherry picked from commit 59f71734258e3959d2d3d8937d689b1bb88941db) (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:a0c7cca5769008d02e0ce227feb3efd7471813a4) Merged-In: I9d7bab890ae8d88656e77dede962b40e926580c8 Change-Id: I9d7bab890ae8d88656e77dede962b40e926580c8
-rw-r--r--libs/renderengine/skia/SkiaRenderEngine.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/libs/renderengine/skia/SkiaRenderEngine.cpp b/libs/renderengine/skia/SkiaRenderEngine.cpp
index 76ebf9d0c2..2a977630a3 100644
--- a/libs/renderengine/skia/SkiaRenderEngine.cpp
+++ b/libs/renderengine/skia/SkiaRenderEngine.cpp
@@ -397,12 +397,10 @@ void SkiaRenderEngine::mapExternalTextureBuffer(const sp<GraphicBuffer>& buffer,
}
// We don't attempt to map a buffer if the buffer contains protected content. In GL this is
// important because GPU resources for protected buffers are much more limited. (In Vk we
- // simply match the existing behavior for protected buffers.) In Vk, we never cache any
- // buffers while in a protected context, since Vk cannot share across contexts, and protected
- // is less common.
+ // simply match the existing behavior for protected buffers.) We also never cache any
+ // buffers while in a protected context.
const bool isProtectedBuffer = buffer->getUsage() & GRALLOC_USAGE_PROTECTED;
- if (isProtectedBuffer ||
- (mRenderEngineType == RenderEngineType::SKIA_VK_THREADED && isProtected())) {
+ if (isProtectedBuffer || isProtected()) {
return;
}
ATRACE_CALL();
@@ -467,9 +465,8 @@ void SkiaRenderEngine::unmapExternalTextureBuffer(sp<GraphicBuffer>&& buffer) {
std::shared_ptr<AutoBackendTexture::LocalRef> SkiaRenderEngine::getOrCreateBackendTexture(
const sp<GraphicBuffer>& buffer, bool isOutputBuffer) {
- // Do not lookup the buffer in the cache for protected contexts with the SkiaVk back-end
- if (mRenderEngineType == RenderEngineType::SKIA_GL_THREADED ||
- (mRenderEngineType == RenderEngineType::SKIA_VK_THREADED && !isProtected())) {
+ // Do not lookup the buffer in the cache for protected contexts
+ if (!isProtected()) {
if (const auto& it = mTextureCache.find(buffer->getId()); it != mTextureCache.end()) {
return it->second;
}