From: Yahan Zhou Date: Fri, 1 Jul 2016 22:47:21 +0000 (-0700) Subject: Make it compatible with ics-mr1 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=f9cb1c4613ba271d315f786ed4dcb3581fe1b7f0;p=android-x86%2Fdevice-generic-goldfish-opengl.git Make it compatible with ics-mr1 Change-Id: I8661fa4cc93111dfdb5fe9fa73f8a47b2820f615 --- diff --git a/system/gralloc/gralloc.cpp b/system/gralloc/gralloc.cpp index 28d6dc8..c694071 100644 --- a/system/gralloc/gralloc.cpp +++ b/system/gralloc/gralloc.cpp @@ -153,15 +153,15 @@ static int gralloc_alloc(alloc_device_t* dev, #if PLATFORM_SDK_VERSION >= 17 bool hw_cam_write = (usage & GRALLOC_USAGE_HW_CAMERA_WRITE); bool hw_cam_read = (usage & GRALLOC_USAGE_HW_CAMERA_READ); -#else // PLATFORM_SDK_VERSION >= 17 +#else // PLATFORM_SDK_VERSION bool hw_cam_write = false; bool hw_cam_read = false; -#endif // PLATFORM_SDK_VERSION >= 17 -#if PLATFORM_SDK_VERSION >= 16 +#endif // PLATFORM_SDK_VERSION +#if PLATFORM_SDK_VERSION >= 15 bool hw_vid_enc_read = usage & GRALLOC_USAGE_HW_VIDEO_ENCODER; -#else // PLATFORM_SDK_VERSION >= 16 +#else // PLATFORM_SDK_VERSION bool hw_vid_enc_read = false; -#endif // PLATFORM_SDK_VERSION >= 16 +#endif // PLATFORM_SDK_VERSION // Keep around original requested format for later validation int frameworkFormat = format; @@ -344,15 +344,15 @@ static int gralloc_alloc(alloc_device_t* dev, // rendering will still happen on the host but we also need to be able to // read back from the color buffer, which requires that there is a buffer // -#if PLATFORM_SDK_VERSION >= 16 +#if PLATFORM_SDK_VERSION >= 15 if (usage & (GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_2D | GRALLOC_USAGE_HW_COMPOSER | GRALLOC_USAGE_HW_FB | GRALLOC_USAGE_SW_READ_MASK) ) { -#else // PLATFORM_SDK_VERSION >= 16 +#else // PLATFORM_SDK_VERSION if (usage & (GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_2D | GRALLOC_USAGE_HW_FB | GRALLOC_USAGE_SW_READ_MASK) ) { -#endif // PLATFORM_SDK_VERSION >= 16 +#endif // PLATFORM_SDK_VERSION DEFINE_HOST_CONNECTION; if (hostCon && rcEnc) { cb->hostHandle = rcEnc->rcCreateColorBuffer(rcEnc, w, h, glFormat); @@ -673,16 +673,16 @@ static int gralloc_lock(gralloc_module_t const* module, #if PLATFORM_SDK_VERSION >= 17 bool hw_cam_write = (usage & GRALLOC_USAGE_HW_CAMERA_WRITE); bool hw_cam_read = (usage & GRALLOC_USAGE_HW_CAMERA_READ); -#else // PLATFORM_SDK_VERSION >= 17 +#else // PLATFORM_SDK_VERSION bool hw_cam_write = false; bool hw_cam_read = false; -#endif // PLATFORM_SDK_VERSION >= 17 +#endif // PLATFORM_SDK_VERSION -#if PLATFORM_SDK_VERSION >= 16 +#if PLATFORM_SDK_VERSION >= 15 bool hw_vid_enc_read = (usage & GRALLOC_USAGE_HW_VIDEO_ENCODER); -#else // PLATFORM_SDK_VERSION >= 16 +#else // PLATFORM_SDK_VERSION bool hw_vid_enc_read = false; -#endif // PLATFORM_SDK_VERSION >= 16 +#endif // PLATFORM_SDK_VERSION bool sw_read_allowed = (0 != (cb->usage & GRALLOC_USAGE_SW_READ_MASK)); bool sw_write_allowed = (0 != (cb->usage & GRALLOC_USAGE_SW_WRITE_MASK));