summaryrefslogtreecommitdiffstats
path: root/libs/hwui/renderthread/CanvasContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/renderthread/CanvasContext.cpp')
-rw-r--r--libs/hwui/renderthread/CanvasContext.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp
index 260fb6f..09f93b8 100644
--- a/libs/hwui/renderthread/CanvasContext.cpp
+++ b/libs/hwui/renderthread/CanvasContext.cpp
@@ -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) {