Remove sampling usage bit requirement for output buffers
Skia RenderEngine hits a different path for creating SkSurfaces that
does not enforce presence of the sampling bit, so we don't really need
to enforce it here.
Note that in practice the sampling bit may still be provided in
anticipation of SF caching, so this is really just for tests/cleanup.
Bug: 180650640
Test: First, patch out sampling usage bit in RenderSurface
Test: boots
Test: simulate secondary displays
Test: force GPU composition
Change-Id: I35558beec60b1c228e1fa0ad6382482869e1719c
diff --git a/libs/renderengine/skia/SkiaGLRenderEngine.cpp b/libs/renderengine/skia/SkiaGLRenderEngine.cpp
index 327b04c..b676a35 100644
--- a/libs/renderengine/skia/SkiaGLRenderEngine.cpp
+++ b/libs/renderengine/skia/SkiaGLRenderEngine.cpp
@@ -404,10 +404,6 @@
return true;
}
-static bool hasUsage(const AHardwareBuffer_Desc& desc, uint64_t usage) {
- return !!(desc.usage & usage);
-}
-
static float toDegrees(uint32_t transform) {
switch (transform) {
case ui::Transform::ROT_90:
@@ -586,8 +582,6 @@
auto& cache = mInProtectedContext ? mProtectedTextureCache : mTextureCache;
AHardwareBuffer_Desc bufferDesc;
AHardwareBuffer_describe(buffer->toAHardwareBuffer(), &bufferDesc);
- LOG_ALWAYS_FATAL_IF(!hasUsage(bufferDesc, AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE),
- "missing usage");
std::shared_ptr<AutoBackendTexture::LocalRef> surfaceTextureRef = nullptr;
if (useFramebufferCache) {