Use a flag to determine isRenderable

Rely on whether the GraphicBuffer has GRALLOC_USAGE_HW_RENDER to
determine whether to treat it as a potential output buffer, rather than
whether the client intends to write to it.

This speculatively fixes a crash where a GraphicBuffer is stored in
SkiaRenderEngine's cache without being considered writable, and then
a later call attempts to pull it out of the cache to use as output.

In practice, this means that when importing the GraphicBuffer as a
backend texture in Skia, Skia will treat it as though it might be an
output buffer, even if we are only going to sample from it. This should
not have an effect on sampling performance.

Like I859c6b9ecabfb27151c6a45157ffd7c92cb54275 but basing the behavior
change on a flag. A rebased version of that CL will later remove the
extra parameter.

Bug: 305445199
Test: librenderengine_test
Change-Id: I6c436b6b80b27930d82aabf22107216172773b56
diff --git a/services/surfaceflinger/common/FlagManager.cpp b/services/surfaceflinger/common/FlagManager.cpp
index b07e7ac..d6ebdac 100644
--- a/services/surfaceflinger/common/FlagManager.cpp
+++ b/services/surfaceflinger/common/FlagManager.cpp
@@ -130,6 +130,7 @@
     DUMP_READ_ONLY_FLAG(enable_layer_command_batching);
     DUMP_READ_ONLY_FLAG(screenshot_fence_preservation);
     DUMP_READ_ONLY_FLAG(vulkan_renderengine);
+    DUMP_READ_ONLY_FLAG(renderable_buffer_usage);
 #undef DUMP_READ_ONLY_FLAG
 #undef DUMP_SERVER_FLAG
 #undef DUMP_FLAG_INTERVAL
@@ -206,6 +207,7 @@
 FLAG_MANAGER_READ_ONLY_FLAG(enable_layer_command_batching, "")
 FLAG_MANAGER_READ_ONLY_FLAG(screenshot_fence_preservation, "debug.sf.screenshot_fence_preservation")
 FLAG_MANAGER_READ_ONLY_FLAG(vulkan_renderengine, "debug.renderengine.vulkan")
+FLAG_MANAGER_READ_ONLY_FLAG(renderable_buffer_usage, "")
 
 /// Trunk stable server flags ///
 FLAG_MANAGER_SERVER_FLAG(late_boot_misc2, "")