am 3805a00d: am 91f16b1b: am e647ddde: Merge "libgui: Fix CPU rendering on Surface"

* commit '3805a00d6efef02535aaed96f412e0c55a9875f8':
  libgui: Fix CPU rendering on Surface
This commit is contained in:
Dan Stoza 2015-04-22 00:47:35 +00:00 committed by Android Git Automerger
commit 2bff43a912
2 changed files with 11 additions and 9 deletions

View File

@ -298,12 +298,12 @@ private:
sp<GraphicBuffer> mPostedBuffer;
bool mConnectedToCpu;
// In the lock/unlock context, this reflects the region that the producer
// wished to update and whether the Surface was able to copy the previous
// buffer back to allow a partial update.
// When a CPU producer is attached, this reflects the region that the
// producer wished to update as well as whether the Surface was able to copy
// the previous buffer back to allow a partial update.
//
// In the dequeue/queue context, this reflects the surface damage (the
// damage since the last frame) passed in by the producer.
// When a non-CPU producer is attached, this reflects the surface damage
// (the change since the previous frame) passed in by the producer.
Region mDirtyRegion;
};

View File

@ -322,7 +322,7 @@ int Surface::queueBuffer(android_native_buffer_t* buffer, int fenceFd) {
mDataSpace, crop, mScalingMode, mTransform ^ mStickyTransform,
mSwapIntervalZero, fence, mStickyTransform);
if (mDirtyRegion.bounds() == Rect::INVALID_RECT) {
if (mConnectedToCpu || mDirtyRegion.bounds() == Rect::INVALID_RECT) {
input.setSurfaceDamage(Region::INVALID_REGION);
} else {
// The surface damage was specified using the OpenGL ES convention of
@ -356,8 +356,10 @@ int Surface::queueBuffer(android_native_buffer_t* buffer, int fenceFd) {
mConsumerRunningBehind = (numPendingBuffers >= 2);
// Clear surface damage back to full-buffer
mDirtyRegion = Region::INVALID_REGION;
if (!mConnectedToCpu) {
// Clear surface damage back to full-buffer
mDirtyRegion = Region::INVALID_REGION;
}
return err;
}
@ -844,7 +846,7 @@ void Surface::setSurfaceDamage(android_native_rect_t* rects, size_t numRects) {
ALOGV("Surface::setSurfaceDamage");
Mutex::Autolock lock(mMutex);
if (numRects == 0) {
if (mConnectedToCpu || numRects == 0) {
mDirtyRegion = Region::INVALID_REGION;
return;
}