summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2014-05-07 21:24:22 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-05-07 21:24:23 +0000
commit841057ffc0283f7e5d5fd750ee1519ee313ed869 (patch)
tree5b27c527bb58d1f58dcd34b8a9cc9a899d103e5b
parent603d270a531e6855418bffebdcdfbda013a2dbbe (diff)
parent368cdd85268999997fb495cf90c4417221797de0 (diff)
downloadframeworks_base-841057ffc0283f7e5d5fd750ee1519ee313ed869.zip
frameworks_base-841057ffc0283f7e5d5fd750ee1519ee313ed869.tar.gz
frameworks_base-841057ffc0283f7e5d5fd750ee1519ee313ed869.tar.bz2
Merge "Don't try to draw if there's no canvas or surface"
-rw-r--r--libs/hwui/renderthread/CanvasContext.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp
index fc3548c..97baba8 100644
--- a/libs/hwui/renderthread/CanvasContext.cpp
+++ b/libs/hwui/renderthread/CanvasContext.cpp
@@ -349,6 +349,8 @@ void CanvasContext::setSurface(EGLNativeWindowType window) {
mDirtyRegionsEnabled = mGlobalContext->enableDirtyRegions(mEglSurface);
mHaveNewSurface = true;
makeCurrent();
+ } else {
+ mRenderThread.removeFrameCallback(this);
}
}
@@ -468,6 +470,10 @@ void CanvasContext::draw(Rect* dirty) {
// Called by choreographer to do an RT-driven animation
void CanvasContext::doFrame() {
+ if (CC_UNLIKELY(!mCanvas || mEglSurface == EGL_NO_SURFACE)) {
+ return;
+ }
+
ATRACE_CALL();
TreeInfo info;