summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libs/renderengine/skia/SkiaRenderEngine.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/renderengine/skia/SkiaRenderEngine.cpp b/libs/renderengine/skia/SkiaRenderEngine.cpp
index 1f18b948ed..dbf020a077 100644
--- a/libs/renderengine/skia/SkiaRenderEngine.cpp
+++ b/libs/renderengine/skia/SkiaRenderEngine.cpp
@@ -399,7 +399,10 @@ void SkiaRenderEngine::mapExternalTextureBuffer(const sp<GraphicBuffer>& buffer,
// 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 || isProtected()) {
+ // Don't attempt to map buffers if we're not gpu sampleable. Callers shouldn't send a buffer
+ // over to RenderEngine.
+ const bool isGpuSampleable = buffer->getUsage() & GRALLOC_USAGE_HW_TEXTURE;
+ if (isProtectedBuffer || isProtected() || !isGpuSampleable) {
return;
}
ATRACE_CALL();