Refactor hal to remove cpuConsumer from drivers
This CL should minimize build breaks due to
BufferQueue changes in the future.
Change-Id: I565a6eae5cc25603741fef32f2cfcb31a32eb757
diff --git a/rsAllocation.h b/rsAllocation.h
index dffa440..440246e 100644
--- a/rsAllocation.h
+++ b/rsAllocation.h
@@ -19,6 +19,14 @@
#include "rsType.h"
+#include <ui/GraphicBuffer.h>
+
+#if !defined(RS_SERVER) && !defined(RS_COMPATIBILITY_LIB)
+#include "rsGrallocConsumer.h"
+#include "gui/CpuConsumer.h"
+#include "gui/GLConsumer.h"
+#endif
+
// ---------------------------------------------------------------------------
namespace android {
@@ -58,8 +66,8 @@
bool hasReferences;
void * userProvidedPtr;
int32_t surfaceTextureID;
- void *deprecated01;
- void *deprecated02;
+ ANativeWindowBuffer *nativeBuffer;
+ int64_t timestamp;
};
State state;
@@ -157,6 +165,20 @@
mHal.state.type = t;
}
+#if !defined(RS_SERVER) && !defined(RS_COMPATIBILITY_LIB)
+ class NewBufferListener : public android::ConsumerBase::FrameAvailableListener {
+ public:
+ const android::renderscript::Context *rsc;
+ const android::renderscript::Allocation *alloc;
+
+ virtual void onFrameAvailable();
+ };
+
+ sp<NewBufferListener> mBufferListener;
+ sp< GrallocConsumer > mGrallocConsumer;
+#endif
+
+
private:
void freeChildrenUnlocked();
Allocation(Context *rsc, const Type *, uint32_t usages, RsAllocationMipmapControl mc, void *ptr);