Loading libs/gui/Android.mk +4 −0 Original line number Diff line number Diff line Loading @@ -93,6 +93,10 @@ ifeq ($(TARGET_BOARD_PLATFORM), tegra3) LOCAL_CFLAGS += -DDONT_USE_FENCE_SYNC endif ifeq ($(TARGET_BOARD_HAS_NO_SURFACE_FLINGER), true) LOCAL_CFLAGS += -DHAVE_NO_SURFACE_FLINGER endif include $(BUILD_SHARED_LIBRARY) ifeq (,$(ONE_SHOT_MAKEFILE)) Loading libs/gui/BufferQueueCore.cpp +21 −2 Original line number Diff line number Diff line Loading @@ -28,8 +28,11 @@ #include <inttypes.h> #include <cutils/properties.h> #include <gui/BufferItem.h> #include <gui/BufferQueueCore.h> #include <gui/GraphicBufferAlloc.h> #include <gui/IConsumerListener.h> #include <gui/IGraphicBufferAlloc.h> #include <gui/IProducerListener.h> Loading Loading @@ -84,8 +87,24 @@ BufferQueueCore::BufferQueueCore(const sp<IGraphicBufferAlloc>& allocator) : HAL_DATASPACE_UNKNOWN) { if (allocator == NULL) { #ifdef HAVE_NO_SURFACE_FLINGER // Without a SurfaceFlinger, allocate in-process. This only makes // sense in systems with static SELinux configurations and no // applications (since applications need dynamic SELinux policy). mAllocator = new GraphicBufferAlloc(); #else // Run time check for headless, where we also allocate in-process. char value[PROPERTY_VALUE_MAX]; property_get("config.headless", value, "0"); if (atoi(value) == 1) { mAllocator = new GraphicBufferAlloc(); } else { sp<ISurfaceComposer> composer(ComposerService::getComposerService()); mAllocator = composer->createGraphicBufferAlloc(); } #endif // HAVE_NO_SURFACE_FLINGER if (mAllocator == NULL) { BQ_LOGE("createGraphicBufferAlloc failed"); } Loading Loading
libs/gui/Android.mk +4 −0 Original line number Diff line number Diff line Loading @@ -93,6 +93,10 @@ ifeq ($(TARGET_BOARD_PLATFORM), tegra3) LOCAL_CFLAGS += -DDONT_USE_FENCE_SYNC endif ifeq ($(TARGET_BOARD_HAS_NO_SURFACE_FLINGER), true) LOCAL_CFLAGS += -DHAVE_NO_SURFACE_FLINGER endif include $(BUILD_SHARED_LIBRARY) ifeq (,$(ONE_SHOT_MAKEFILE)) Loading
libs/gui/BufferQueueCore.cpp +21 −2 Original line number Diff line number Diff line Loading @@ -28,8 +28,11 @@ #include <inttypes.h> #include <cutils/properties.h> #include <gui/BufferItem.h> #include <gui/BufferQueueCore.h> #include <gui/GraphicBufferAlloc.h> #include <gui/IConsumerListener.h> #include <gui/IGraphicBufferAlloc.h> #include <gui/IProducerListener.h> Loading Loading @@ -84,8 +87,24 @@ BufferQueueCore::BufferQueueCore(const sp<IGraphicBufferAlloc>& allocator) : HAL_DATASPACE_UNKNOWN) { if (allocator == NULL) { #ifdef HAVE_NO_SURFACE_FLINGER // Without a SurfaceFlinger, allocate in-process. This only makes // sense in systems with static SELinux configurations and no // applications (since applications need dynamic SELinux policy). mAllocator = new GraphicBufferAlloc(); #else // Run time check for headless, where we also allocate in-process. char value[PROPERTY_VALUE_MAX]; property_get("config.headless", value, "0"); if (atoi(value) == 1) { mAllocator = new GraphicBufferAlloc(); } else { sp<ISurfaceComposer> composer(ComposerService::getComposerService()); mAllocator = composer->createGraphicBufferAlloc(); } #endif // HAVE_NO_SURFACE_FLINGER if (mAllocator == NULL) { BQ_LOGE("createGraphicBufferAlloc failed"); } Loading