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/RenderProxy.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/RenderProxy.cpp')
-rw-r--r-- | libs/hwui/renderthread/RenderProxy.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp index 1e7fc71a7f04..b66a13d1efda 100644 --- a/libs/hwui/renderthread/RenderProxy.cpp +++ b/libs/hwui/renderthread/RenderProxy.cpp @@ -16,8 +16,6 @@ #include "RenderProxy.h" -#include <gui/Surface.h> - #include "DeferredLayerUpdater.h" #include "DisplayList.h" #include "Properties.h" @@ -78,9 +76,11 @@ void RenderProxy::setName(const char* name) { mRenderThread.queue().runSync([this, name]() { mContext->setName(std::string(name)); }); } -void RenderProxy::setSurface(const sp<Surface>& surface, bool enableTimeout) { - mRenderThread.queue().post([this, surf = surface, enableTimeout]() mutable { - mContext->setSurface(std::move(surf), enableTimeout); +void RenderProxy::setSurface(ANativeWindow* window, bool enableTimeout) { + ANativeWindow_acquire(window); + mRenderThread.queue().post([this, win = window, enableTimeout]() mutable { + mContext->setSurface(win, enableTimeout); + ANativeWindow_release(win); }); } @@ -314,10 +314,9 @@ void RenderProxy::setRenderAheadDepth(int renderAhead) { [context = mContext, renderAhead] { context->setRenderAheadDepth(renderAhead); }); } -int RenderProxy::copySurfaceInto(sp<Surface>& surface, int left, int top, int right, int bottom, +int RenderProxy::copySurfaceInto(ANativeWindow* window, int left, int top, int right, int bottom, SkBitmap* bitmap) { auto& thread = RenderThread::getInstance(); - ANativeWindow* window = surface.get(); return static_cast<int>(thread.queue().runSync([&]() -> auto { return thread.readback().copySurfaceInto(window, Rect(left, top, right, bottom), bitmap); })); |