diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp index ca85dfbf1bab4..0620653371a61 100644 --- a/libs/hwui/renderthread/CanvasContext.cpp +++ b/libs/hwui/renderthread/CanvasContext.cpp @@ -513,9 +513,11 @@ void CanvasContext::draw() { // Called by choreographer to do an RT-driven animation void CanvasContext::doFrame() { - if (CC_UNLIKELY(!mCanvas || mEglSurface == EGL_NO_SURFACE)) { - return; - } +#if HWUI_NEW_OPS + if (CC_UNLIKELY(mEglSurface == EGL_NO_SURFACE)) return; +#else + if (CC_UNLIKELY(!mCanvas || mEglSurface == EGL_NO_SURFACE)) return; +#endif prepareAndDraw(nullptr); }