[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
diff --git a/libs/hwui/renderthread/ReliableSurface.h b/libs/hwui/renderthread/ReliableSurface.h
index e3cd8c0..58cd067 100644
--- a/libs/hwui/renderthread/ReliableSurface.h
+++ b/libs/hwui/renderthread/ReliableSurface.h
@@ -16,12 +16,14 @@
#pragma once
+#include <android-base/unique_fd.h>
#include <apex/window.h>
-#include <gui/Surface.h>
+#include <utils/Errors.h>
#include <utils/Macros.h>
#include <utils/StrongPointer.h>
#include <memory>
+#include <mutex>
namespace android::uirenderer::renderthread {
@@ -29,7 +31,7 @@
PREVENT_COPY_AND_ASSIGN(ReliableSurface);
public:
- ReliableSurface(sp<Surface>&& surface);
+ ReliableSurface(ANativeWindow* window);
~ReliableSurface();
// Performs initialization that is not safe to do in the constructor.
@@ -37,12 +39,10 @@
// passed as the data pointer is not safe.
void init();
- ANativeWindow* getNativeWindow() { return mSurface.get(); }
+ ANativeWindow* getNativeWindow() { return mWindow; }
int reserveNext();
- int query(int what, int* value) const { return mSurface->query(what, value); }
-
int getAndClearError() {
int ret = mBufferQueueState;
mBufferQueueState = OK;
@@ -50,12 +50,12 @@
}
private:
- sp<Surface> mSurface;
+ ANativeWindow* mWindow;
mutable std::mutex mMutex;
uint64_t mUsage = AHARDWAREBUFFER_USAGE_GPU_FRAMEBUFFER;
- PixelFormat mFormat = PIXEL_FORMAT_RGBA_8888;
+ AHardwareBuffer_Format mFormat = AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM;
std::unique_ptr<AHardwareBuffer, void (*)(AHardwareBuffer*)> mScratchBuffer{
nullptr, AHardwareBuffer_release};
ANativeWindowBuffer* mReservedBuffer = nullptr;