Loading libs/gui/Surface.cpp +0 −9 Original line number Diff line number Diff line Loading @@ -2027,15 +2027,6 @@ int Surface::connect(int api) { return connect(api, listener); } int Surface::connect(int api, const sp<SurfaceListener>& listener) { return connect(api, listener, false); } int Surface::connect( int api, bool reportBufferRemoval, const sp<SurfaceListener>& sListener) { return connect(api, sListener, reportBufferRemoval); } int Surface::connect(int api, const sp<SurfaceListener>& listener, bool reportBufferRemoval) { ATRACE_CALL(); ALOGV("Surface::connect"); Loading libs/gui/include/gui/Surface.h +3 −8 Original line number Diff line number Diff line Loading @@ -381,20 +381,15 @@ public: virtual int unlockAndPost(); virtual int query(int what, int* value) const; virtual int connect(int api, const sp<SurfaceListener>& listener); // When reportBufferRemoval is true, clients must call getAndFlushRemovedBuffers to fetch // GraphicBuffers removed from this surface after a dequeueBuffer, detachNextBuffer or // attachBuffer call. This allows clients with their own buffer caches to free up buffers no // longer in use by this surface. virtual int connect(int api, const sp<SurfaceListener>& listener, bool reportBufferRemoval); virtual int detachNextBuffer(sp<GraphicBuffer>* outBuffer, sp<Fence>* outFence); virtual int connect(int api, const sp<SurfaceListener>& listener, bool reportBufferRemoval = false); virtual int detachNextBuffer(sp<GraphicBuffer>* outBuffer, sp<Fence>* outFence); virtual int attachBuffer(ANativeWindowBuffer*); virtual int connect( int api, bool reportBufferRemoval, const sp<SurfaceListener>& sListener); virtual void destroy(); // When client connects to Surface with reportBufferRemoval set to true, any buffers removed Loading libs/gui/tests/Surface_test.cpp +9 −9 Original line number Diff line number Diff line Loading @@ -151,10 +151,10 @@ protected: if (hasSurfaceListener) { listener = new FakeSurfaceListener(enableReleasedCb); } ASSERT_EQ(OK, surface->connect( NATIVE_WINDOW_API_CPU, /*reportBufferRemoval*/true, /*listener*/listener)); ASSERT_EQ(OK, surface->connect(NATIVE_WINDOW_API_CPU, /*listener*/ listener, /*reportBufferRemoval*/ true)); const int BUFFER_COUNT = 4 + extraDiscardedBuffers; ASSERT_EQ(NO_ERROR, native_window_set_buffer_count(window.get(), BUFFER_COUNT)); ASSERT_EQ(NO_ERROR, native_window_set_usage(window.get(), TEST_PRODUCER_USAGE_BITS)); Loading Loading @@ -500,8 +500,8 @@ TEST_F(SurfaceTest, GetAndFlushRemovedBuffers) { sp<Surface> surface = new Surface(producer); sp<ANativeWindow> window(surface); sp<StubSurfaceListener> listener = new StubSurfaceListener(); ASSERT_EQ(OK, surface->connect( NATIVE_WINDOW_API_CPU, ASSERT_EQ(OK, surface->connect(NATIVE_WINDOW_API_CPU, /*listener*/ listener, /*reportBufferRemoval*/ true)); const int BUFFER_COUNT = 4; Loading Loading @@ -2374,7 +2374,7 @@ TEST_F(SurfaceTest, QueueAcquireReleaseDequeue_CalledInStack_DoesNotDeadlock) { consumer->setFrameAvailableListener(consumerListener); sp<DequeuingSurfaceListener> surfaceListener = sp<DequeuingSurfaceListener>::make(surface); EXPECT_EQ(OK, surface->connect(NATIVE_WINDOW_API_CPU, false, surfaceListener)); EXPECT_EQ(OK, surface->connect(NATIVE_WINDOW_API_CPU, surfaceListener, false)); EXPECT_EQ(OK, surface->setMaxDequeuedBufferCount(2)); Loading Loading
libs/gui/Surface.cpp +0 −9 Original line number Diff line number Diff line Loading @@ -2027,15 +2027,6 @@ int Surface::connect(int api) { return connect(api, listener); } int Surface::connect(int api, const sp<SurfaceListener>& listener) { return connect(api, listener, false); } int Surface::connect( int api, bool reportBufferRemoval, const sp<SurfaceListener>& sListener) { return connect(api, sListener, reportBufferRemoval); } int Surface::connect(int api, const sp<SurfaceListener>& listener, bool reportBufferRemoval) { ATRACE_CALL(); ALOGV("Surface::connect"); Loading
libs/gui/include/gui/Surface.h +3 −8 Original line number Diff line number Diff line Loading @@ -381,20 +381,15 @@ public: virtual int unlockAndPost(); virtual int query(int what, int* value) const; virtual int connect(int api, const sp<SurfaceListener>& listener); // When reportBufferRemoval is true, clients must call getAndFlushRemovedBuffers to fetch // GraphicBuffers removed from this surface after a dequeueBuffer, detachNextBuffer or // attachBuffer call. This allows clients with their own buffer caches to free up buffers no // longer in use by this surface. virtual int connect(int api, const sp<SurfaceListener>& listener, bool reportBufferRemoval); virtual int detachNextBuffer(sp<GraphicBuffer>* outBuffer, sp<Fence>* outFence); virtual int connect(int api, const sp<SurfaceListener>& listener, bool reportBufferRemoval = false); virtual int detachNextBuffer(sp<GraphicBuffer>* outBuffer, sp<Fence>* outFence); virtual int attachBuffer(ANativeWindowBuffer*); virtual int connect( int api, bool reportBufferRemoval, const sp<SurfaceListener>& sListener); virtual void destroy(); // When client connects to Surface with reportBufferRemoval set to true, any buffers removed Loading
libs/gui/tests/Surface_test.cpp +9 −9 Original line number Diff line number Diff line Loading @@ -151,10 +151,10 @@ protected: if (hasSurfaceListener) { listener = new FakeSurfaceListener(enableReleasedCb); } ASSERT_EQ(OK, surface->connect( NATIVE_WINDOW_API_CPU, /*reportBufferRemoval*/true, /*listener*/listener)); ASSERT_EQ(OK, surface->connect(NATIVE_WINDOW_API_CPU, /*listener*/ listener, /*reportBufferRemoval*/ true)); const int BUFFER_COUNT = 4 + extraDiscardedBuffers; ASSERT_EQ(NO_ERROR, native_window_set_buffer_count(window.get(), BUFFER_COUNT)); ASSERT_EQ(NO_ERROR, native_window_set_usage(window.get(), TEST_PRODUCER_USAGE_BITS)); Loading Loading @@ -500,8 +500,8 @@ TEST_F(SurfaceTest, GetAndFlushRemovedBuffers) { sp<Surface> surface = new Surface(producer); sp<ANativeWindow> window(surface); sp<StubSurfaceListener> listener = new StubSurfaceListener(); ASSERT_EQ(OK, surface->connect( NATIVE_WINDOW_API_CPU, ASSERT_EQ(OK, surface->connect(NATIVE_WINDOW_API_CPU, /*listener*/ listener, /*reportBufferRemoval*/ true)); const int BUFFER_COUNT = 4; Loading Loading @@ -2374,7 +2374,7 @@ TEST_F(SurfaceTest, QueueAcquireReleaseDequeue_CalledInStack_DoesNotDeadlock) { consumer->setFrameAvailableListener(consumerListener); sp<DequeuingSurfaceListener> surfaceListener = sp<DequeuingSurfaceListener>::make(surface); EXPECT_EQ(OK, surface->connect(NATIVE_WINDOW_API_CPU, false, surfaceListener)); EXPECT_EQ(OK, surface->connect(NATIVE_WINDOW_API_CPU, surfaceListener, false)); EXPECT_EQ(OK, surface->setMaxDequeuedBufferCount(2)); Loading