Swap 'format' and 'frameworkFormat' and mark 'frameworkFormat' const in gralloc_alloc
There are too many format related variables in flight. This change
makes easier to track what variables change.
Bug: 141385612
Test: build
Change-Id: I94ec0200c10ec09abd1f299cf37c1d5acc276d43
Signed-off-by: Roman Kiryanov <rkir@google.com>
diff --git a/system/gralloc/gralloc_old.cpp b/system/gralloc/gralloc_old.cpp
index c451a3b..3e7bd34 100644
--- a/system/gralloc/gralloc_old.cpp
+++ b/system/gralloc/gralloc_old.cpp
@@ -528,10 +528,10 @@
static void gralloc_dump(struct alloc_device_t* /*dev*/, char* /*buff*/, int /*buff_len*/) {}
static int gralloc_alloc(alloc_device_t* dev,
- int w, int h, int format, int usage,
+ int w, int h, const int frameworkFormat, int usage,
buffer_handle_t* pHandle, int* pStride)
{
- D("gralloc_alloc w=%d h=%d usage=0x%x format=0x%x\n", w, h, usage, format);
+ D("gralloc_alloc w=%d h=%d usage=0x%x frameworkFormat=0x%x\n", w, h, usage, frameworkFormat);
gralloc_device_t *grdev = (gralloc_device_t *)dev;
if (!grdev || !pHandle || !pStride) {
@@ -568,7 +568,7 @@
#endif // PLATFORM_SDK_VERSION
// Keep around original requested format for later validation
- int frameworkFormat = format;
+ int format = frameworkFormat;
// Pick the right concrete pixel format given the endpoints as encoded in
// the usage bits. Every end-point pair needs explicit listing here.
#if PLATFORM_SDK_VERSION >= 17