diff options
author | Naseer Ahmed <naseer@codeaurora.org> | 2012-07-14 21:08:13 -0700 |
---|---|---|
committer | Brian Muramatsu <btmura@google.com> | 2012-07-23 12:39:29 -0700 |
commit | 01d3fd3318a767e6ba75492ed08d57896df95d63 (patch) | |
tree | 75eb5e567c17f2aef27958efea94860de9b73e43 /libcopybit/copybit_c2d.cpp | |
parent | 0c8b7b5c841a7fad5df11b7e02d7cd792cfcc734 (diff) | |
download | display-01d3fd3318a767e6ba75492ed08d57896df95d63.tar.gz |
display: Clean up gralloc
* Remove pmem and ashmem implementations
* Remove usage of RefBase
* Reduce log verbosity
Change-Id: If8ef543d236e5305bd5430f4f9c62c51b3a13787
Diffstat (limited to 'libcopybit/copybit_c2d.cpp')
-rw-r--r-- | libcopybit/copybit_c2d.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/libcopybit/copybit_c2d.cpp b/libcopybit/copybit_c2d.cpp index 72aa2790..1fa08eca 100644 --- a/libcopybit/copybit_c2d.cpp +++ b/libcopybit/copybit_c2d.cpp @@ -49,7 +49,6 @@ using gralloc::IMemAlloc; using gralloc::IonController; using gralloc::alloc_data; -using android::sp; C2D_STATUS (*LINK_c2dCreateSurface)( uint32 *surface_id, uint32 surface_bits, @@ -110,7 +109,7 @@ enum eC2DFlags { FLAGS_YUV_DESTINATION = 1<<1 }; -static android::sp<gralloc::IAllocController> sAlloc = 0; +static gralloc::IAllocController* sAlloc = 0; /******************************************************************************/ /** State information for each device instance */ @@ -922,7 +921,7 @@ static int get_temp_buffer(const bufferInfo& info, alloc_data& data) int allocFlags = GRALLOC_USAGE_PRIVATE_SYSTEM_HEAP; if (sAlloc == 0) { - sAlloc = gralloc::IAllocController::getInstance(false); + sAlloc = gralloc::IAllocController::getInstance(); } if (sAlloc == 0) { @@ -930,7 +929,7 @@ static int get_temp_buffer(const bufferInfo& info, alloc_data& data) return COPYBIT_FAILURE; } - int err = sAlloc->allocate(data, allocFlags, 0); + int err = sAlloc->allocate(data, allocFlags); if (0 != err) { ALOGE("%s: allocate failed", __FUNCTION__); return COPYBIT_FAILURE; @@ -944,7 +943,7 @@ static int get_temp_buffer(const bufferInfo& info, alloc_data& data) static void free_temp_buffer(alloc_data &data) { if (-1 != data.fd) { - sp<IMemAlloc> memalloc = sAlloc->getAllocator(data.allocType); + IMemAlloc* memalloc = sAlloc->getAllocator(data.allocType); memalloc->free_buffer(data.base, data.size, 0, data.fd); } } @@ -1163,7 +1162,7 @@ static int stretch_copybit_internal( copy_image((private_handle_t *)src->handle, &src_image, CONVERT_TO_C2D_FORMAT); // Flush the cache - sp<IMemAlloc> memalloc = sAlloc->getAllocator(src_hnd->flags); + IMemAlloc* memalloc = sAlloc->getAllocator(src_hnd->flags); if (memalloc->clean_buffer((void *)(src_hnd->base), src_hnd->size, src_hnd->offset, src_hnd->fd)) { ALOGE("%s: clean_buffer failed", __FUNCTION__); @@ -1234,7 +1233,7 @@ static int stretch_copybit_internal( // copy the temp. destination without the alignment to the actual destination. copy_image(dst_hnd, dst, CONVERT_TO_ANDROID_FORMAT); // Invalidate the cache. - sp<IMemAlloc> memalloc = sAlloc->getAllocator(dst_hnd->flags); + IMemAlloc* memalloc = sAlloc->getAllocator(dst_hnd->flags); memalloc->clean_buffer((void *)(dst_hnd->base), dst_hnd->size, dst_hnd->offset, dst_hnd->fd); } |