Loading libs/gui/Surface.cpp +7 −17 Original line number Diff line number Diff line Loading @@ -20,13 +20,6 @@ #include <android/native_window.h> // We would eliminate the non-conforming zero-length array, but we can't since // this is effectively included from the Linux kernel #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wzero-length-array" #include <sync/sync.h> #pragma clang diagnostic pop #include <binder/Parcel.h> #include <utils/Log.h> Loading Loading @@ -1295,7 +1288,8 @@ void Surface::setSurfaceDamage(android_native_rect_t* rects, size_t numRects) { static status_t copyBlt( const sp<GraphicBuffer>& dst, const sp<GraphicBuffer>& src, const Region& reg) const Region& reg, int *dstFenceFd) { // src and dst with, height and format must be identical. no verification // is done here. Loading @@ -1306,9 +1300,10 @@ static status_t copyBlt( ALOGE_IF(err, "error locking src buffer %s", strerror(-err)); uint8_t* dst_bits = NULL; err = dst->lock(GRALLOC_USAGE_SW_WRITE_OFTEN, reg.bounds(), reinterpret_cast<void**>(&dst_bits)); err = dst->lockAsync(GRALLOC_USAGE_SW_WRITE_OFTEN, reg.bounds(), reinterpret_cast<void**>(&dst_bits), *dstFenceFd); ALOGE_IF(err, "error locking dst buffer %s", strerror(-err)); *dstFenceFd = -1; Region::const_iterator head(reg.begin()); Region::const_iterator tail(reg.end()); Loading Loading @@ -1342,7 +1337,7 @@ static status_t copyBlt( src->unlock(); if (dst_bits) dst->unlock(); dst->unlockAsync(dstFenceFd); return err; } Loading Loading @@ -1393,12 +1388,7 @@ status_t Surface::lock( // copy the area that is invalid and not repainted this round const Region copyback(mDirtyRegion.subtract(newDirtyRegion)); if (!copyback.isEmpty()) { if (fenceFd >= 0) { sync_wait(fenceFd, -1); close(fenceFd); fenceFd = -1; } copyBlt(backBuffer, frontBuffer, copyback); copyBlt(backBuffer, frontBuffer, copyback, &fenceFd); } } else { // if we can't copy-back anything, modify the user's dirty Loading Loading
libs/gui/Surface.cpp +7 −17 Original line number Diff line number Diff line Loading @@ -20,13 +20,6 @@ #include <android/native_window.h> // We would eliminate the non-conforming zero-length array, but we can't since // this is effectively included from the Linux kernel #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wzero-length-array" #include <sync/sync.h> #pragma clang diagnostic pop #include <binder/Parcel.h> #include <utils/Log.h> Loading Loading @@ -1295,7 +1288,8 @@ void Surface::setSurfaceDamage(android_native_rect_t* rects, size_t numRects) { static status_t copyBlt( const sp<GraphicBuffer>& dst, const sp<GraphicBuffer>& src, const Region& reg) const Region& reg, int *dstFenceFd) { // src and dst with, height and format must be identical. no verification // is done here. Loading @@ -1306,9 +1300,10 @@ static status_t copyBlt( ALOGE_IF(err, "error locking src buffer %s", strerror(-err)); uint8_t* dst_bits = NULL; err = dst->lock(GRALLOC_USAGE_SW_WRITE_OFTEN, reg.bounds(), reinterpret_cast<void**>(&dst_bits)); err = dst->lockAsync(GRALLOC_USAGE_SW_WRITE_OFTEN, reg.bounds(), reinterpret_cast<void**>(&dst_bits), *dstFenceFd); ALOGE_IF(err, "error locking dst buffer %s", strerror(-err)); *dstFenceFd = -1; Region::const_iterator head(reg.begin()); Region::const_iterator tail(reg.end()); Loading Loading @@ -1342,7 +1337,7 @@ static status_t copyBlt( src->unlock(); if (dst_bits) dst->unlock(); dst->unlockAsync(dstFenceFd); return err; } Loading Loading @@ -1393,12 +1388,7 @@ status_t Surface::lock( // copy the area that is invalid and not repainted this round const Region copyback(mDirtyRegion.subtract(newDirtyRegion)); if (!copyback.isEmpty()) { if (fenceFd >= 0) { sync_wait(fenceFd, -1); close(fenceFd); fenceFd = -1; } copyBlt(backBuffer, frontBuffer, copyback); copyBlt(backBuffer, frontBuffer, copyback, &fenceFd); } } else { // if we can't copy-back anything, modify the user's dirty Loading