diff options
author | Alec Mouri <alecmouri@google.com> | 2019-12-23 07:46:19 -0800 |
---|---|---|
committer | Alec Mouri <alecmouri@google.com> | 2020-02-14 15:24:16 -0800 |
commit | 43fe6fcde5cb2630a8d1ffa47d3e6e58e11999ae (patch) | |
tree | 212c6c6fa2959b3288a5031f5271048d10c8734a /libs/hwui/renderthread/CanvasContext.cpp | |
parent | 112dfb3f1606b2033cdec7fc0b829d6cac31838e (diff) |
[HWUI] Remove references to gui/Surface.
ANativeWindow usage now has enough feature parity so that we can use
that instead.
Bug: 137012798
Test: builds
Test: Scroll through settings
Change-Id: I0054315058b28bcb5e779a6f71a3cfb164625a5f
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. |