diff options
author | Jamie Gennis <jgennis@google.com> | 2010-05-11 12:25:31 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-05-11 12:25:31 -0700 |
commit | 1853b7d7904a78bff1728a9299b64275c1800885 (patch) | |
tree | 8a093c05800b77519a2cc7592aa0c0da2f1617e8 /include/ui/android_native_buffer.h | |
parent | 0ec06bc48e18e5d6bc9aa48b1264f0c8f86b2e17 (diff) | |
parent | 5e67f87430d581155c700bb33ac0b43ed5de20b7 (diff) | |
download | frameworks_native-1853b7d7904a78bff1728a9299b64275c1800885.zip frameworks_native-1853b7d7904a78bff1728a9299b64275c1800885.tar.gz frameworks_native-1853b7d7904a78bff1728a9299b64275c1800885.tar.bz2 |
Merge "Add incStrong and decStrong methods to android_native_{window,buffer}_t." into kraken
Diffstat (limited to 'include/ui/android_native_buffer.h')
-rw-r--r-- | include/ui/android_native_buffer.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/ui/android_native_buffer.h b/include/ui/android_native_buffer.h index 9c92af8..402843e 100644 --- a/include/ui/android_native_buffer.h +++ b/include/ui/android_native_buffer.h @@ -33,6 +33,15 @@ typedef struct android_native_buffer_t common.version = sizeof(android_native_buffer_t); memset(common.reserved, 0, sizeof(common.reserved)); } + + // Implement the methods that sp<android_native_buffer_t> expects so that it + // can be used to automatically refcount android_native_buffer_t's. + void incStrong(const void* id) const { + common.incRef(const_cast<android_native_base_t*>(&common)); + } + void decStrong(const void* id) const { + common.decRef(const_cast<android_native_base_t*>(&common)); + } #endif struct android_native_base_t common; |