diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2020-02-15 02:16:16 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-02-15 02:16:16 +0000 |
commit | 805edec77dd1caa3a2488ad9dad53f71e93b622a (patch) | |
tree | dc20c8a7823eb223b0a859f4c399e8da44384e04 /libs/hwui/renderthread/CanvasContext.cpp | |
parent | 326b8ecf17cc85ae07bb13a7ab3d3513973faeea (diff) | |
parent | 43fe6fcde5cb2630a8d1ffa47d3e6e58e11999ae (diff) |
Merge "[HWUI] Remove references to gui/Surface."
Diffstat (limited to 'libs/hwui/renderthread/CanvasContext.cpp')
-rw-r--r-- | libs/hwui/renderthread/CanvasContext.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp index 1df3336bb5e5..4299dd3b46fe 100644 --- a/libs/hwui/renderthread/CanvasContext.cpp +++ b/libs/hwui/renderthread/CanvasContext.cpp @@ -139,15 +139,15 @@ void CanvasContext::destroy() { mAnimationContext->destroy(); } -void CanvasContext::setSurface(sp<Surface>&& surface, bool enableTimeout) { +void CanvasContext::setSurface(ANativeWindow* window, bool enableTimeout) { ATRACE_CALL(); - if (surface) { - mNativeSurface = std::make_unique<ReliableSurface>(std::move(surface)); + if (window) { + mNativeSurface = std::make_unique<ReliableSurface>(window); mNativeSurface->init(); if (enableTimeout) { // TODO: Fix error handling & re-shorten timeout - ANativeWindow_setDequeueTimeout(mNativeSurface->getNativeWindow(), 4000_ms); + ANativeWindow_setDequeueTimeout(window, 4000_ms); } } else { mNativeSurface = nullptr; @@ -167,7 +167,7 @@ void CanvasContext::setSurface(sp<Surface>&& surface, bool enableTimeout) { mFrameNumber = -1; - if (hasSurface) { + if (window != nullptr && hasSurface) { mHaveNewSurface = true; mSwapHistory.clear(); // Enable frame stats after the surface has been bound to the appropriate graphics API. |