Loading libs/hwui/renderthread/CanvasContext.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -145,7 +145,11 @@ void CanvasContext::setOpaque(bool opaque) { void CanvasContext::makeCurrent() { // TODO: Figure out why this workaround is needed, see b/13913604 // In the meantime this matches the behavior of GLRenderer, so it is not a regression mHaveNewSurface |= mEglManager.makeCurrent(mEglSurface); EGLint error = 0; mHaveNewSurface |= mEglManager.makeCurrent(mEglSurface, &error); if (error) { setSurface(nullptr); } } void CanvasContext::processLayerUpdate(DeferredLayerUpdater* layerUpdater) { Loading libs/hwui/renderthread/EglManager.cpp +9 −3 Original line number Diff line number Diff line Loading @@ -217,7 +217,7 @@ void EglManager::destroy() { mCurrentSurface = EGL_NO_SURFACE; } bool EglManager::makeCurrent(EGLSurface surface) { bool EglManager::makeCurrent(EGLSurface surface, EGLint* errOut) { if (isCurrent(surface)) return false; if (surface == EGL_NO_SURFACE) { Loading @@ -225,9 +225,15 @@ bool EglManager::makeCurrent(EGLSurface surface) { surface = mPBufferSurface; } if (!eglMakeCurrent(mEglDisplay, surface, surface, mEglContext)) { if (errOut) { *errOut = eglGetError(); ALOGW("Failed to make current on surface %p, error=%s", (void*)surface, egl_error_str(*errOut)); } else { LOG_ALWAYS_FATAL("Failed to make current on surface %p, error=%s", (void*)surface, egl_error_str()); } } mCurrentSurface = surface; return true; } Loading libs/hwui/renderthread/EglManager.h +1 −1 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ public: bool isCurrent(EGLSurface surface) { return mCurrentSurface == surface; } // Returns true if the current surface changed, false if it was already current bool makeCurrent(EGLSurface surface); bool makeCurrent(EGLSurface surface, EGLint* errOut = nullptr); void beginFrame(EGLSurface surface, EGLint* width, EGLint* height); bool swapBuffers(EGLSurface surface, const SkRect& dirty, EGLint width, EGLint height); Loading Loading
libs/hwui/renderthread/CanvasContext.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -145,7 +145,11 @@ void CanvasContext::setOpaque(bool opaque) { void CanvasContext::makeCurrent() { // TODO: Figure out why this workaround is needed, see b/13913604 // In the meantime this matches the behavior of GLRenderer, so it is not a regression mHaveNewSurface |= mEglManager.makeCurrent(mEglSurface); EGLint error = 0; mHaveNewSurface |= mEglManager.makeCurrent(mEglSurface, &error); if (error) { setSurface(nullptr); } } void CanvasContext::processLayerUpdate(DeferredLayerUpdater* layerUpdater) { Loading
libs/hwui/renderthread/EglManager.cpp +9 −3 Original line number Diff line number Diff line Loading @@ -217,7 +217,7 @@ void EglManager::destroy() { mCurrentSurface = EGL_NO_SURFACE; } bool EglManager::makeCurrent(EGLSurface surface) { bool EglManager::makeCurrent(EGLSurface surface, EGLint* errOut) { if (isCurrent(surface)) return false; if (surface == EGL_NO_SURFACE) { Loading @@ -225,9 +225,15 @@ bool EglManager::makeCurrent(EGLSurface surface) { surface = mPBufferSurface; } if (!eglMakeCurrent(mEglDisplay, surface, surface, mEglContext)) { if (errOut) { *errOut = eglGetError(); ALOGW("Failed to make current on surface %p, error=%s", (void*)surface, egl_error_str(*errOut)); } else { LOG_ALWAYS_FATAL("Failed to make current on surface %p, error=%s", (void*)surface, egl_error_str()); } } mCurrentSurface = surface; return true; } Loading
libs/hwui/renderthread/EglManager.h +1 −1 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ public: bool isCurrent(EGLSurface surface) { return mCurrentSurface == surface; } // Returns true if the current surface changed, false if it was already current bool makeCurrent(EGLSurface surface); bool makeCurrent(EGLSurface surface, EGLint* errOut = nullptr); void beginFrame(EGLSurface surface, EGLint* width, EGLint* height); bool swapBuffers(EGLSurface surface, const SkRect& dirty, EGLint width, EGLint height); Loading