Loading libs/hwui/Readback.cpp +12 −3 Original line number Diff line number Diff line Loading @@ -169,7 +169,7 @@ CopyResult Readback::copySurfaceInto(renderthread::RenderThread& renderThread, EGL_NATIVE_BUFFER_ANDROID, clientBuffer, attrs); if (sourceImage == EGL_NO_IMAGE_KHR) { ALOGW("Error creating image (%#x)", eglGetError()); ALOGW("eglCreateImageKHR failed (%#x)", eglGetError()); return CopyResult::UnknownError; } GLuint sourceTexId; Loading @@ -180,7 +180,8 @@ CopyResult Readback::copySurfaceInto(renderthread::RenderThread& renderThread, GLenum status = GL_NO_ERROR; while ((status = glGetError()) != GL_NO_ERROR) { ALOGW("Error creating image (%#x)", status); ALOGW("glEGLImageTargetTexture2DOES failed (%#x)", status); eglDestroyImageKHR(display, sourceImage); return CopyResult::UnknownError; } Loading @@ -188,7 +189,15 @@ CopyResult Readback::copySurfaceInto(renderthread::RenderThread& renderThread, sourceTexture.wrap(sourceTexId, sourceBuffer->getWidth(), sourceBuffer->getHeight(), 0 /* total lie */); return copyTextureInto(caches, renderThread.renderState(), sourceTexture, texTransform, bitmap); CopyResult copyResult = copyTextureInto(caches, renderThread.renderState(), sourceTexture, texTransform, bitmap); sourceTexture.deleteTexture(); // All we're flushing & finishing is the deletion of the texture since // copyTextureInto already did a major flush & finish as an implicit // part of glReadPixels, so this shouldn't pose any major stalls. glFinish(); eglDestroyImageKHR(display, sourceImage); return copyResult; } CopyResult Readback::copyTextureLayerInto(renderthread::RenderThread& renderThread, Loading Loading
libs/hwui/Readback.cpp +12 −3 Original line number Diff line number Diff line Loading @@ -169,7 +169,7 @@ CopyResult Readback::copySurfaceInto(renderthread::RenderThread& renderThread, EGL_NATIVE_BUFFER_ANDROID, clientBuffer, attrs); if (sourceImage == EGL_NO_IMAGE_KHR) { ALOGW("Error creating image (%#x)", eglGetError()); ALOGW("eglCreateImageKHR failed (%#x)", eglGetError()); return CopyResult::UnknownError; } GLuint sourceTexId; Loading @@ -180,7 +180,8 @@ CopyResult Readback::copySurfaceInto(renderthread::RenderThread& renderThread, GLenum status = GL_NO_ERROR; while ((status = glGetError()) != GL_NO_ERROR) { ALOGW("Error creating image (%#x)", status); ALOGW("glEGLImageTargetTexture2DOES failed (%#x)", status); eglDestroyImageKHR(display, sourceImage); return CopyResult::UnknownError; } Loading @@ -188,7 +189,15 @@ CopyResult Readback::copySurfaceInto(renderthread::RenderThread& renderThread, sourceTexture.wrap(sourceTexId, sourceBuffer->getWidth(), sourceBuffer->getHeight(), 0 /* total lie */); return copyTextureInto(caches, renderThread.renderState(), sourceTexture, texTransform, bitmap); CopyResult copyResult = copyTextureInto(caches, renderThread.renderState(), sourceTexture, texTransform, bitmap); sourceTexture.deleteTexture(); // All we're flushing & finishing is the deletion of the texture since // copyTextureInto already did a major flush & finish as an implicit // part of glReadPixels, so this shouldn't pose any major stalls. glFinish(); eglDestroyImageKHR(display, sourceImage); return copyResult; } CopyResult Readback::copyTextureLayerInto(renderthread::RenderThread& renderThread, Loading