diff options
Diffstat (limited to 'include/ui/ANativeObjectBase.h')
-rw-r--r-- | include/ui/ANativeObjectBase.h | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/include/ui/ANativeObjectBase.h b/include/ui/ANativeObjectBase.h index 640e34b509..e9d5d8d40b 100644 --- a/include/ui/ANativeObjectBase.h +++ b/include/ui/ANativeObjectBase.h @@ -19,26 +19,8 @@ #include <sys/types.h> -#include <system/window.h> +#include <nativebase/nativebase.h> -// --------------------------------------------------------------------------- - -/* FIXME: this is legacy for pixmaps */ -typedef struct egl_native_pixmap_t -{ - int32_t version; /* must be 32 */ - int32_t width; - int32_t height; - int32_t stride; - uint8_t* data; - uint8_t format; - uint8_t rfu[3]; - union { - uint32_t compressedFormat; - int32_t vstride; - }; - int32_t reserved; -} egl_native_pixmap_t; /*****************************************************************************/ @@ -52,7 +34,8 @@ namespace android { * This helper class turns a ANativeXXX object type into a C++ * reference-counted object; with proper type conversions. */ -template <typename NATIVE_TYPE, typename TYPE, typename REF> +template <typename NATIVE_TYPE, typename TYPE, typename REF, + typename NATIVE_BASE = android_native_base_t> class ANativeObjectBase : public NATIVE_TYPE, public REF { public: @@ -65,7 +48,7 @@ public: } protected: - typedef ANativeObjectBase<NATIVE_TYPE, TYPE, REF> BASE; + typedef ANativeObjectBase<NATIVE_TYPE, TYPE, REF, NATIVE_BASE> BASE; ANativeObjectBase() : NATIVE_TYPE(), REF() { NATIVE_TYPE::common.incRef = incRef; NATIVE_TYPE::common.decRef = decRef; @@ -76,17 +59,17 @@ protected: static inline TYPE const* getSelf(NATIVE_TYPE const* self) { return static_cast<TYPE const *>(self); } - static inline TYPE* getSelf(android_native_base_t* base) { + static inline TYPE* getSelf(NATIVE_BASE* base) { return getSelf(reinterpret_cast<NATIVE_TYPE*>(base)); } - static inline TYPE const * getSelf(android_native_base_t const* base) { + static inline TYPE const * getSelf(NATIVE_BASE const* base) { return getSelf(reinterpret_cast<NATIVE_TYPE const*>(base)); } - static void incRef(android_native_base_t* base) { + static void incRef(NATIVE_BASE* base) { ANativeObjectBase* self = getSelf(base); self->incStrong(self); } - static void decRef(android_native_base_t* base) { + static void decRef(NATIVE_BASE* base) { ANativeObjectBase* self = getSelf(base); self->decStrong(self); } |