Loading include/gui/Surface.h +5 −0 Original line number Diff line number Diff line Loading @@ -310,6 +310,11 @@ private: // must be accessed from lock/unlock thread only Region mDirtyRegion; #ifdef SURFACE_SKIP_FIRST_DEQUEUE bool mDequeuedOnce; #endif }; }; // namespace android Loading libs/gui/Android.mk +4 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,10 @@ ifeq ($(BOARD_USE_MHEAP_SCREENSHOT),true) LOCAL_CFLAGS += -DUSE_MHEAP_SCREENSHOT endif ifeq ($(BOARD_EGL_SKIP_FIRST_DEQUEUE),true) LOCAL_CFLAGS += -DSURFACE_SKIP_FIRST_DEQUEUE endif LOCAL_MODULE:= libgui ifeq ($(TARGET_BOARD_PLATFORM), tegra) Loading libs/gui/Surface.cpp +18 −5 Original line number Diff line number Diff line Loading @@ -89,6 +89,9 @@ Surface::Surface( mConnectedToCpu = false; mProducerControlledByApp = controlledByApp; mSwapIntervalZero = false; #ifdef SURFACE_SKIP_FIRST_DEQUEUE mDequeuedOnce = false; #endif } Surface::~Surface() { Loading Loading @@ -278,6 +281,9 @@ int Surface::dequeueBuffer(android_native_buffer_t** buffer, int* fenceFd) { } *buffer = gbuf.get(); #ifdef SURFACE_SKIP_FIRST_DEQUEUE if (!mDequeuedOnce) mDequeuedOnce = true; #endif return OK; } Loading Loading @@ -389,6 +395,12 @@ int Surface::query(int what, int* value) const { } break; case NATIVE_WINDOW_QUEUES_TO_WINDOW_COMPOSER: { #ifdef SURFACE_SKIP_FIRST_DEQUEUE if (!mDequeuedOnce) { *value = 0; } else #endif { sp<ISurfaceComposer> composer( ComposerService::getComposerService()); if (composer->authenticateSurfaceTexture(mGraphicBufferProducer)) { Loading @@ -396,6 +408,7 @@ int Surface::query(int what, int* value) const { } else { *value = 0; } } return NO_ERROR; } case NATIVE_WINDOW_CONCRETE_TYPE: Loading Loading
include/gui/Surface.h +5 −0 Original line number Diff line number Diff line Loading @@ -310,6 +310,11 @@ private: // must be accessed from lock/unlock thread only Region mDirtyRegion; #ifdef SURFACE_SKIP_FIRST_DEQUEUE bool mDequeuedOnce; #endif }; }; // namespace android Loading
libs/gui/Android.mk +4 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,10 @@ ifeq ($(BOARD_USE_MHEAP_SCREENSHOT),true) LOCAL_CFLAGS += -DUSE_MHEAP_SCREENSHOT endif ifeq ($(BOARD_EGL_SKIP_FIRST_DEQUEUE),true) LOCAL_CFLAGS += -DSURFACE_SKIP_FIRST_DEQUEUE endif LOCAL_MODULE:= libgui ifeq ($(TARGET_BOARD_PLATFORM), tegra) Loading
libs/gui/Surface.cpp +18 −5 Original line number Diff line number Diff line Loading @@ -89,6 +89,9 @@ Surface::Surface( mConnectedToCpu = false; mProducerControlledByApp = controlledByApp; mSwapIntervalZero = false; #ifdef SURFACE_SKIP_FIRST_DEQUEUE mDequeuedOnce = false; #endif } Surface::~Surface() { Loading Loading @@ -278,6 +281,9 @@ int Surface::dequeueBuffer(android_native_buffer_t** buffer, int* fenceFd) { } *buffer = gbuf.get(); #ifdef SURFACE_SKIP_FIRST_DEQUEUE if (!mDequeuedOnce) mDequeuedOnce = true; #endif return OK; } Loading Loading @@ -389,6 +395,12 @@ int Surface::query(int what, int* value) const { } break; case NATIVE_WINDOW_QUEUES_TO_WINDOW_COMPOSER: { #ifdef SURFACE_SKIP_FIRST_DEQUEUE if (!mDequeuedOnce) { *value = 0; } else #endif { sp<ISurfaceComposer> composer( ComposerService::getComposerService()); if (composer->authenticateSurfaceTexture(mGraphicBufferProducer)) { Loading @@ -396,6 +408,7 @@ int Surface::query(int what, int* value) const { } else { *value = 0; } } return NO_ERROR; } case NATIVE_WINDOW_CONCRETE_TYPE: Loading