Loading libs/gui/IGraphicBufferAlloc.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -55,7 +55,7 @@ public: status_t result = reply.readInt32(); if (result == NO_ERROR) { graphicBuffer = new GraphicBuffer(); reply.read(*graphicBuffer); result = reply.read(*graphicBuffer); // reply.readStrongBinder(); // here we don't even have to read the BufferReference from // the parcel, it'll die with the parcel. Loading libs/gui/SurfaceTexture.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -288,7 +288,9 @@ status_t SurfaceTexture::updateTexImage(BufferRejecter* rejecter) { computeCurrentTransformMatrix(); } else { if (err < 0) { ST_LOGE("updateTexImage failed on acquire %d", err); ST_LOGE("updateTexImage: acquire failed: %s (%d)", strerror(-err), err); return err; } // We always bind the texture even if we don't update its contents. glBindTexture(mTexTarget, mTexName); Loading libs/gui/tests/SurfaceTexture_test.cpp +31 −27 Original line number Diff line number Diff line Loading @@ -711,7 +711,7 @@ TEST_F(SurfaceTextureGLTest, TexturingFromCpuFilledYV12BufferNpot) { ASSERT_EQ(NO_ERROR, mANW->queueBuffer(mANW.get(), buf->getNativeBuffer(), -1)); mST->updateTexImage(); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); glClearColor(0.2, 0.2, 0.2, 0.2); glClear(GL_COLOR_BUFFER_BIT); Loading Loading @@ -757,7 +757,7 @@ TEST_F(SurfaceTextureGLTest, TexturingFromCpuFilledYV12BufferPow2) { ASSERT_EQ(NO_ERROR, mANW->queueBuffer(mANW.get(), buf->getNativeBuffer(), -1)); mST->updateTexImage(); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); glClearColor(0.2, 0.2, 0.2, 0.2); glClear(GL_COLOR_BUFFER_BIT); Loading Loading @@ -817,7 +817,7 @@ TEST_F(SurfaceTextureGLTest, TexturingFromCpuFilledYV12BufferWithCrop) { ASSERT_EQ(NO_ERROR, mANW->queueBuffer(mANW.get(), buf->getNativeBuffer(), -1)); mST->updateTexImage(); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); glClearColor(0.2, 0.2, 0.2, 0.2); glClear(GL_COLOR_BUFFER_BIT); Loading Loading @@ -966,7 +966,7 @@ TEST_F(SurfaceTextureGLTest, TexturingFromCpuFilledYV12BuffersRepeatedly) { if (i > 1) { mFW->waitForFrame(); } mST->updateTexImage(); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); drawTexture(); for (int j = 0; j < numTestPixels; j++) { Loading Loading @@ -997,7 +997,7 @@ TEST_F(SurfaceTextureGLTest, TexturingFromCpuFilledRGBABufferNpot) { ASSERT_NO_FATAL_FAILURE(produceOneRGBA8Frame(mANW)); mST->updateTexImage(); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); glClearColor(0.2, 0.2, 0.2, 0.2); glClear(GL_COLOR_BUFFER_BIT); Loading Loading @@ -1039,7 +1039,7 @@ TEST_F(SurfaceTextureGLTest, TexturingFromCpuFilledRGBABufferPow2) { ASSERT_NO_FATAL_FAILURE(produceOneRGBA8Frame(mANW)); mST->updateTexImage(); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); glClearColor(0.2, 0.2, 0.2, 0.2); glClear(GL_COLOR_BUFFER_BIT); Loading Loading @@ -1453,8 +1453,9 @@ TEST_F(SurfaceTextureGLToGLTest, TexturingFromGLFilledRGBABufferPow2) { glDisable(GL_SCISSOR_TEST); mST->updateTexImage(); // Skip the first frame, which was empty mST->updateTexImage(); // Skip the first frame, which was empty ASSERT_EQ(NO_ERROR, mST->updateTexImage()); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); glClearColor(0.2, 0.2, 0.2, 0.2); glClear(GL_COLOR_BUFFER_BIT); Loading Loading @@ -1508,7 +1509,7 @@ TEST_F(SurfaceTextureGLToGLTest, EglDestroySurfaceUnrefsBuffers) { mEglContext)); ASSERT_EQ(EGL_SUCCESS, eglGetError()); mFW->waitForFrame(); mST->updateTexImage(); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); buffers[i] = mST->getCurrentBuffer(); } Loading Loading @@ -1639,8 +1640,9 @@ TEST_F(SurfaceTextureGLToGLTest, TexturingFromUserSizedGLFilledBuffer) { glDisable(GL_SCISSOR_TEST); mST->updateTexImage(); // Skip the first frame, which was empty mST->updateTexImage(); // Skip the first frame, which was empty ASSERT_EQ(NO_ERROR, mST->updateTexImage()); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); glClearColor(0.2, 0.2, 0.2, 0.2); glClear(GL_COLOR_BUFFER_BIT); Loading Loading @@ -1696,8 +1698,9 @@ TEST_F(SurfaceTextureGLToGLTest, TexturingFromPreRotatedUserSizedGLFilledBuffer) glDisable(GL_SCISSOR_TEST); mST->updateTexImage(); // Skip the first frame, which was empty mST->updateTexImage(); // Skip the first frame, which was empty ASSERT_EQ(NO_ERROR, mST->updateTexImage()); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); glClearColor(0.2, 0.2, 0.2, 0.2); glClear(GL_COLOR_BUFFER_BIT); Loading Loading @@ -1753,8 +1756,9 @@ TEST_F(SurfaceTextureGLToGLTest, TexturingFromPreRotatedGLFilledBuffer) { glDisable(GL_SCISSOR_TEST); mST->updateTexImage(); // Skip the first frame, which was empty mST->updateTexImage(); // Skip the first frame, which was empty ASSERT_EQ(NO_ERROR, mST->updateTexImage()); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); glClearColor(0.2, 0.2, 0.2, 0.2); glClear(GL_COLOR_BUFFER_BIT); Loading Loading @@ -1944,7 +1948,7 @@ TEST_F(SurfaceTextureGLThreadToGLTest, runProducerThread(new PT()); mFC->waitForFrame(); mST->updateTexImage(); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); mFC->finishFrame(); // TODO: Add frame verification once RGB TEX_EXTERNAL_OES is supported! Loading @@ -1964,7 +1968,7 @@ TEST_F(SurfaceTextureGLThreadToGLTest, mFC->waitForFrame(); mFC->finishFrame(); mST->updateTexImage(); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); // TODO: Add frame verification once RGB TEX_EXTERNAL_OES is supported! } Loading @@ -1990,7 +1994,7 @@ TEST_F(SurfaceTextureGLThreadToGLTest, for (int i = 0; i < NUM_ITERATIONS; i++) { mFC->waitForFrame(); ALOGV("+updateTexImage"); mST->updateTexImage(); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); ALOGV("-updateTexImage"); mFC->finishFrame(); Loading Loading @@ -2020,7 +2024,7 @@ TEST_F(SurfaceTextureGLThreadToGLTest, mFC->waitForFrame(); mFC->finishFrame(); ALOGV("+updateTexImage"); mST->updateTexImage(); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); ALOGV("-updateTexImage"); // TODO: Add frame verification once RGB TEX_EXTERNAL_OES is supported! Loading Loading @@ -2062,7 +2066,7 @@ TEST_F(SurfaceTextureGLThreadToGLTest, // that happens before we call setDefaultMaxBufferCount. It's possible that the // driver does not dequeue a buffer at EGLSurface creation time, so we // cannot rely on this to cause the second dequeueBuffer call to block. mST->updateTexImage(); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); mFC->waitForFrame(); mFC->finishFrame(); Loading @@ -2081,15 +2085,15 @@ TEST_F(SurfaceTextureGLThreadToGLTest, } // Consume the two pending buffers to unblock the producer thread. mST->updateTexImage(); mST->updateTexImage(); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); // Consume the remaining buffers from the producer thread. for (int i = 0; i < NUM_ITERATIONS-3; i++) { mFC->waitForFrame(); mFC->finishFrame(); ALOGV("+updateTexImage"); mST->updateTexImage(); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); ALOGV("-updateTexImage"); } } Loading libs/ui/GraphicBuffer.cpp +6 −1 Original line number Diff line number Diff line Loading @@ -258,7 +258,12 @@ status_t GraphicBuffer::unflatten(void const* buffer, size_t size, mOwner = ownHandle; if (handle != 0) { mBufferMapper.registerBuffer(handle); status_t err = mBufferMapper.registerBuffer(handle); if (err != NO_ERROR) { ALOGE("unflatten: registerBuffer failed: %s (%d)", strerror(-err), err); return err; } } return NO_ERROR; Loading Loading
libs/gui/IGraphicBufferAlloc.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -55,7 +55,7 @@ public: status_t result = reply.readInt32(); if (result == NO_ERROR) { graphicBuffer = new GraphicBuffer(); reply.read(*graphicBuffer); result = reply.read(*graphicBuffer); // reply.readStrongBinder(); // here we don't even have to read the BufferReference from // the parcel, it'll die with the parcel. Loading
libs/gui/SurfaceTexture.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -288,7 +288,9 @@ status_t SurfaceTexture::updateTexImage(BufferRejecter* rejecter) { computeCurrentTransformMatrix(); } else { if (err < 0) { ST_LOGE("updateTexImage failed on acquire %d", err); ST_LOGE("updateTexImage: acquire failed: %s (%d)", strerror(-err), err); return err; } // We always bind the texture even if we don't update its contents. glBindTexture(mTexTarget, mTexName); Loading
libs/gui/tests/SurfaceTexture_test.cpp +31 −27 Original line number Diff line number Diff line Loading @@ -711,7 +711,7 @@ TEST_F(SurfaceTextureGLTest, TexturingFromCpuFilledYV12BufferNpot) { ASSERT_EQ(NO_ERROR, mANW->queueBuffer(mANW.get(), buf->getNativeBuffer(), -1)); mST->updateTexImage(); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); glClearColor(0.2, 0.2, 0.2, 0.2); glClear(GL_COLOR_BUFFER_BIT); Loading Loading @@ -757,7 +757,7 @@ TEST_F(SurfaceTextureGLTest, TexturingFromCpuFilledYV12BufferPow2) { ASSERT_EQ(NO_ERROR, mANW->queueBuffer(mANW.get(), buf->getNativeBuffer(), -1)); mST->updateTexImage(); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); glClearColor(0.2, 0.2, 0.2, 0.2); glClear(GL_COLOR_BUFFER_BIT); Loading Loading @@ -817,7 +817,7 @@ TEST_F(SurfaceTextureGLTest, TexturingFromCpuFilledYV12BufferWithCrop) { ASSERT_EQ(NO_ERROR, mANW->queueBuffer(mANW.get(), buf->getNativeBuffer(), -1)); mST->updateTexImage(); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); glClearColor(0.2, 0.2, 0.2, 0.2); glClear(GL_COLOR_BUFFER_BIT); Loading Loading @@ -966,7 +966,7 @@ TEST_F(SurfaceTextureGLTest, TexturingFromCpuFilledYV12BuffersRepeatedly) { if (i > 1) { mFW->waitForFrame(); } mST->updateTexImage(); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); drawTexture(); for (int j = 0; j < numTestPixels; j++) { Loading Loading @@ -997,7 +997,7 @@ TEST_F(SurfaceTextureGLTest, TexturingFromCpuFilledRGBABufferNpot) { ASSERT_NO_FATAL_FAILURE(produceOneRGBA8Frame(mANW)); mST->updateTexImage(); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); glClearColor(0.2, 0.2, 0.2, 0.2); glClear(GL_COLOR_BUFFER_BIT); Loading Loading @@ -1039,7 +1039,7 @@ TEST_F(SurfaceTextureGLTest, TexturingFromCpuFilledRGBABufferPow2) { ASSERT_NO_FATAL_FAILURE(produceOneRGBA8Frame(mANW)); mST->updateTexImage(); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); glClearColor(0.2, 0.2, 0.2, 0.2); glClear(GL_COLOR_BUFFER_BIT); Loading Loading @@ -1453,8 +1453,9 @@ TEST_F(SurfaceTextureGLToGLTest, TexturingFromGLFilledRGBABufferPow2) { glDisable(GL_SCISSOR_TEST); mST->updateTexImage(); // Skip the first frame, which was empty mST->updateTexImage(); // Skip the first frame, which was empty ASSERT_EQ(NO_ERROR, mST->updateTexImage()); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); glClearColor(0.2, 0.2, 0.2, 0.2); glClear(GL_COLOR_BUFFER_BIT); Loading Loading @@ -1508,7 +1509,7 @@ TEST_F(SurfaceTextureGLToGLTest, EglDestroySurfaceUnrefsBuffers) { mEglContext)); ASSERT_EQ(EGL_SUCCESS, eglGetError()); mFW->waitForFrame(); mST->updateTexImage(); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); buffers[i] = mST->getCurrentBuffer(); } Loading Loading @@ -1639,8 +1640,9 @@ TEST_F(SurfaceTextureGLToGLTest, TexturingFromUserSizedGLFilledBuffer) { glDisable(GL_SCISSOR_TEST); mST->updateTexImage(); // Skip the first frame, which was empty mST->updateTexImage(); // Skip the first frame, which was empty ASSERT_EQ(NO_ERROR, mST->updateTexImage()); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); glClearColor(0.2, 0.2, 0.2, 0.2); glClear(GL_COLOR_BUFFER_BIT); Loading Loading @@ -1696,8 +1698,9 @@ TEST_F(SurfaceTextureGLToGLTest, TexturingFromPreRotatedUserSizedGLFilledBuffer) glDisable(GL_SCISSOR_TEST); mST->updateTexImage(); // Skip the first frame, which was empty mST->updateTexImage(); // Skip the first frame, which was empty ASSERT_EQ(NO_ERROR, mST->updateTexImage()); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); glClearColor(0.2, 0.2, 0.2, 0.2); glClear(GL_COLOR_BUFFER_BIT); Loading Loading @@ -1753,8 +1756,9 @@ TEST_F(SurfaceTextureGLToGLTest, TexturingFromPreRotatedGLFilledBuffer) { glDisable(GL_SCISSOR_TEST); mST->updateTexImage(); // Skip the first frame, which was empty mST->updateTexImage(); // Skip the first frame, which was empty ASSERT_EQ(NO_ERROR, mST->updateTexImage()); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); glClearColor(0.2, 0.2, 0.2, 0.2); glClear(GL_COLOR_BUFFER_BIT); Loading Loading @@ -1944,7 +1948,7 @@ TEST_F(SurfaceTextureGLThreadToGLTest, runProducerThread(new PT()); mFC->waitForFrame(); mST->updateTexImage(); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); mFC->finishFrame(); // TODO: Add frame verification once RGB TEX_EXTERNAL_OES is supported! Loading @@ -1964,7 +1968,7 @@ TEST_F(SurfaceTextureGLThreadToGLTest, mFC->waitForFrame(); mFC->finishFrame(); mST->updateTexImage(); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); // TODO: Add frame verification once RGB TEX_EXTERNAL_OES is supported! } Loading @@ -1990,7 +1994,7 @@ TEST_F(SurfaceTextureGLThreadToGLTest, for (int i = 0; i < NUM_ITERATIONS; i++) { mFC->waitForFrame(); ALOGV("+updateTexImage"); mST->updateTexImage(); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); ALOGV("-updateTexImage"); mFC->finishFrame(); Loading Loading @@ -2020,7 +2024,7 @@ TEST_F(SurfaceTextureGLThreadToGLTest, mFC->waitForFrame(); mFC->finishFrame(); ALOGV("+updateTexImage"); mST->updateTexImage(); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); ALOGV("-updateTexImage"); // TODO: Add frame verification once RGB TEX_EXTERNAL_OES is supported! Loading Loading @@ -2062,7 +2066,7 @@ TEST_F(SurfaceTextureGLThreadToGLTest, // that happens before we call setDefaultMaxBufferCount. It's possible that the // driver does not dequeue a buffer at EGLSurface creation time, so we // cannot rely on this to cause the second dequeueBuffer call to block. mST->updateTexImage(); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); mFC->waitForFrame(); mFC->finishFrame(); Loading @@ -2081,15 +2085,15 @@ TEST_F(SurfaceTextureGLThreadToGLTest, } // Consume the two pending buffers to unblock the producer thread. mST->updateTexImage(); mST->updateTexImage(); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); // Consume the remaining buffers from the producer thread. for (int i = 0; i < NUM_ITERATIONS-3; i++) { mFC->waitForFrame(); mFC->finishFrame(); ALOGV("+updateTexImage"); mST->updateTexImage(); ASSERT_EQ(NO_ERROR, mST->updateTexImage()); ALOGV("-updateTexImage"); } } Loading
libs/ui/GraphicBuffer.cpp +6 −1 Original line number Diff line number Diff line Loading @@ -258,7 +258,12 @@ status_t GraphicBuffer::unflatten(void const* buffer, size_t size, mOwner = ownHandle; if (handle != 0) { mBufferMapper.registerBuffer(handle); status_t err = mBufferMapper.registerBuffer(handle); if (err != NO_ERROR) { ALOGE("unflatten: registerBuffer failed: %s (%d)", strerror(-err), err); return err; } } return NO_ERROR; Loading