Loading include/gui/Surface.h +5 −5 Original line number Original line Diff line number Diff line Loading @@ -298,12 +298,12 @@ private: sp<GraphicBuffer> mPostedBuffer; sp<GraphicBuffer> mPostedBuffer; bool mConnectedToCpu; bool mConnectedToCpu; // In the lock/unlock context, this reflects the region that the producer // When a CPU producer is attached, this reflects the region that the // wished to update and whether the Surface was able to copy the previous // producer wished to update as well as whether the Surface was able to copy // buffer back to allow a partial update. // the previous buffer back to allow a partial update. // // // In the dequeue/queue context, this reflects the surface damage (the // When a non-CPU producer is attached, this reflects the surface damage // damage since the last frame) passed in by the producer. // (the change since the previous frame) passed in by the producer. Region mDirtyRegion; Region mDirtyRegion; }; }; Loading libs/gui/Surface.cpp +6 −4 Original line number Original line Diff line number Diff line Loading @@ -322,7 +322,7 @@ int Surface::queueBuffer(android_native_buffer_t* buffer, int fenceFd) { mDataSpace, crop, mScalingMode, mTransform ^ mStickyTransform, mDataSpace, crop, mScalingMode, mTransform ^ mStickyTransform, mSwapIntervalZero, fence, mStickyTransform); mSwapIntervalZero, fence, mStickyTransform); if (mDirtyRegion.bounds() == Rect::INVALID_RECT) { if (mConnectedToCpu || mDirtyRegion.bounds() == Rect::INVALID_RECT) { input.setSurfaceDamage(Region::INVALID_REGION); input.setSurfaceDamage(Region::INVALID_REGION); } else { } else { // The surface damage was specified using the OpenGL ES convention of // The surface damage was specified using the OpenGL ES convention of Loading Loading @@ -356,8 +356,10 @@ int Surface::queueBuffer(android_native_buffer_t* buffer, int fenceFd) { mConsumerRunningBehind = (numPendingBuffers >= 2); mConsumerRunningBehind = (numPendingBuffers >= 2); if (!mConnectedToCpu) { // Clear surface damage back to full-buffer // Clear surface damage back to full-buffer mDirtyRegion = Region::INVALID_REGION; mDirtyRegion = Region::INVALID_REGION; } return err; return err; } } Loading Loading @@ -844,7 +846,7 @@ void Surface::setSurfaceDamage(android_native_rect_t* rects, size_t numRects) { ALOGV("Surface::setSurfaceDamage"); ALOGV("Surface::setSurfaceDamage"); Mutex::Autolock lock(mMutex); Mutex::Autolock lock(mMutex); if (numRects == 0) { if (mConnectedToCpu || numRects == 0) { mDirtyRegion = Region::INVALID_REGION; mDirtyRegion = Region::INVALID_REGION; return; return; } } Loading Loading
include/gui/Surface.h +5 −5 Original line number Original line Diff line number Diff line Loading @@ -298,12 +298,12 @@ private: sp<GraphicBuffer> mPostedBuffer; sp<GraphicBuffer> mPostedBuffer; bool mConnectedToCpu; bool mConnectedToCpu; // In the lock/unlock context, this reflects the region that the producer // When a CPU producer is attached, this reflects the region that the // wished to update and whether the Surface was able to copy the previous // producer wished to update as well as whether the Surface was able to copy // buffer back to allow a partial update. // the previous buffer back to allow a partial update. // // // In the dequeue/queue context, this reflects the surface damage (the // When a non-CPU producer is attached, this reflects the surface damage // damage since the last frame) passed in by the producer. // (the change since the previous frame) passed in by the producer. Region mDirtyRegion; Region mDirtyRegion; }; }; Loading
libs/gui/Surface.cpp +6 −4 Original line number Original line Diff line number Diff line Loading @@ -322,7 +322,7 @@ int Surface::queueBuffer(android_native_buffer_t* buffer, int fenceFd) { mDataSpace, crop, mScalingMode, mTransform ^ mStickyTransform, mDataSpace, crop, mScalingMode, mTransform ^ mStickyTransform, mSwapIntervalZero, fence, mStickyTransform); mSwapIntervalZero, fence, mStickyTransform); if (mDirtyRegion.bounds() == Rect::INVALID_RECT) { if (mConnectedToCpu || mDirtyRegion.bounds() == Rect::INVALID_RECT) { input.setSurfaceDamage(Region::INVALID_REGION); input.setSurfaceDamage(Region::INVALID_REGION); } else { } else { // The surface damage was specified using the OpenGL ES convention of // The surface damage was specified using the OpenGL ES convention of Loading Loading @@ -356,8 +356,10 @@ int Surface::queueBuffer(android_native_buffer_t* buffer, int fenceFd) { mConsumerRunningBehind = (numPendingBuffers >= 2); mConsumerRunningBehind = (numPendingBuffers >= 2); if (!mConnectedToCpu) { // Clear surface damage back to full-buffer // Clear surface damage back to full-buffer mDirtyRegion = Region::INVALID_REGION; mDirtyRegion = Region::INVALID_REGION; } return err; return err; } } Loading Loading @@ -844,7 +846,7 @@ void Surface::setSurfaceDamage(android_native_rect_t* rects, size_t numRects) { ALOGV("Surface::setSurfaceDamage"); ALOGV("Surface::setSurfaceDamage"); Mutex::Autolock lock(mMutex); Mutex::Autolock lock(mMutex); if (numRects == 0) { if (mConnectedToCpu || numRects == 0) { mDirtyRegion = Region::INVALID_REGION; mDirtyRegion = Region::INVALID_REGION; return; return; } } Loading