summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/RenderProxy.cpp
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2020-02-15 02:16:16 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-02-15 02:16:16 +0000
commit805edec77dd1caa3a2488ad9dad53f71e93b622a (patch)
treedc20c8a7823eb223b0a859f4c399e8da44384e04 /libs/hwui/renderthread/RenderProxy.cpp
parent326b8ecf17cc85ae07bb13a7ab3d3513973faeea (diff)
parent43fe6fcde5cb2630a8d1ffa47d3e6e58e11999ae (diff)
Merge "[HWUI] Remove references to gui/Surface."
Diffstat (limited to 'libs/hwui/renderthread/RenderProxy.cpp')
-rw-r--r--libs/hwui/renderthread/RenderProxy.cpp13
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);
}));